Skip to content

Commit

Permalink
Remove redundant docs on TypeBox properties (#4095)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonplend committed Jun 30, 2022
1 parent 8fccc46 commit 555d3d9
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions docs/Reference/Type-Providers.md
Expand Up @@ -70,14 +70,7 @@ import { Type } from '@sinclair/typebox'

import fastify from 'fastify'

const server = fastify({
ajv: {
customOptions: {
strict: 'log',
keywords: ['kind', 'modifier'],
},
},
}).withTypeProvider<TypeBoxTypeProvider>()
const server = fastify().withTypeProvider<TypeBoxTypeProvider>()

server.get('/route', {
schema: {
Expand All @@ -94,13 +87,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.
Expand Down

0 comments on commit 555d3d9

Please sign in to comment.