Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Routerboard API documentation states that query parameter order is significant, however the kwargs method was being used to send query parameters, and
dict
is inherently unordered, meaning that order of query parameters was not preserved.The API uses a stack-based method for applying boolean operators. The result of each query parameter is pushed onto the stack in the order they were specified, then operators can be specified which operate on the stack. Without correct order of query parameters, complex queries cannot be made.
It should be noted that the kwargs method also prevented multiple values being sent for a single query parameter, since keys in a dict are unique, meaning that the following example query found in the documentation could not be made using this library:
This pull request resolves these issues by introducing a new syntax for the
.get()
and.detailed_get()
methods of aRouterboardResource
. In addition to the previous syntax, which is still supported for backwards compatibility, a new syntax is introduced as follows:This syntax, although not as nice to look at, preserves ordering and allows for multiple values to be passed for a single query parameter by specifying it multiple times.