-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
Support (responses) components with OpenAPI v3 #793
Comments
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests. |
I understand your response. I want to finish my migration towards Fastify to be honest (I'm now in a not working state basically). Frankly, I'm facing quite a lot of issues with OpenAPI schemas with Fastify implementation. No offense, but as mentioned in the Discord help, I might use Zod together with |
This comment has been minimized.
This comment has been minimized.
I would like to share a reproduction GitHub repository which tries to use EDIT: Even using the following (so NOT using fastify.addSchema({
$id: 'internalServerErrorResponse',
type: 'object',
description: '500 Internal Server Error',
properties: {
message: {
type: 'string',
description: 'Error message',
example: 'Some internal error message'
}
}
}) And using it like this: schema: {
description: 'Root example',
response: {
500: {
$ref: 'internalServerErrorResponse#'
}
} The Swagger shows me the wrong response message (default response message? It says "Default Response"): |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I move this issue to a separate issue: #795 |
Prerequisites
Fastify version
4.26.2
Plugin version
8.14.0
Node.js version
20.11.1
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Linux Mint 23.1
Description
OpenAPI v3 support components, like component schemas, but also component responses. When trying to reference to OpenAPI components I get:
Supporting components section within
fastify.register(fastifySwagger, { openapi: { .. here.... }})
would be very welcoming.Steps to Reproduce
See below (this is valid syntax for OpenAPI v3 spec), this is how you can reproduce the problem:
Expected Behavior
That I can use OpenAPI components (incl. responses).
The text was updated successfully, but these errors were encountered: