-
Notifications
You must be signed in to change notification settings - Fork 67
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
API Parameter description output to wrong place #177
Comments
@kernwig thank you for that. I do see this and agree that this should be fixed. I'll try and do that whenever I can. In the mean time what I can suggest is using |
@kernwig should be fixed as part of v6.2.0. As a side comment. I've decided to provide the description in both cases. Because from an "API" point of view: request: {
query: z.object({
test: z.string().describe('Some parameter'), // You'd expect this to be on a parameter level
}),
}, but also const schema = z
.string()
.describe('Some parameter')
.openapi('SomeString'); // You'd also expect the description to be a part of the schema
//...
request: {
query: z.object({ test: schema }), // You'd expect this to be on a parameter level
}, Note: having in both places should not be a problem for swagger documentation rendering and validation tools. Let me know if there is anything else I can be helpful with. |
Confirmed problem fixed. 👍 Thank you for the quick fix, and the great library! |
The output OpenAPI spec does not place the description of a (query string) parameter in the right place, and thus is lost when rendered.
Example:
Results in OpenAPI spec:
The
description: Business code identifying the Client
belongs one element up, next to the parametername
andrequired
. See https://swagger.io/docs/specification/describing-parameters/As a result, the description is not rendered by Swagger UI.
The text was updated successfully, but these errors were encountered: