I have a REST service for Company/Department. Company which contains departments.
I have written CRUD service for company and department but when I retrieve a company with an id, I want Company object should make a nested REST API call and show all the departments of that company in hierarchical way.
Something like this:
<company>
<companyId> 1001 </companyId>
<companyName>company name</companyName>
<departments>
<depaId>1111</depId>
<depName>dep name1</depName>
<depaId>2222</depId>
<depName>dep name2</depName>
</departments>
</company>
Please let me know if someone have some idea about REST nested calls.