I'm working with external APIs, each serves me a very complex json object in response. In order to use it properly on the server, I observe the json structure and create classes according to it. Sometimes I need to generate 20-30 classes to represent the json, and I have dozens of this APIs.
For now, I do this manually for each json.
For example, given the following json:
{
firstName: "John",
lastName: "doe",
childrenNames: ["Jean", "Alex"],
address:
{
city: "Miami",
street: "Abraham Lincoln",
house: 314
}
}
I will first create a class to represent the CityModel, and then the PersonModel, which contains an object from the CityModel class.
Is there any way to automatically create these classes? Maybe IDE plugin (I'm using IntelliJ Idea) or some external tool?