Hi All,

We are in a process of $subject and the main issue we faced in generating
the json schema was as follows.

When generating the json schema we mainly convert the xml to json and the
xml to json conversion does not guarantee the order since json object is an
unordered set of name/value pairs [1].

The main reason is the usage of HashMaps instead of LinkedHashMaps in
instantiating the JSONObjects and we could solve the issue by using the
LinkedHashMaps.

This issue again occurs in serializing the schema while iterating through
the gmf tree, since we are generating the schema by creating the
JSONObjects and JSONArrays appropriately. We could solve this issue as well
by using the above solution and as a result, the generated tree and the
schema will maintain the order of the XML payload

[1]
http://stackoverflow.com/questions/26034370/inverted-order-of-json-elements-in-java-after-xml-conversion

Thanks,
Sohani
Sohani Weerasinghe
Senior Software Engineer
WSO2, Inc: http://wso2.com

Mobile  : +94 716439774
Blog     :http://christinetechtips.blogspot.com/
Twitter  : https://twitter.com/sohanichristine
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to