Json to Pojo in MVC


#1

I want to integrate the Asana API in a MVC, so I should convert the response JSON of a method to POJO classes.
It work for all method that I want to use, except for PostProjects and PostTasks.

For example when I post a new Project it response this JSON:

{
“data”: {
“id”: 605710900845223,
“created_at”: “2018-03-23T11:08:11.774Z”,
“modified_at”: “2018-03-23T11:08:11.774Z”,
“owner”: {
“id”: 601721453779121,
“name”: “Joaquín González”
},
“due_date”: null,
“current_status”: null,
“public”: true,
“name”: “Algo”,
“notes”: “”,
“archived”: false,
“workspace”: {
“id”: 601723151215086,
“name”: “Midna”
},
“color”: null,
“members”: [
{
“id”: 601721453779121,
“name”: “Joaquín González”
}
],
“followers”: [
{
“id”: 601721453779121,
“name”: “Joaquín González”
}
]
}
}

You can´t simplifacted it for that you only want and finally you have this:

{
“data”: {
“id”: 605710900845223,
“name”: “SomeName”
}
}

Now you should convert it to POJO classes, for this you have this page that automates this process: http://www.jsonschema2pojo.org/


It seems to be an error in this POJO classes but I don´t know where.


#2

the ProjectId is to long to be an int
change it for an long