Last modified: 2012-07-06 17:08:35 UTC
This request is used to track the roadmap point ## Description The JSON format currently manually encodes the data, causing many inconsistencies and bugs (and historically had security issues as well, which might not all be gone). It would be a lot better to create the data structure using php arrays and then serializing it using FormatJSON::encode or json_encode. ## Package SMW ## Release Not defined ## See also [1] includes/queryprinters/SMW_QP_JSONlink [2] includes/SMW_DISerializer
Maybe JSON-LD[1] (JavaScript Object Notation for Linking Data) should be considered as well. [1] http://json-ld.org/
## Description - SMW_QP_JSONlink will use SMWDISerializer::getSerializedQueryResult in order to unify with existing methods. - FormatJSON::encode will encode the array - JavaScript can parse the json string back into its original array using (typeof json == 'string' ? data = JSON.parse( json ) : data = json;) ## JSON Structure -> printrequests: [ { label, typeid, mode} ] -> results: { subject : {printouts: { ["property":[{fulltext:"", fullurl:""}] ] } } }
On the contrary to the previous implementation, the new JSON output does not manipulate the date format and export any date in its original format (time stamp)
https://gerrit.wikimedia.org/r/#/c/14347/
The export structure [1] has been changed. [1] http://www.semantic-mediawiki.org/wiki/Help:JSON_format#Structure
- obsolete -> getObsoleteJSON can be used for compatibility but will be @deprecated in 1.10 - simplified -> getSimplifiedJSON based on SMWDISerializer but with a simplified array structure - complete -> getCompleteJSON based on SMWDISerializer produces the full JSON object