02-21-2019 4:02 PM
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
02-21-2019 7:02 PM
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?
02-25-2019 9:01 AM
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
02-25-2019 9:35 AM
Install the external JSON validation tool on the application server then, and call it from ABAP.