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

Allows the page_size value to be passed in the request. #87

Closed
wants to merge 1 commit into from

Conversation

elyobo
Copy link
Contributor

@elyobo elyobo commented Jul 16, 2013

It is a frequent requirement that API clients can indicate the number of results that they require, rather than the API providing a fixed number of results.

This change allows resources to specify a page_size_parameter which is used to indicate the name of a query parameter which indicates the number of results to return.

  • The default behaviour remains unchanged.
  • Allows each resource to specify the page_size_parameter, which is handled by the factory and assigned to the controller.
  • Adds a pageSizeParameter to the ResourceController, which is used to extract a query parameter from the request; if not provided, the pageSize is used instead.

It is a frequent requirement that API clients can indicate the number of
results that they require, rather than the API providing a fixed number
of results.

This change allows resources to specify a page_size_parameter which is
used to indicate the name of a query parameter which indicates the
number of results to return.

* The default behaviour remains unchanged.
* Allows each resource to specify the page_size_parameter, which is
  handled by the factory and assigned to the controller.
* Adds a pageSizeParameter to the ResourceController, which is used
  to extract a query parameter from the request; if not provided, the
  pageSize is used instead.
@elyobo
Copy link
Contributor Author

elyobo commented Jul 16, 2013

Build failures appear to be unrelated to the pull request.

@elyobo
Copy link
Contributor Author

elyobo commented Jul 23, 2013

@weierophinney is there anything that you need me to tidy up on this?

weierophinney added a commit that referenced this pull request Jul 23, 2013
Allows the page_size value to be passed in the request.
weierophinney added a commit that referenced this pull request Jul 23, 2013
- Added test showing that page size parameter can be passed, and will be
  honored.
weierophinney added a commit that referenced this pull request Jul 23, 2013
weierophinney added a commit that referenced this pull request Jul 23, 2013
@elyobo
Copy link
Contributor Author

elyobo commented Jul 23, 2013

Thanks @weierophinney, that's great. I'm happy to provide unit tests on any further reuests, just refuse to merge until I stump up ;)

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.

None yet

1 participant