-
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
💬 Modify route.method in swaggerTransform function
When using fastify.all for registering a route, openapi schema contains all possible methods for that route, that I want to limit to just POST. Directly modifying route.method in swaggerTransform function does exactly that, but I am wondering if that will break some things internally?
fastify.all(
"/example",
{
config: {
swaggerTransform: ({ schema, url, route }) => {
route.method = ["POST"];
return { schema, url };
},
},
},
(req, reply) => {
///
},
);Your Environment
- node version: 22.18
- fastify version: >=5.4.0
- os: Linux
- @fastify/swagger version: >=9.5.1
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed