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

Invalid handling of wildcard status codes #819

Open
ryanslade opened this issue Jul 6, 2023 · 0 comments
Open

Invalid handling of wildcard status codes #819

ryanslade opened this issue Jul 6, 2023 · 0 comments

Comments

@ryanslade
Copy link

It's possible to define "Patterned fields" in the spec, for example 5XX:

Any HTTP status code can be used as the property name, but only one property per code, to describe the expected response for that HTTP status code. This field MUST be enclosed in quotation marks (for example, "200") for compatibility between JSON and YAML. To define a range of response codes, this field MAY contain the uppercase wildcard character X. For example, 2XX represents all response codes between [200-299]. Only the following range definitions are allowed: 1XX, 2XX, 3XX, 4XX, and 5XX. If a response is defined using an explicit code, the explicit code definition takes precedence over the range definition for that code.

When validating a response, the current code does a simple map lookup which will not match specific error codes with their wildcards. If no default clause is specified a 200 response will be returned instead.

mgirouard added a commit to mgirouard/kin-openapi that referenced this issue Aug 17, 2023
mgirouard added a commit to mgirouard/kin-openapi that referenced this issue Aug 17, 2023
mgirouard added a commit to mgirouard/kin-openapi that referenced this issue Aug 17, 2023
fenollp added a commit that referenced this issue Aug 18, 2023
Co-authored-by: Pierre Fenoll <pierrefenoll@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants