Closed Saandji closed 8 years ago
In the JVM SDK it is not supposed to get the API objects as JSON and then as Java and then transform the Java again into JSON.
If you need the Java object and JSON consider to use this class to get them both: http://commercetools.github.io/commercetools-jvm-sdk/apidocs/io/sphere/sdk/client/JavaAndJsonSphereRequest.html
The problem: I have productProjection with list of Prices and each price has custom type. I use SphereJsonUtills.toJsonString(projection);
When i parse it back to ProductProjection i'm getting parse error.
After investigating a bit, i assume that the problem in the next fields:
this is the json of "custom" as it should be:
"custom": { "type": { "typeId": "type", "id": "some_id" }, "fields": { "field1": 1, "field2": "value" } }
this what i get from SpehreUtils.toJsonString:
"custom": { "type": { "typeId": "type", "id": "some_id" }, "fieldsJsonMap": { "field1": 1, "field2": "value" } }