Agent returns only members of collection on GET request
Closed this issue · 1 comments
priyanshunayan commented
I'm submitting a
- bug report.
- feature request.
Current Behaviour:
If we make GET request to any Collection endpoint, it returns only the members of collection. Developers might need other information like total items or total pages to develop their application.
Expected Behaviour:
It will return whole collection along with the information like totalItems, pages etc. It would be great to introduce interfaces like agent.getMembers("http://localhost:8080/DroneCollection") to get the the members explicitly.
Steps to reproduce:
when invoked: agent.get("http://localhost:8080/serverapi/DroneCollection")
returns:
[
{
"@id": "/serverapi/DroneCollection/7c35219c-a5f1-4873-8e06-08bebeb0d115",
"@type": "Drone"
},
{
"@id": "/serverapi/DroneCollection/329d851e-b678-430f-8d93-084957656e38",
"@type": "Drone"
},
{
"@id": "/serverapi/DroneCollection/da7f4cc8-b102-4892-9570-4449680ce941",
"@type": "Drone"
}
]
Instead it should return:
"@id": "/serverapi/DroneCollection/",
"@type": "DroneCollection",
"members": [{
"@id": "/serverapi/DroneCollection/7c35219c-a5f1-4873-8e06-08bebeb0d115",
"@type": "Drone"
},
{
"@id": "/serverapi/DroneCollection/329d851e-b678-430f-8d93-084957656e38",
"@type": "Drone"
},
{
"@id": "/serverapi/DroneCollection/da7f4cc8-b102-4892-9570-4449680ce941",
"@type": "Drone"
}
]
"totalItems": 65,
"view": {
"@id": "/serverapi/DroneCollection?page=1",
"@type": "PartialCollectionView",
"first": "/serverapi/DroneCollection?page=1",
"last": "/serverapi/DroneCollection?page=7",
"next": "/serverapi/DroneCollection?page=2"
}
Do you want to work on this issue?
priyanshunayan commented
Fixed by #149