-
Notifications
You must be signed in to change notification settings - Fork 10
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
Upgrade openapi packages #1193
Comments
The conflict between openapi-spec-validator and openapi-core has been resolved in the current versions, but upgrading both leads to another dependency conflict for
This should be resolved with the next aws-sam-translator release. https://github.com/aws/serverless-application-model has already relaxed the jsonschema requirement in |
I built my environment from scratch on branch
When I run
When I run the tests from branch
So, we've fixed all of the
And now we're seeing the same status code failure for a handful of subscription tests as well. |
I'll start debugging the jobs failure first:
I've confirmed that the |
Also, before I go further, I should probably just upgrade to the latest |
make install
fails after upgrading to openapi-spec-validator 0.5.0openapi-spec-validator
I've started working on fixing the errors that result from upgrading to the latest package versions: #1708 Unfortunately, it seems that the tests are now taking several minutes to run, and I have no idea why. |
I also started working on incorporating the WKT validator draft PR (#1490) into the branch for upgrading the latest versions, but there are errors remaining to fix. I'd also like to read more about Unmarshalling vs. Validation. |
On branch
The tests are running extremely slowly. Here are the three slowest tests:
They are also the three tests failing with
These failures only occur when all the tests are run together. Each test passes if run individually. At first I thought that some fixture was not being torn down successfully, but it turns out that if we pass So, now we need to determine why the tests are running so slowly. |
I wanted to rule out the possibility that the slow tests were making actual HTTP requests over the internet due to some mocking failure, so I ran all the tests with no internet connection, with the same results. |
Here are the runtimes for all the tests with runtime >= 1 second, run from the
And here's the same for the tests run from
So most tests are running much more slowly. |
I determined the cause of the slowdown. After I first upgraded the packages, tests were failing like:
It's because references like the following from
So my naive solution was to add the filepath:
Which apparently caused the massive slowdown. I profiled the unit tests and here is one relevant line:
We can see that there are If we want to fully understand the changes that have been made to path resolution, we should read the release notes at https://github.com/python-jsonschema/jsonschema/releases. For example, However, the shortest path to victory would be to move the contents of |
After combining the API specs, tests run from I'm working on fixing the WKT validator and other errors at #1714. Currently seeing the following failures on the
|
After closer inspection, Our OpenAPI spec defines the json structure we expect users to give to the API. It also defines the json structure the user can expect back from any API call. By default, Validating our responses back to the user is tricky business. It gives us a way to detect when our API is breaking its contract, which is good. It usually comes at the expense of the user experience, though, especially for REST APIs that are a passthrough for a back-end database. A single non-compliant database record would cause any user query including that record to fail. Validating responses also makes changing the structure of our database more difficult. For example, we wouldn't be able to add a new field to job records that we want to be required for new jobs going forward without also updating all existing job records to include that field. We ultimately decided not to validate responses from the HyP3 API against our OpenAPI schema. We did that by setting I've updated python-openapi/openapi-core#618 to confirm whether response validation falls under the same bug. |
I had added some missing fields to mock subscriptions to fix one of the tests, so I reverted that change now that we know why response validation is failing. On
I'm not going to bother debugging the tests further until the |
Since removing the Subscriptions feature made most of our work on this issue obsolete, I've started from scratch at #1821. |
Blocked by python-openapi/openapi-core#662 |
New release: https://github.com/python-openapi/openapi-core/releases/tag/0.18.1 may allow us to disable response validation (adds "Unmarshalling customizations" in |
An option to disable response validation has been added (python-openapi/openapi-core#662 was closed, see the PR linked from that issue) so we can move forward on this issue whenever |
The latest version of |
On the
I'm not sure why the error |
It appears that we may not need to move the contents of |
Inspecting the second
This should be fixed when we implement the new method for disabling response validation. I don't know whether this will also fix the failing |
After merging #1821 (which passes all tests), I'm now seeing responses like the one below for all https://hyp3-test-api.asf.alaska.edu (EDC UAT) endpoints (also via the hyp3-sdk). The body and headers below were copied from the Swagger UI. Body:
Headers:
However, https://hyp3-enterprise-test.asf.alaska.edu still works fine, which indicates the problem is specific to EDC. The url I queried the I also observed exactly 15 So, the responses are originating from ApiGateway. |
I also started digging into the We define a custom error handler here which inherits from The Finally, That's as far as I got tracing the Edit: I asked the |
It turns out server url is part of the OpenAPI spec. Fix and explanation here: #2009 |
Jira: https://asfdaac.atlassian.net/browse/TOOL-2046
After upgrading to openapi-spec-validator to v0.5.0,
make install
fails with:requirements-api.txt
requiresopenapi-core 0.14.5
, which depends on openapi-spec-validator<0.5.0. See python-openapi/openapi-core#402 for more details.We separately specify openapi-spec-validator as a requirement in
requirements-all.txt
, since we use it for static analysis independent of deploying the API. We can't upgrade the version specified there past 0.4.0 because of this conflict.The text was updated successfully, but these errors were encountered: