Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant docs on TypeBox properties #4095

Merged
merged 2 commits into from Jun 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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