Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning total object count through X-Total-Count header when calling search REST endpoint #232

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Z14tk0
Copy link

@Z14tk0 Z14tk0 commented Nov 6, 2024

For my use case i need to have total object count information as a part of search response. For this reason i modified existing code to return total count value in X-Total-Count header.

Example:
If there are 2 records with name that starts with "0", request like this

POST http://localhost:8080/midpoint/ws/rest/users/search?options=resolveNames&returnTotalCount=true
BODY
{
    "query": {
        "filter": {
            "text": "name startsWith '0'"
        },
        "paging": {
            "orderBy": "name",
            "orderDirection": "ascending",
            "offset": "0",
            "maxSize": "1"
        }
    }
}

..should result with response containing 1 record in body with total count of filtered users in header with value 2.

Let me know if you want me to additionally change or add something.

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant