java - How to create a JSON String from a list of objects and a JSON schema? -


i have list of objects needs converted json. have json schema corresponding objects should placed in json created. how can achieve this? cannot seem find references on internet. possible? appreciated.

if it's javascript, can using ajv , custom keywords generate object need side-effect of validation process. have define template validated , data needs embedded in template passed context validation function:

var validate = ajv.compile(schema); var context = { data: { /* ... */ } }; validate.call(context, template); console.log(template); // template inserted data 

Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -