I have a Demand
class which has a list of Contract
When I get the Demand I receive both Demand and Contract in body response. This is my Json response when getting demand Object using this url
(http://localhost:8080/v1/demande/getDemande/1
):
{
"id": 1,
"codeProduct": 14,
"demandeType": "string",
"contracts": [
{
"id": 2,
"contractType": "string",
"endDate": "2022-12-31T23:00:00.000+00:00",
"startDate": "2022-12-31T23:00:00.000+00:00",
}
]
}
and this is my Json object when trying to retrieve only Contract Object using this url (http://localhost:8080/v1/demande/getContrat/2
)
{
"id": 2,
"contractType": "string",
"endDate": "2022-12-31T23:00:00.000+00:00",
"startDate": "2022-12-31T23:00:00.000+00:00",
}
My goal is that I want to send first request to get Demand
Object because I need that contract id, and after I get the id of contract I have to send another request to get the Contract
Object
Is there any example ? Thank you really appreciate your help.