@hyperjump/json-schema
Advanced tools
Comparing version 0.6.2 to 0.6.3
@@ -31,3 +31,3 @@ const { Core, Schema } = require("@hyperjump/json-schema-core"); | ||
const propertyNames = Core.collectEvaluatedProperties(conditional["if"], instance, ast); | ||
const branch = propertyNames ? "then": "else"; | ||
const branch = propertyNames ? "then" : "else"; | ||
@@ -38,3 +38,3 @@ if (conditional[branch]) { | ||
} else { | ||
return propertyNames; | ||
return propertyNames || []; | ||
} | ||
@@ -45,3 +45,3 @@ }; | ||
const tupleLength = Core.collectEvaluatedItems(conditional["if"], instance, ast); | ||
const branch = typeof tupleLength === "number" ? "then": "else"; | ||
const branch = typeof tupleLength === "number" ? "then" : "else"; | ||
@@ -52,3 +52,3 @@ if (conditional[branch]) { | ||
} else { | ||
return tupleLength; | ||
return tupleLength || 0; | ||
} | ||
@@ -55,0 +55,0 @@ }; |
@@ -5,3 +5,3 @@ module.exports = `{ | ||
"$vocabulary": { | ||
"https://spec.openapis.org/oas/3.1/vocab/extensions/2019-10": true | ||
"https://spec.openapis.org/oas/3.1/vocab/extensions/2019-10": true | ||
}, | ||
@@ -8,0 +8,0 @@ "$recursiveAnchor": true, |
@@ -5,7 +5,7 @@ module.exports = `{ | ||
"$vocabulary": { | ||
"https://spec.openapis.org/oas/3.1/vocab/validation/2019-10": true | ||
"https://json-schema.org/draft/2019-09/vocab/validation": true | ||
}, | ||
"$recursiveAnchor": true, | ||
"$comment": "This is an alternate meta-schema for the standard validation vocabulary. It is identical to the standard validation meta-schema except that it omits exclusiveMinimum and exclusiveMaximum, which are described by the OpenAPI extensions meta-schema.", | ||
"$comment": "This is an alternate meta-schema for the standard validation vocabulary. It is identical to the standard validation meta-schema except that it modifies minimum, maximum, exclusiveMinimum and exclusiveMaximum", | ||
@@ -19,2 +19,14 @@ "title": "Validation vocabulary meta-schema", | ||
}, | ||
"maximum": { | ||
"type": "number" | ||
}, | ||
"minimum": { | ||
"type": "number" | ||
}, | ||
"exclusiveMinimum": { | ||
"type": ["number", "boolean"] | ||
}, | ||
"exclusiveMaximum": { | ||
"type": ["number", "boolean"] | ||
}, | ||
"maxLength": { "$ref": "#/$defs/nonNegativeInteger" }, | ||
@@ -63,2 +75,26 @@ "minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" }, | ||
}, | ||
"allOf": [ | ||
{ | ||
"if": { | ||
"required": ["exclusiveMinimum"], | ||
"properties": { | ||
"exclusiveMinimum": {"type": "boolean"} | ||
} | ||
}, | ||
"then": { | ||
"required": ["minimum"] | ||
} | ||
}, | ||
{ | ||
"if": { | ||
"required": ["exclusiveMaximum"], | ||
"properties": { | ||
"exclusiveMaximum": {"type": "boolean"} | ||
} | ||
}, | ||
"then": { | ||
"required": ["maximum"] | ||
} | ||
} | ||
], | ||
"$defs": { | ||
@@ -65,0 +101,0 @@ "nonNegativeInteger": { |
{ | ||
"name": "@hyperjump/json-schema", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"description": "A JSON Schema Validator", | ||
@@ -34,9 +34,9 @@ "main": "lib/index.js", | ||
"mocha": "^5.2.0", | ||
"rollup": "^2.7.1", | ||
"rollup": "^2.7.2", | ||
"rollup-plugin-terser": "^5.3.0" | ||
}, | ||
"dependencies": { | ||
"@hyperjump/json-schema-core": "^0.8.1", | ||
"@hyperjump/json-schema-core": "^0.8.2", | ||
"fastest-stable-stringify": "^2.0.2" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
4037860
24839