MCPcopy
hub / github.com/fastify/fastify / addSchema

Function addSchema

fastify.js:618–623  ·  fastify.js::addSchema
(schema)

Source from the content-addressed store, hash-verified

616
617 class="cm">// wrapper that we expose to the user for schemas handling
618 function addSchema (schema) {
619 throwIfAlreadyStarted(class="st">'Cannot call "addSchema"!')
620 this[kSchemaController].add(schema)
621 this[kChildren].forEach(child => child.addSchema(schema))
622 return this
623 }
624
625 class="cm">// If the router does not match any route, every request will land here
626 class="cm">// req and res are Node.js core objects

Callers

nothing calls this directly

Calls 3

throwIfAlreadyStartedFunction · 0.85
addMethod · 0.80
addSchemaMethod · 0.80

Tested by

no test coverage detected