Layer7 API Management

 View Only

  • 1.  Issue with JSON Array

    Posted May 05, 2025 03:27 AM

    JSON transformation assertion does not covert the XML to JSON properly when there is single instance of object in XML. Also, it converts the numbers to string automatically.

    Anyone has faced similar issue and any resolution if any?



  • 2.  RE: Issue with JSON Array

    Posted May 05, 2025 06:22 AM

    Hey Shamim,
    You might want to try using Evaluate XPath to pull the required elements and then construct the JSON manually using message context variables. This approach can help you have more control over the structure and data types, and it could resolve the issue you're experiencing. Hope this works for you!
    Thanks,
    Balaji Prasanth S




  • 3.  RE: Issue with JSON Array

    Posted May 06, 2025 10:37 AM

    If it doesn't make things too complicated, a custom assertion can also do the similar job. The main difference will be that you also pass the schema to the custom assertion, and the Java code does the conversion by considering the object definitions in the schema.



    ------------------------------
    Mesut Yalcin
    Senior Solution Architect
    MAXXYS AG - http://www.maxxys.de
    ------------------------------