MCPcopy
hub / github.com/ajv-validator/ajv / getValidate

Function getValidate

spec/options/options_code.spec.ts:76–95  ·  view source on GitHub ↗
(passContext)

Source from the content-addressed store, hash-verified

74 })
75
76 function getValidate(passContext) {
77 ajv = new _Ajv({passContext: passContext, inlineRefs: false})
78 ajv.addKeyword({keyword: "testValidate", validate: storeContext})
79 ajv.addKeyword({keyword: "testCompile", compile: compileTestValidate})
80
81 const schema = {
82 definitions: {
83 test1: {
84 testValidate: true,
85 testCompile: true,
86 },
87 test2: {
88 allOf: [{$ref: "#/definitions/test1"}],
89 },
90 },
91 allOf: [{$ref: "#/definitions/test1"}, {$ref: "#/definitions/test2"}],
92 }
93
94 return ajv.compile(schema)
95 }
96
97 function storeContext(this: any) {
98 contexts.push(this)

Callers 1

Calls 2

addKeywordMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…