MCPcopy
hub / github.com/fastify/fastify / setupValidator

Method setupValidator

lib/schema-controller.js:140–146  ·  view source on GitHub ↗

* This method will be called when a validator must be setup. * Do not setup the compiler more than once * @param {object} serverOptions the fastify server options

(serverOptions)

Source from the content-addressed store, hash-verified

138 * @param {object} serverOptions the fastify server options
139 */
140 setupValidator (serverOptions) {
141 const isReady = this.validatorCompiler !== undefined && !this.addedSchemas
142 if (isReady) {
143 return
144 }
145 this.validatorCompiler = this.getValidatorBuilder()(this.schemaBucket.getSchemas(), serverOptions.ajv)
146 }
147
148 /**
149 * This method will be called when a serializer must be setup.

Callers 2

request.jsFile · 0.80
addNewRouteFunction · 0.80

Calls 2

getValidatorBuilderMethod · 0.95
getSchemasMethod · 0.65

Tested by

no test coverage detected