-
Notifications
You must be signed in to change notification settings - Fork 35
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
Discussion: Custom query params #99
Conversation
events_link=api._links['events'] events_link.query_params= { filter: "modified_date gt '2016-01-01'" } events=events_link['items']
HAL wants you to be much more strict with query parameters, ie. you should only expand those that are decalred. See #84 for a discussion on this, I'd like to support both ways, but I think all it needs is to relax the existing implementation where we only expand the existing template with known parameters. |
See hannesg/uri_template#14 and #92 for a suggested implementation. |
I am going to close this because the implementation in #92 is a lot cleaner, IMO, @joshco see if it accomplishes the same thing as what you need? Note though that from the high level you probably want to stick to HAL as defined, ie. no random parameters should be appended to the request, they need to be "declared" by the API. |
Strangely, upgrading from Ruby 2.0.0 to 2.3.1 is breaking my add_query_params. Any kind folk have any idea why I'm getting this error below? Before the call in the error, I'm setting query params via:
Then calling
The error is with this code in the pull request: https://github.com/codegram/hyperclient/pull/99/files#diff-6693c41efdfa7bd40a113952ff75dd45R174
|
Is Try to write a test for this? |
That fixed it.
|
This is just for discussion, merge not requested. Re issue #97
Allow the caller to set custom query parameters when fetching a link