diff --git a/src/middlewares/openapi.metadata.ts b/src/middlewares/openapi.metadata.ts index 12813f05..6d217be3 100644 --- a/src/middlewares/openapi.metadata.ts +++ b/src/middlewares/openapi.metadata.ts @@ -71,7 +71,7 @@ export function applyOpenApiMetadata( req: OpenApiRequest, useRequestUrl: boolean, ): OpenApiRequestMetadata { - const path = useRequestUrl ? req.url : req.originalUrl.split('?')[0]; + const path = useRequestUrl ? req.url.split('?')[0] : req.originalUrl.split('?')[0]; const method = req.method; const routeEntries = Object.entries(openApiContext.expressRouteMap); for (const [expressRoute, methods] of routeEntries) {