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

Adds @odata.count parameter to collection responses #270

Merged
merged 9 commits into from
Sep 1, 2022

Conversation

irvinesunday
Copy link
Contributor

@irvinesunday irvinesunday commented Aug 31, 2022

Fixes #196

This PR:

  • Adds an @odata.count as a pagination property for collection responses. Together with @odata.nextLink these are componentized and reused.
  • Adds a new setting Settings.EnableCount which controls whether to set the @odata.count.
  • When Settings.EnablePagination and Settings.EnableCount are enabled, these properties alongside the base properties of a type are appended to an allOf schema.
  • Updates test.

When Settings.EnablePagination = true and Settings.EnableCount = true the new schema for collections would look like:

image

And the BaseCollectionPaginationCountResponse schema:

image

And the BaseCollectionCountResponse schema:

image

Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the changes, I pushed a much simpler implementation :)

@irvinesunday irvinesunday merged commit d8560cf into master Sep 1, 2022
@irvinesunday irvinesunday deleted the feature/is/odata-nextlink-count branch September 1, 2022 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for @odata.context and @odata.count
2 participants