Cumulocity platform version:
1018.435.0
Detailed explanation of the problem:
I’ve been working with an API endpoint for fetching inventory managed objects, and I encountered an inconsistency in the API response that I’m hoping to get some insight into. The endpoint I’m using is structured as follows:
/inventory/managedObjects?withTotalPages=true&withTotalElements=true&onlyRoots=true
When I include the parameter onlyRoots=true
in my request, the response’s statistics
object looks like this:
"statistics": {
"totalPages": 1,
"pageSize": 1000,
"currentPage": 1
}
However, if I remove the onlyRoots=true
parameter or set it to false, I receive a more detailed statistics
object, including the totalElements
field:
"statistics": {
"totalPages": 1,
"pageSize": 1000,
"currentPage": 1,
"totalElements": 216
}
I was expecting the totalElements
field to be present regardless of the onlyRoots
parameter, as it provides crucial information about the total number of items available.
Does anyone know if this is intended behavior or not?
Thank you in advance for your help!