Skip to content
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

Throw 400s for invalid datetime formats #323

Merged
merged 2 commits into from
Jan 14, 2022

Conversation

moradology
Copy link
Collaborator

@moradology moradology commented Jan 12, 2022

Related Issue(s): #258

Description:
STAC-spec verification tools have revealed that 400s aren't being thrown in case of certain non-complying datetime formats. This PR ensures that pydantic checks always occur prior to injecting arguments into database queries. Validation errors in pydantic are always 400s but errors from within e.g. postgres can result in 500s (in violation of spec)

PR Checklist:

  • Code is formatted and linted (run pre-commit run --all-files)
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable, and docs build successfully (run make docs)
  • Changes are added to the CHANGELOG.

@geospatial-jeff geospatial-jeff merged commit a7437c1 into stac-utils:master Jan 14, 2022
@moradology moradology deleted the fix/datetime-400s branch January 14, 2022 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants