-
-
Notifications
You must be signed in to change notification settings - Fork 246
Support patterned and default HTTP status codes #1303
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
base: main
Are you sure you want to change the base?
Conversation
6cf48dd
to
888d881
Compare
2f8bf10
to
3df0ba6
Compare
3df0ba6
to
05367ca
Compare
46d5210
to
d70d32c
Compare
Co-Authored-By: Jonathan Goodson <[email protected]> Co-Authored-By: Peter Kolloch <[email protected]>
d70d32c
to
201973b
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.
Pull Request Overview
This PR implements support for patterned and default HTTP status codes in OpenAPI specifications, enabling the use of status code patterns like 2XX
, 4XX
, and default
in addition to specific status codes like 200
.
- Introduces new
HTTPStatusPattern
class to handle parsing and validation of status code patterns - Refactors response handling to support both specific codes and ranges with proper precedence ordering
- Updates template generation to handle default responses and status code ranges in generated client code
Reviewed Changes
Copilot reviewed 72 out of 72 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
openapi_python_client/parser/responses.py | Adds HTTPStatusPattern class and Responses container with pattern/default separation |
openapi_python_client/parser/openapi.py | Updates Endpoint class to use new response structure and pattern parsing |
openapi_python_client/templates/endpoint_module.py.jinja | Modifies template to generate range checks and handle default responses |
tests/test_parser/test_responses.py | Updates tests to use HTTPStatusPattern instead of HTTPStatus |
end_to_end_tests/ | Adds new test endpoints and updates generated client files for pattern support |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Just gotta add tests for coverage |
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Closes #1271 and #832