Overview
Artifact ID: | 326e35ccd992427ec359f57735296cc7a2aa110c |
---|---|
Ticket: | 2df194042b2acd13c60b0dd92cdf55c1a0ef3bde
json2dict does not always produce a dictionary |
User & Date: | nmadden 2015-01-16 10:20:31 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
The json::json2dict procedure is named and documented as if it produces a dictionary output in all cases. This is incorrect, as per these examples where the output is a string/number/list: % package require json 1.3.3 % json::json2dict {true} true % json::json2dict {1234.45} 1234.45 % json::json2dict {"Hello, World!"} Hello, World! % json::json2dict {[1,2,3,4]} 1 2 3 4 The documentation (and ideally the name) should be updated to make clear that it only returns a dictionary if the input is a JSON object, and that the caller *must know* the type of JSON data being parsed in order to know how to interpret the result correctly. I have seen several questions on TkChat and c.l.t that suggest that this is confusing people.
- foundin changed to: "1.3.3"
- is_private changed to: "0"
- login: "nmadden"
- priority changed to: "5 Medium"
- private_contact changed to: "4d3bc24d727f6c89fb1509fef02f21887282efcc"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "nmadden"
- subsystem changed to: "json"
- title changed to: "json2dict does not always produce a dictionary"
- type changed to: "Bug"