Skip to content

Commit

Permalink
Remove Ajv configuration in TypeBox Type Provider examples
Browse files Browse the repository at this point in the history
Remove Ajv configuration from example code in the Type Providers
documentation.

As described in fastify#4095, TypeBox no
longer requires explicitly configuring Ajv to recognize the `kind` and
`modifier` keywords.
  • Loading branch information
msmolens committed Sep 2, 2022
1 parent 65899b1 commit f5bb510
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions docs/Reference/Type-Providers.md
Expand Up @@ -155,14 +155,7 @@ import Fastify from 'fastify'
import { TypeBoxTypeProvider } from '@fastify/type-provider-typebox'
import { Type } from '@sinclair/typebox'

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

server.register(plugin1) // wrong
server.register(plugin2) // correct
Expand Down Expand Up @@ -213,14 +206,7 @@ import Fastify from 'fastify'
import { TypeBoxTypeProvider } from '@fastify/type-provider-typebox'
import { registerRoutes } from './routes'

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

registerRoutes(server)

Expand Down

0 comments on commit f5bb510

Please sign in to comment.