From 819a486f729af8fd87a0dcd7c7da0be36c347885 Mon Sep 17 00:00:00 2001 From: Simon Plenderleith Date: Wed, 29 Jun 2022 20:16:30 +0100 Subject: [PATCH 1/2] Remove redundant docs on TypeBox properties TypeBox no longer requires the `kind` and `modifier` keywords to be added to Ajv (since v0.24.0). See: - https://github.com/sinclairzx81/typebox/blob/master/changelog.md#0240 - https://github.com/fastify/fastify-type-provider-typebox/issues/19 --- docs/Reference/Type-Providers.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/docs/Reference/Type-Providers.md b/docs/Reference/Type-Providers.md index 613d751d06..c124257b9e 100644 --- a/docs/Reference/Type-Providers.md +++ b/docs/Reference/Type-Providers.md @@ -94,13 +94,6 @@ server.get('/route', { }) ``` -TypeBox uses the properties `kind` and `modifier` internally. These properties -are not strictly valid JSON schema which will cause `AJV@7` and newer versions -to throw an invalid schema error. To remove the error it's either necessary to -omit the properties by using -[`Type.Strict()`](https://github.com/sinclairzx81/typebox#strict) or use the AJV -options for adding custom keywords. - See also the [TypeBox documentation](https://github.com/sinclairzx81/typebox#validation) on how to set up AJV to work with TypeBox. From bfc5835b88fe003c473d577ba3ea87362992e7ae Mon Sep 17 00:00:00 2001 From: Simon Plenderleith Date: Wed, 29 Jun 2022 20:27:20 +0100 Subject: [PATCH 2/2] Remove Ajv customOptions from code example --- docs/Reference/Type-Providers.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/docs/Reference/Type-Providers.md b/docs/Reference/Type-Providers.md index c124257b9e..3ec4215686 100644 --- a/docs/Reference/Type-Providers.md +++ b/docs/Reference/Type-Providers.md @@ -70,14 +70,7 @@ import { Type } from '@sinclair/typebox' import fastify from 'fastify' -const server = fastify({ - ajv: { - customOptions: { - strict: 'log', - keywords: ['kind', 'modifier'], - }, - }, -}).withTypeProvider() +const server = fastify().withTypeProvider() server.get('/route', { schema: {