-
Notifications
You must be signed in to change notification settings - Fork 5
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
chore: validate stac api response with openapi_schema_validator #333
Conversation
@stephenkilbourn I'm stumped by the error. I see the branch is up to date with main and that the action has been retried a few times (I just launched another try with debug logging enabled, though). |
OK it looks like the new
|
Should we attempt that upgrade in a separate branch and then test the updates there? |
In this PR, there are two validations against open API Schemas 1. First item returned from GET
|
@stephenkilbourn, shouldn't all our collections have the "type" properties? Was there a returned collection that didn't? |
Ok I see now that we're testing against this collection: https://github.com/NASA-IMPACT/veda-backend/blob/develop/.github/workflows/data/noaa-emergency-response.json That collection isn't valid and doesn't align the with the minimum requirement for our current stac collections in staging. Should we update to include the following properties:
In that case we would't need to modify the the V1.0.0 collection schema |
.github/workflows/tests/test_stac.py
Outdated
import httpx | ||
from openapi_schema_validator import validate | ||
|
||
with open(".github/workflows/tests/schemas/feature_schema.json", "r") as f: |
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.
Can we use the published STAC collection and features schemas instead of creating our own here?
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.
Yes, working on that for the next commit
One concern with using the seeded collection is that the hrefs are in a protected bucket that some implementations may not be able to access and the links direct to the staging catalog that we don't intend to persist. The old noaa examples are public. Can we update the metadata for those to use for our tests? |
closing to move into simplified execution within #397 |
Issue
#332
What?
Currently, we test the api endpoints to ensure the correct response code (e.g. 200). This expands the tests to use the open api validator to validate the response body against the stac open api spec. Currently, the docs are showing the response for these two endpoints as just any string, e.g.:
I've used a subset of the open api spec at https://api.stacspec.org/ to manually document a schema for now. These two schema match what is currently being returned, but I would recommend updating the published Open Api Spec and then updating these tests to use what we publish
Testing?