In a client-server structure (in JAVA), I have the following Json structures separately (example): Structure of Students :
{"idAluno":1,"nomeAluno":"Teste da Silva","listaDeTurmas":[1,2]}
Structure of Classes :
{"idTurma":1,"nomeTurma":"Redes"}
{"idTurma":2,"nomeTurma":"Compiladores"}
Each structure is managed by a different Java application. Another application makes requests to each of them. After a request to the Students application, I receive the structure I referenced above as a response. In the case of a search request, I need to display the data of the class in the student's Array of classes. Example:
{
"idAluno": 1,
"nomeAluno": "Teste da Silva",
"listaDeTurmas": [
{
"idTurma": 1,
"nomeTurma": "Redes"
},
{
"idTurma": 2,
"nomeTurma": "Compiladores"
}
]
}
For each class id, I make a request in the Class application and receive the corresponding class structure. But what is the correct way to modify the Array in the student's Json and cause the class data to be displayed instead of simply its code (as shown above)? Do I need to break down the two structures and create a new Json from there or is there a simpler way to do this?