@fastify/ajv-compiler
Advanced tools
Comparing version 3.3.0 to 3.3.1
@@ -51,3 +51,2 @@ 'use strict' | ||
} else { | ||
console.log(Object.assign({}, defaultAjvOptions, options.customOptions)) | ||
this.ajv = new Ajv(Object.assign({}, defaultAjvOptions, options.customOptions)) | ||
@@ -90,4 +89,2 @@ } | ||
console.log({ schema }) | ||
return this.ajv.compile(schema) | ||
@@ -94,0 +91,0 @@ } |
{ | ||
"name": "@fastify/ajv-compiler", | ||
"version": "3.3.0", | ||
"version": "3.3.1", | ||
"description": "Build and manage the AJV instances for the fastify framework", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -277,35 +277,1 @@ 'use strict' | ||
}) | ||
t.test('global refs in main schemas', (t) => { | ||
t.plan(2) | ||
const factory = AjvCompiler() | ||
const compiler = factory({}, { | ||
customOptions: { | ||
addUsedSchema: false | ||
} | ||
}) | ||
const validatorFunc1 = compiler({ | ||
schema: { | ||
definitions: { | ||
globalIdSchema: { | ||
$id: 'globalId', | ||
type: 'integer' | ||
} | ||
}, | ||
$ref: 'globalId' | ||
} | ||
}) | ||
const validatorFunc2 = compiler({ | ||
schema: { | ||
definitions: { | ||
globalIdSchema: { | ||
$id: 'globalId', | ||
type: 'string' | ||
} | ||
}, | ||
$ref: 'globalId' | ||
} | ||
}) | ||
t.equal(validatorFunc1(3), true) | ||
t.equal(validatorFunc2(3), false) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35784
17
854