trpc-to-openapi
Advanced tools
Comparing version
@@ -13,6 +13,10 @@ "use strict"; | ||
const openApiHttpHandler = (0, node_http_1.createOpenApiNodeHttpHandler)(opts); | ||
fastify.all(`${prefix}/*`, async (request, reply) => { | ||
const prefixRemovedFromUrl = request.url.replace(fastify.prefix, '').replace(prefix, ''); | ||
request.raw.url = prefixRemovedFromUrl; | ||
return await openApiHttpHandler(request, reply.raw); | ||
fastify.route({ | ||
method: ['GET', 'POST', 'PATCH', 'PUT', 'DELETE'], | ||
url: `${prefix}/*`, | ||
handler: async (request, reply) => { | ||
const prefixRemovedFromUrl = request.url.replace(fastify.prefix, '').replace(prefix, ''); | ||
request.raw.url = prefixRemovedFromUrl; | ||
return await openApiHttpHandler(request, reply.raw); | ||
}, | ||
}); | ||
@@ -19,0 +23,0 @@ done(); |
{ | ||
"name": "trpc-to-openapi", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"description": "tRPC OpenAPI", | ||
@@ -5,0 +5,0 @@ "author": "mcampa", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
262219
0.17%2801
0.29%