Skip to Content

Validate JSON Data against JSON schema

Dear Experts,

I am facing the Problem to convert ABAP-data (i.e. data stored in internal tables) to JSON Format. I found several blogs/tips etc. describing serialization/de-serialization so I am confident to find a solution here.

What I am lacking is a solution to validate the generated JSON-data against the given JSON schema.

I found some classes ( [/UI5/CL_JSON_SCHEMA_CHECKER] / [/UI5/IF_JSON_SCHEMA_CHECK_OBJ] ) which seem promising, but I have no clue how to use them...:-(. In short I am looking for a validator like

https://www.jsonschemavalidator.net/ - only in ABAP.

Can anybody offer some advice here ?

Thank you all an best wishes,

Axel

Add a comment
10|10000 characters needed characters exceeded

  • It has been asked many times, only SAP PI provides a scheme validation. Simply call an external tool to validate the JSON, from the ABAP program. Are you sure you want to validate the JSON, if your program doesn't have bugs, it should generate the JSON with a valid syntax; in fact don't you just need to install a tool on your laptop during the tests to check the JSON?

  • Hi Sandra,

    thank you for your answer. Unfortunately calling an external tool is not an option. JSON data is generated in a Batch process and sent out.

    Validating the data before it is send would be great plus. Of course, you are right, that if the programm has no bugs, everything should be fine...:-).

    Best wishes,

    Axel

  • Install the external JSON validation tool on the application server then, and call it from ABAP.

Assigned Tags

Related questions

0 Answers

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.