diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53bc36d..c595008 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node-version: [16, 18, 20, 22] + node-version: [20, 22] os: [ubuntu-latest, windows-latest] steps: diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 4f7dd5b..dd7f784 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -8,7 +8,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node-version: [18] + node-version: [22] os: [ubuntu-latest] steps: diff --git a/package.json b/package.json index 5af4b63..46469a9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "fastify-type-provider-zod", "version": "2.1.0", - "description": "Zod Type Provider for Fastify@4", + "description": "Zod Type Provider for Fastify@5", "main": "dist/index.js", "types": "dist/index.d.ts", "files": [ @@ -19,7 +19,7 @@ "prepublishOnly": "npm run build" }, "peerDependencies": { - "fastify": "^4.0.0", + "fastify": "^5.0.0", "zod": "^3.14.2" }, "repository": { @@ -41,15 +41,15 @@ "zod-to-json-schema": "^3.23.0" }, "devDependencies": { - "@fastify/swagger": "^8.14.0", - "@fastify/swagger-ui": "^4.0.0", + "@fastify/swagger": "^9.0.0", + "@fastify/swagger-ui": "^5.0.1", "@types/node": "^20.12.12", "@typescript-eslint/eslint-plugin": "^7.9.0", "@typescript-eslint/parser": "^7.9.0", "@vitest/coverage-v8": "^1.6.0", "eslint": "^8.57.0", "eslint-plugin-import": "^2.29.1", - "fastify": "^4.27.0", + "fastify": "^5.0.0", "fastify-plugin": "^5.0.1", "oas-validator": "^5.0.8", "openapi-types": "^12.1.3", diff --git a/src/core.ts b/src/core.ts index e68468b..f7371b1 100644 --- a/src/core.ts +++ b/src/core.ts @@ -30,7 +30,8 @@ const defaultSkipList = [ ]; export interface ZodTypeProvider extends FastifyTypeProvider { - output: this['input'] extends z.ZodTypeAny ? z.infer : unknown; + validator: this['schema'] extends z.ZodTypeAny ? z.output : unknown; + serializer: this['schema'] extends z.ZodTypeAny ? z.input : unknown; } interface Schema extends FastifySchema {