Easy way to convert Json to Pojo/Model class of Java
Is It hard for you to create Pojo/Model/Bean classes according to Json result specially when you are using third party libraries like GSON/Jackson?
There is very easy and fast way to create Pojo/Beans/Model classes for Json Schema. Check out the below link to convert your Json response to Java model classes.
http://www.jsonschema2pojo.org/
For Example I want to convert json data to Gson Pojo class then following are the points to do it.
1. Copy and paste Json to TestEditor displayed in link.
2. Enter my package name and class name.
3. Select Source type to Json.
4. Select annotation style to GSON.
Its done here.
Preview the Class structure and copy paste to your model class.
Happy Coding :D
There is very easy and fast way to create Pojo/Beans/Model classes for Json Schema. Check out the below link to convert your Json response to Java model classes.
http://www.jsonschema2pojo.org/
For Example I want to convert json data to Gson Pojo class then following are the points to do it.
1. Copy and paste Json to TestEditor displayed in link.
2. Enter my package name and class name.
3. Select Source type to Json.
4. Select annotation style to GSON.
Its done here.
Preview the Class structure and copy paste to your model class.
Happy Coding :D
Comments
Post a Comment