diff --git a/package.json b/package.json index 6237835..2f5b01f 100644 --- a/package.json +++ b/package.json @@ -56,20 +56,21 @@ } ], "devDependencies": { - "@fastify/type-provider-typebox": "^5.0.0", + "@fastify/type-provider-typebox": "^6.1.0", "@types/node": "^25.0.3", "@types/ws": "^8.5.10", "c8": "^10.1.3", - "eslint": "^9.17.0", + "eslint": "^9.39.2", "fastify": "^5.0.0", "fastify-tsconfig": "^3.0.0", "neostandard": "^0.12.0", "split2": "^4.2.0", - "tsd": "^0.33.0" + "tsd": "^0.33.0", + "typebox": "^1.0.78" }, "dependencies": { "duplexify": "^4.1.3", - "fastify-plugin": "^5.0.0", + "fastify-plugin": "^5.1.0", "ws": "^8.16.0" }, "publishConfig": { diff --git a/tsconfig.json b/tsconfig.json index 167b2b6..d4e7133 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,3 @@ { - "extends": "fastify-tsconfig" + "extends": "fastify-tsconfig" } diff --git a/types/index.test-d.ts b/types/index.test-d.ts index eeebc55..bdbb7fb 100644 --- a/types/index.test-d.ts +++ b/types/index.test-d.ts @@ -1,5 +1,5 @@ import { TypeBoxTypeProvider } from '@fastify/type-provider-typebox' -import { Type } from '@sinclair/typebox' +import { Type } from 'typebox' import fastify, { FastifyBaseLogger, FastifyInstance, FastifyReply, FastifyRequest, FastifySchema, RawRequestDefaultExpression, RawServerDefault, RequestGenericInterface, RouteOptions } from 'fastify' import { RouteGenericInterface } from 'fastify/types/route' import type { IncomingMessage } from 'node:http' @@ -111,18 +111,22 @@ app.route<{ Params: { foo: string }, Body: { bar: string }, Querystring: { searc }) const schema = { - params: Type.Object({ - foo: Type.String() - }), - querystring: Type.Object({ - search: Type.String() - }), - body: Type.Object({ - bar: Type.String() - }), - headers: Type.Object({ - auth: Type.String() - }) + params: Type.Object( + { foo: Type.String() }, + { required: ['foo'] } + ), + querystring: Type.Object( + { search: Type.String() }, + { required: ['search'] } + ), + body: Type.Object( + { bar: Type.String() }, + { required: ['bar'] } + ), + headers: Type.Object( + { auth: Type.String() }, + { required: ['auth'] } + ) } const server = app.withTypeProvider()