I have a JSON which is converted from xml. (XML to JSON) But the converted JSON file has some datatype issue, which is not matched with the expected JSON schema For ex: expected is accountId: "123" (in Json schema type is mentioned as String) But actual result is accountId: 123 (it received as a number)
While converting XML to JSON (StAXON parse) makes like this, yes offcourse I didn't feed any datatype related parameters while converting XML to JSON.
From here I have two questions:
- Is there any way to resolve my issue while xml to json convertion itself
- Or else from my Json, I need to validate with Json schema and change the datatype accordingly.
Guide me to do this in better way. Feel free to edit the question as my text is not understandable/misleading.
Note: I am using Spring Integration!!!