-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add api_hint
query parameter
#421
Add api_hint
query parameter
#421
Conversation
Codecov Report
@@ Coverage Diff @@
## master #421 +/- ##
==========================================
+ Coverage 91.45% 91.60% +0.14%
==========================================
Files 60 60
Lines 2751 2800 +49
==========================================
+ Hits 2516 2565 +49
Misses 235 235
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
6a999d8
to
68d382f
Compare
So I've been slightly rewriting according to some misinterpretation on my part, I think. How do you understand this? The issues I was having was that I was using a |
I've kept in both solutions for now. Currently, I've implemented the "cleaner" solution of using a |
346c0fa
to
47f6a16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two lazy-loaded imports I have an issue with, but otherwise, this looks good.
@shyamd I have moved all imports to the top-level of the middleware file now. It passed all tests locally. Let's see what happens here now with the CI. |
This parameter is handled in a Middleware. This is because it can lead to changing the original request by moving to a versioned base URL. We also need to include a new Exception, which is actually an HTTP response, similar to BadRequest, namely VersionNotSupported (553). The addition of the parameter to `query_params.py` is merely for adding it to the OpenAPI specification.
Fix HandleApiHint according to mistakes found from tests.
Also, updated a Warning name used in sort parameter. And fix attributes in collections by moving them from MongoCollection to EntryCollection.
Move `AddWarning` middleware to be the last added middleware. This is to ensure it becomes the first custom middleware invoked, in order to override the `warnings.showwarning` function.
This found a mistake in the middleware, where `None` returns from `handle_api_hint()` was not handled. This has been fixed. Also, add extra parsing of values to support `,`-separated list values.
ca76bd3
to
ee043e2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now! Cheers @CasperWA
* Add `api_hint` query parameter: This parameter is handled in a middleware. This is because it can lead to changing the original request by moving to a versioned base URL. The addition of the parameter to `query_params.py` is merely for adding it to the OpenAPI specification. * Split middleware tests into separate files. * Fix middleware inclusion sequence: Move `AddWarning` middleware to be the last added middleware. This is to ensure it becomes the first custom middleware invoked, in order to override the `warnings.showwarning` function.
Closes #392
This parameter is handled in a Middleware.
This is because it can lead to changing the original request by moving to a versioned base URL.
We also need to include a new Exception, which is actually an HTTP response, similar to BadRequest, namely VersionNotSupported (553).
The addition of the parameter to
query_params.py
is merely for adding it to the OpenAPI specification.Missing: