sitemule / noxDB

Not only XML. SQL,JSON and XML made easy for IBM i
MIT License
41 stars 20 forks source link

Validate Json schema #26

Open RootDeepak opened 4 years ago

RootDeepak commented 4 years ago

Hi,

Do we have any noxdb procedure to validate the json schema?

NielsLiisberg commented 4 years ago

Unfortunately not yet. But this sounds like a task for you ;)

RootDeepak commented 4 years ago

I am happy to give this a try. Do you have any suggestions on how to implement this?

worksofliam commented 4 years ago

@RootDeepak you should defo give it a shot! You have to figure out what schema definition you want to support!

For example, I wrote a validator generator, where you pass in an OpenAPI spec and builds the router and validator: https://github.com/worksofbarry/openapi-ileastic

RootDeepak commented 4 years ago

Hi, Maybe there is confusion about the question. I want to know if there is a noxdb procedure that tells us if it is a valid JSON.

NielsLiisberg commented 4 years ago

If it is just syntactic, you could simply use JSON_parseString or JSON_parseFile

If any errors then use

If JSON_error(); msg = JSON_message(); Endif;

tir. 14. jul. 2020 kl. 13.22 skrev RootDeepak notifications@github.com:

Hi, Maybe there is confusion about the question. I want to know if there is a noxdb procedure that tells us if it is a valid JSON.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/sitemule/noxDB/issues/26#issuecomment-658124791, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVIPHTXBPMSGJLZMNSID33R3Q5XNANCNFSM4OUNSJTA .