I recently received a couple of REST Web Service endpoints where the implementation technology was not Java. So I had to either rollout my own object and then rely on the object mapper to map the JSON to Java or come up with an approach to generate the relevant POJO file. On a little bit of looking around I found out the following two links for generating Java Code from JSON.
http://json2java.azurewebsites.net/
https://javafromjson.dashingrocket.com/
The POJO generated were decent and got the job done. I didn’t have to write the POJO myself and the code generated by these websites did the job well.
Another link recommended in the posts comments.
http://www.freecodeformat.com/json2pojo.php (Thanks Daniel)
I found out the 1st two links are no longer working. So I found out about another tool based on Visual Studio Code. Use the following extension for solving this use case.
https://marketplace.visualstudio.com/items?itemName=quicktype.quicktype
Pingback: JSON to Java Code Generator | Thoughts of Abhinav Anand | Code Generation
Did you try http://www.freecodeformat.com/json2pojo.php ?
Just tried it for simple JSONs and it worked ok. Will check it out with real life JSON sometime soon.