MCPcopy
hub / github.com/fastify/fastify / constructor

Method constructor

lib/schema-controller.js:41–59  ·  view source on GitHub ↗
(parent, options)

Source from the content-addressed store, hash-verified

39
40class SchemaController {
41 constructor (parent, options) {
42 this.opts = options || parent?.opts
43 this.addedSchemas = false
44
45 this.compilersFactory = this.opts.compilersFactory
46
47 if (parent) {
48 this.schemaBucket = this.opts.bucket(parent.getSchemas())
49 this.validatorCompiler = parent.getValidatorCompiler()
50 this.serializerCompiler = parent.getSerializerCompiler()
51 this.isCustomValidatorCompiler = parent.isCustomValidatorCompiler
52 this.isCustomSerializerCompiler = parent.isCustomSerializerCompiler
53 this.parent = parent
54 } else {
55 this.schemaBucket = this.opts.bucket()
56 this.isCustomValidatorCompiler = this.opts.isCustomValidatorCompiler || false
57 this.isCustomSerializerCompiler = this.opts.isCustomSerializerCompiler || false
58 }
59 }
60
61 // Bucket interface
62 add (schema) {

Callers

nothing calls this directly

Calls 3

getValidatorCompilerMethod · 0.80
getSerializerCompilerMethod · 0.80
getSchemasMethod · 0.65

Tested by

no test coverage detected