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

Dynamically validate error responses too #142

Open
tazlin opened this issue Feb 17, 2024 · 0 comments
Open

Dynamically validate error responses too #142

tazlin opened this issue Feb 17, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@tazlin
Copy link
Member

tazlin commented Feb 17, 2024

As of Haidra-Org/AI-Horde@5c5d3dd, there should be enough information in the swagger to dynamically valid error responses. write_all_response_examples_to_file in swagger.py already has a bool keyword argument error_responses which will write out all of the published error responses to json for pytest/CI.

Some thoughts:

  • The API is missing some possible HTTP return codes for errors (this is often because nested function calls can make it difficult to determine which exceptions might be raised and changes to shared functions make it hard to identify which endpoints to decorate with the possible new return codes).
  • As of today, all of the example errors are identical. It may or may not serve us to include examples which vary from endpoint to endpoint (or at least, vary at all).
@tazlin tazlin added the enhancement New feature or request label Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant