I am trying to emit a JSON string from a set of classes.
I have a top level class (request) that has a few fields + an array.
When I use String jsonString = new JsonWriter(request).toString(); to create the JSON it only creates the fields and array from the request, but it does not write request in the begining of the JSON.
This is the start of the input JSON:
{"gaterequest":{"command":"data","emei":"012345678901234","session_id":"
and this is what is emitted when I have turned it in to java and then back to JSON:
{"command":"data","emei":012345678901234,"session_id":"
I would like for the output string to look just like the input string.. Is it possible to do that using j2j rather than do my own code for that?
/Claus
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am trying to emit a JSON string from a set of classes.
I have a top level class (request) that has a few fields + an array.
When I use String jsonString = new JsonWriter(request).toString(); to create the JSON it only creates the fields and array from the request, but it does not write request in the begining of the JSON.
This is the start of the input JSON:
{"gaterequest":{"command":"data","emei":"012345678901234","session_id":"
and this is what is emitted when I have turned it in to java and then back to JSON:
{"command":"data","emei":012345678901234,"session_id":"
I would like for the output string to look just like the input string.. Is it possible to do that using j2j rather than do my own code for that?
/Claus