AnsweredAssumed Answered

How to simply convert XML into JSON, validating JSON Schema ?

Question asked by martial.boyer on Aug 2, 2016
Latest reply on Aug 31, 2016 by APIMGTEtudes18000094

Hi dear CA community,

 

I have recurrent problems when converting XML into JSON. Indeed, I often get a JSON Schema of the response from my consumers, and hit an XML backend. Obviously, I have a transformation step to make.

Here is my problem:

- using "Apply JSON transformation" assertion, I am not able to enforce the "type" of my node (mainly "array", "string" and "integer")

- using "Apply XSL Transformation" assertion, I am able to have the correct type in output as I am the master of the syntax, manually adding "[" or "{" for example. But this process is quite heavy and can be a source of error.

 

Do you guys know a simple way to generate an XSL file, that validates a JSON Schema in output? How are you processing this kind of transformation?

 

Thank you for your feedback!

Outcomes