From 4c2bdc81de8960ca701eb8c78e35ace823557501 Mon Sep 17 00:00:00 2001 From: Liam Tait Date: Tue, 4 Jul 2023 22:41:56 +1200 Subject: [PATCH 1/2] fix typescript types for transform route --- index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index f1cbe3a7..bb3c84b0 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,4 @@ -import { FastifyPluginCallback, FastifySchema, FastifyRequest, onRequestHookHandler, preHandlerHookHandler } from 'fastify'; +import { FastifyPluginCallback, FastifySchema, RouteShorthandOptions, onRequestHookHandler, preHandlerHookHandler } from 'fastify'; import { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from 'openapi-types'; /** @@ -127,7 +127,7 @@ declare namespace fastifySwagger { transform?: ({ schema, url, route, swaggerObject, openapiObject }: { schema: S, url: string, - route: FastifyRequest, + route: RouteShorthandOptions, swaggerObject: Partial openapiObject: Partial }) => { schema: FastifySchema, url: string }; From 9a3034cea2e883d32e1d726f4323930443dd148c Mon Sep 17 00:00:00 2001 From: Liam Tait Date: Thu, 6 Jul 2023 16:14:32 +1200 Subject: [PATCH 2/2] use RouteOptions instead of the shorthand --- index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index bb3c84b0..9bbc5854 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,4 @@ -import { FastifyPluginCallback, FastifySchema, RouteShorthandOptions, onRequestHookHandler, preHandlerHookHandler } from 'fastify'; +import { FastifyPluginCallback, FastifySchema, RouteOptions, onRequestHookHandler, preHandlerHookHandler } from 'fastify'; import { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from 'openapi-types'; /** @@ -127,7 +127,7 @@ declare namespace fastifySwagger { transform?: ({ schema, url, route, swaggerObject, openapiObject }: { schema: S, url: string, - route: RouteShorthandOptions, + route: RouteOptions, swaggerObject: Partial openapiObject: Partial }) => { schema: FastifySchema, url: string };