Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I parse a JSON schema and create a default json object or generate a java class? [closed]

Tags:

java

json

I'm sure someone has done this before: A co-worker went through the trouble of making a JSON schema which can be used to validate a JSON object; however, I am lazy, and just want to generate a "default" empty JSON object from the schema. Is there an easy way to do this?

I would like to do this in Java.

Failing this, is there a way to generate a Java class (NOT at run-time) based on this schema?

Muchas gracias, amigos.

like image 578
Madmartigan Avatar asked Aug 19 '11 18:08

Madmartigan


People also ask

How do you parse a JSON object in Java?

We can convert a JSON to Java Object using the readValue() method of ObjectMapper class, this method deserializes a JSON content from given JSON content String.


1 Answers

How about "jsonschema2pojo"?

like image 74
StaxMan Avatar answered Nov 05 '22 15:11

StaxMan