I have a complex API with 10+ models and they have one-to-many relationships with each other.
organization hasMany program hasMany project hasMany etc
When I make a request GET /programs. I get a json response:
"programs": [ "projects": [ "..." ] ]
This works good for a component that requires all the data on the tree. But I have a component that only requires programs and projects, so I want my json to be:
"programs": [ "projects" ]
Is there a way to pass a depth parameter from the client to spring boot and have it limit the json to specified depth.
I have seen jenkins do this with their api. You can say /api/json?depth=2 and it will limit the json returned.