@hyperjump/json-schema-core
Advanced tools
Comparing version 0.3.0 to 0.3.1
{ | ||
"name": "@hyperjump/json-schema-core", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "A framework for building JSON Schema tools", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -474,3 +474,3 @@ # JSON Schema Core | ||
const validate = require("jschema/lib/keywords/validate"); | ||
JsonSchema.addkeyword(`${schemaVersion}#validate`, validate); | ||
JsonSchema.addKeyword(`${schemaVersion}#validate`, validate); | ||
@@ -518,3 +518,3 @@ // Configure references | ||
// Add `cond` keyword | ||
JsonSchema.addkeyword("http://example.com/draft/custom/schema#cond", { | ||
JsonSchema.addKeyword("http://example.com/draft/custom/schema#cond", { | ||
compile: async (schema, ast) => { | ||
@@ -559,6 +559,9 @@ const subSchemas = Schema.map((subSchema) => JsonSchema.compileSchema(subSchema, ast), schema); | ||
// Choose a URI for your vocabulary and add keywords | ||
JsonSchema.addVocabulary("https://example.com/draft/custom/vocab/conditionals", { | ||
JsonSchema.defineVocabulary("https://example.com/draft/custom/vocab/conditionals", { | ||
cond: cond | ||
}); | ||
// Add your vocabulary | ||
JsonSchema.addVocabulary("http://example.com/draft/custom/schema", "http://example.com/draft/custom/vocab/conditionals"); | ||
// Try it out | ||
@@ -565,0 +568,0 @@ Schema.add({ |
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
1181384
594