Skip to content

feat(parser): #1271 Support simple patterned http status codes #1300

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

obs-gh-peterkolloch
Copy link

Support status code patterns such as 2XX, ...


Describe the bug Documentation indicates that patterned HTTP status codes may be used for Response Objects. Supply a patterened HTTP status code in this manner results in the following warning: Invalid response status code 4XX (not a valid HTTP status code), response will be omitted from generated client

@obs-gh-peterkolloch
Copy link
Author

I am using the "newish" Union types that require Python 3.11. That makes the tests currently fail. I'll change that.

@dbanty
Copy link
Collaborator

dbanty commented Aug 19, 2025

Hey @obs-gh-peterkolloch thanks for tackling this! I took a stab at making a couple tweaks over in #1303. That's not done yet because I have to update some existing tests and add tests to guarantee the new behavior, but I specifically was trying to also:

  1. Make sure that we always check specific codes before patterns, as per the spec
  2. also handle "default" which has been asked for a fair bit

If you get a chance, please take a look at that and let me know what you think ☺️

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