We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The description of a response is given in the schema definition and this description is ignored when the json is transformed by jsonSchemaTransform.
Schema definition
const healthcheckSchema: FastifySchema = { response: { 200: { description: "Healthy", properties: z.object({ status: z.boolean(), }), }, }, };
swagger config with jsonSchemaTransform
fastify.register(fastifySwagger, { openapi: { info: { title: packageJsom.name, description: packageJsom.description, version: packageJsom.version, }, servers: [ { url: "http://localhost:3000", description: "Local", }, ] } transform: jsonSchemaTransform })
Description Healthy is missing when SwaggerUI is rendering based on transformed JSON:
Healthy
Transformed JSON:
{ "openapi":"3.0.3", "info":{ "title":"some-title", "description":"some-description", "version":"1.0.0" }, "components":{ "schemas":{ } }, "paths":{ "/":{ "get":{ "responses":{ "200":{ "description":"Default Response", "content":{ "application/json":{ "schema":{ "type":"object", "properties":{ "status":{ "type":"boolean" } }, "required":[ "status" ], "additionalProperties":false } } } } } } } }, "servers":[ { "url":"http://localhost:3000", "description":"Local" } ] }
The text was updated successfully, but these errors were encountered:
you can use the .describe() function in your zod schema. for example:
const healthcheckSchema: FastifySchema = { response: { 200: z.object({ status: z.boolean() }).describe('Healthy'), }, };
Sorry, something went wrong.
No branches or pull requests
The description of a response is given in the schema definition and this description is ignored when the json is transformed by jsonSchemaTransform.
Schema definition
swagger config with jsonSchemaTransform
Description
Healthy
is missing when SwaggerUI is rendering based on transformed JSON:Transformed JSON:
The text was updated successfully, but these errors were encountered: