valgebra-jsonschema 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- valgebra_jsonschema-0.0.1/.gitignore +18 -0
- valgebra_jsonschema-0.0.1/CHANGELOG.md +76 -0
- valgebra_jsonschema-0.0.1/LICENSE-APACHE +202 -0
- valgebra_jsonschema-0.0.1/LICENSE-MIT +21 -0
- valgebra_jsonschema-0.0.1/PKG-INFO +130 -0
- valgebra_jsonschema-0.0.1/README.md +102 -0
- valgebra_jsonschema-0.0.1/docs/02-compiler.md +185 -0
- valgebra_jsonschema-0.0.1/docs/03-conformance.md +117 -0
- valgebra_jsonschema-0.0.1/docs/04-results.md +133 -0
- valgebra_jsonschema-0.0.1/docs/05-mcp.md +78 -0
- valgebra_jsonschema-0.0.1/docs/06-releasing.md +159 -0
- valgebra_jsonschema-0.0.1/docs/10-writing.md +171 -0
- valgebra_jsonschema-0.0.1/docs/README.md +13 -0
- valgebra_jsonschema-0.0.1/docs/studies/containment.json +295 -0
- valgebra_jsonschema-0.0.1/docs/studies/json-schema-test-suite-draft2019-09.json +329 -0
- valgebra_jsonschema-0.0.1/docs/studies/json-schema-test-suite-draft4.json +217 -0
- valgebra_jsonschema-0.0.1/docs/studies/json-schema-test-suite-draft6.json +259 -0
- valgebra_jsonschema-0.0.1/docs/studies/json-schema-test-suite-draft7.json +266 -0
- valgebra_jsonschema-0.0.1/docs/studies/json-schema-test-suite-format.json +70 -0
- valgebra_jsonschema-0.0.1/docs/studies/json-schema-test-suite.json +357 -0
- valgebra_jsonschema-0.0.1/docs/studies/jsonschemabench.json +133 -0
- valgebra_jsonschema-0.0.1/pyproject.toml +124 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/COMMIT +1 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/LICENSE +19 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/additionalProperties.json +219 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/allOf.json +312 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/anchor.json +120 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/anyOf.json +203 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/boolean_schema.json +104 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/const.json +431 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/contains.json +176 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/content.json +131 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/default.json +82 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/defs.json +21 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/dependentRequired.json +152 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/dependentSchemas.json +171 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/dynamicRef.json +874 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/enum.json +419 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/exclusiveMaximum.json +31 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/exclusiveMinimum.json +31 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/format.json +838 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/if-then-else.json +308 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/infinite-loop-detection.json +37 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/items.json +304 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/maxContains.json +123 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/maxItems.json +50 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/maxLength.json +55 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/maxProperties.json +94 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/maximum.json +60 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/minContains.json +224 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/minItems.json +50 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/minLength.json +55 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/minProperties.json +70 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/minimum.json +75 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/multipleOf.json +102 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/not.json +301 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/oneOf.json +293 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/optional/bignum.json +110 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/optional/ecmascript-regex.json +582 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/optional/float-overflow.json +17 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/optional/non-bmp-regex.json +86 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/pattern.json +90 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/patternProperties.json +211 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/prefixItems.json +104 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/properties.json +242 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/propertyNames.json +178 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/ref.json +1085 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/refRemote.json +342 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/required.json +169 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/type.json +501 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/unevaluatedItems.json +854 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/unevaluatedProperties.json +1681 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/uniqueItems.json +419 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite/vocabulary.json +57 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/COMMIT +1 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/LICENSE +19 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/additionalItems.json +204 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/additionalProperties.json +213 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/allOf.json +312 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/anchor.json +120 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/anyOf.json +203 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/boolean_schema.json +104 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/const.json +431 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/contains.json +176 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/content.json +131 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/default.json +82 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/defs.json +21 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/dependentRequired.json +152 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/dependentSchemas.json +171 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/enum.json +419 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/exclusiveMaximum.json +31 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/exclusiveMinimum.json +31 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/format.json +743 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/if-then-else.json +309 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/infinite-loop-detection.json +37 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/items.json +295 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/maxContains.json +123 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/maxItems.json +50 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/maxLength.json +55 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/maxProperties.json +79 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/maximum.json +60 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/minContains.json +224 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/minItems.json +50 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/minLength.json +55 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/minProperties.json +70 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/minimum.json +75 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/multipleOf.json +102 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/not.json +301 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/oneOf.json +293 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/pattern.json +65 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/patternProperties.json +176 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/properties.json +242 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/propertyNames.json +178 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/recursiveRef.json +408 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/ref.json +1123 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/refRemote.json +342 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/required.json +168 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/type.json +501 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/unevaluatedItems.json +728 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/unevaluatedProperties.json +1715 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/uniqueItems.json +419 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft2019-09/vocabulary.json +57 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/COMMIT +1 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/LICENSE +19 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/additionalItems.json +167 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/additionalProperties.json +147 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/allOf.json +261 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/anyOf.json +156 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/default.json +79 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/definitions.json +26 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/dependencies.json +232 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/enum.json +362 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/format.json +218 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/infinite-loop-detection.json +36 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/items.json +227 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/maxItems.json +28 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/maxLength.json +33 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/maxProperties.json +54 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/maximum.json +99 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/minItems.json +28 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/minLength.json +33 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/minProperties.json +48 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/minimum.json +114 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/multipleOf.json +87 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/not.json +157 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/oneOf.json +230 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/pattern.json +59 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/patternProperties.json +135 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/properties.json +205 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/ref.json +592 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/refRemote.json +189 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/required.json +145 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/type.json +469 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft4/uniqueItems.json +409 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/COMMIT +1 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/LICENSE +19 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/additionalItems.json +190 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/additionalProperties.json +147 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/allOf.json +294 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/anyOf.json +189 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/boolean_schema.json +104 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/const.json +384 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/contains.json +144 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/default.json +79 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/definitions.json +26 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/dependencies.json +286 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/enum.json +341 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/exclusiveMaximum.json +30 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/exclusiveMinimum.json +30 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/format.json +326 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/infinite-loop-detection.json +36 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/items.json +282 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/maxItems.json +44 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/maxLength.json +49 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/maxProperties.json +70 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/maximum.json +54 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/minItems.json +44 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/minLength.json +49 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/minProperties.json +64 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/minimum.json +69 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/multipleOf.json +87 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/not.json +259 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/oneOf.json +274 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/pattern.json +59 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/patternProperties.json +171 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/properties.json +236 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/propertyNames.json +164 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/ref.json +929 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/refRemote.json +257 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/required.json +161 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/type.json +474 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft6/uniqueItems.json +409 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/COMMIT +1 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/LICENSE +19 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/additionalItems.json +190 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/additionalProperties.json +147 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/allOf.json +294 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/anyOf.json +189 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/boolean_schema.json +104 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/const.json +384 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/contains.json +165 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/default.json +79 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/definitions.json +26 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/dependencies.json +286 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/enum.json +341 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/exclusiveMaximum.json +30 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/exclusiveMinimum.json +30 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/format.json +614 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/if-then-else.json +296 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/infinite-loop-detection.json +36 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/items.json +282 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/maxItems.json +44 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/maxLength.json +49 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/maxProperties.json +70 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/maximum.json +54 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/minItems.json +44 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/minLength.json +49 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/minProperties.json +64 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/minimum.json +69 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/multipleOf.json +87 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/not.json +259 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/oneOf.json +274 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/pattern.json +59 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/patternProperties.json +171 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/properties.json +236 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/propertyNames.json +164 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/ref.json +1043 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/refRemote.json +257 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/required.json +161 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/type.json +474 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-draft7/uniqueItems.json +409 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-format/COMMIT +1 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-format/LICENSE +19 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-format/date-time.json +250 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-format/date.json +423 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-format/duration.json +273 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-format/email.json +368 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-format/hostname.json +386 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-format/ipv4.json +217 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-format/ipv6.json +266 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-format/time.json +303 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-format/uuid.json +156 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/COMMIT +1 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/LICENSE +19 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/baseUriChange/folderInteger.json +3 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/baseUriChangeFolder/folderInteger.json +3 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/baseUriChangeFolderInSubschema/folderInteger.json +3 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/baseUriChange/folderInteger.json +4 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/baseUriChangeFolder/folderInteger.json +4 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/baseUriChangeFolderInSubschema/folderInteger.json +4 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/dependentRequired.json +7 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/detached-ref.json +13 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/different-id-ref-string.json +5 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/extendible-dynamic-ref.json +21 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/ignore-prefixItems.json +7 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/integer.json +4 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/locationIndependentIdentifier.json +12 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/metaschema-no-validation.json +13 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/metaschema-optional-vocabulary.json +14 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/name-defs.json +16 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/nested/foo-ref-string.json +7 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/nested/string.json +4 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/nested-absolute-ref-to-string.json +9 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/ref-and-defs.json +12 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/subSchemas.json +11 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2019-09/urn-ref-string.json +5 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/baseUriChange/folderInteger.json +4 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/baseUriChangeFolder/folderInteger.json +4 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/baseUriChangeFolderInSubschema/folderInteger.json +4 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/detached-dynamicref.json +13 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/detached-ref.json +13 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/different-id-ref-string.json +5 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/extendible-dynamic-ref.json +21 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/format-assertion-false.json +13 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/format-assertion-true.json +13 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/integer.json +4 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/locationIndependentIdentifier.json +12 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/metaschema-no-validation.json +13 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/metaschema-optional-vocabulary.json +14 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/name-defs.json +16 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/nested/foo-ref-string.json +7 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/nested/string.json +4 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/nested-absolute-ref-to-string.json +9 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/prefixItems.json +7 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/ref-and-defs.json +12 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/subSchemas.json +11 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/tree.json +17 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft2020-12/urn-ref-string.json +5 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft4/locationIndependentIdentifier.json +11 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft4/name.json +15 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft4/subSchemas.json +10 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft6/detached-ref.json +13 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft6/locationIndependentIdentifier.json +11 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft6/name.json +15 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft6/ref-and-definitions.json +11 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft6/subSchemas.json +10 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft7/detached-ref.json +13 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft7/ignore-dependentRequired.json +7 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft7/locationIndependentIdentifier.json +11 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft7/name.json +15 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft7/ref-and-definitions.json +11 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/draft7/subSchemas.json +10 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/integer.json +3 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/nested/foo-ref-string.json +6 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/nested/string.json +3 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/v1/baseUriChange/folderInteger.json +4 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/v1/baseUriChangeFolder/folderInteger.json +4 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/v1/baseUriChangeFolderInSubschema/folderInteger.json +4 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/v1/detached-dynamicref.json +13 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/v1/detached-ref.json +13 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/v1/different-id-ref-string.json +5 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/v1/extendible-dynamic-ref.json +21 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/v1/integer.json +4 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/v1/locationIndependentIdentifier.json +12 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/v1/name-defs.json +16 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/v1/nested/foo-ref-string.json +7 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/v1/nested/string.json +4 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/v1/nested-absolute-ref-to-string.json +9 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/v1/ref-and-defs.json +12 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/v1/subSchemas.json +11 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/v1/tree.json +17 -0
- valgebra_jsonschema-0.0.1/tests/data/json-schema-test-suite-remotes/v1/urn-ref-string.json +5 -0
- valgebra_jsonschema-0.0.1/tests/test_boundaries.py +176 -0
- valgebra_jsonschema-0.0.1/tests/test_docs.py +97 -0
- valgebra_jsonschema-0.0.1/tests/test_formats.py +76 -0
- valgebra_jsonschema-0.0.1/tests/test_mcp.py +208 -0
- valgebra_jsonschema-0.0.1/tests/test_properties.py +90 -0
- valgebra_jsonschema-0.0.1/tests/test_schema.py +1662 -0
- valgebra_jsonschema-0.0.1/tests/test_suite.py +56 -0
- valgebra_jsonschema-0.0.1/valgebra_jsonschema/__init__.py +64 -0
- valgebra_jsonschema-0.0.1/valgebra_jsonschema/_valgebra.py +177 -0
- valgebra_jsonschema-0.0.1/valgebra_jsonschema/formats.py +130 -0
- valgebra_jsonschema-0.0.1/valgebra_jsonschema/mcp.py +72 -0
- valgebra_jsonschema-0.0.1/valgebra_jsonschema/py.typed +0 -0
- valgebra_jsonschema-0.0.1/valgebra_jsonschema/sample.py +233 -0
- valgebra_jsonschema-0.0.1/valgebra_jsonschema/schema.py +2725 -0
- valgebra_jsonschema-0.0.1/valgebra_jsonschema/study.py +158 -0
- valgebra_jsonschema-0.0.1/valgebra_jsonschema/suite.py +115 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Maintainer notes — not part of the tracked project
|
|
2
|
+
__DEV/
|
|
3
|
+
|
|
4
|
+
.venv/
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
*.egg-info
|
|
10
|
+
.pytest_cache/
|
|
11
|
+
.ruff_cache/
|
|
12
|
+
.hypothesis/
|
|
13
|
+
.vscode/
|
|
14
|
+
*.swp
|
|
15
|
+
|
|
16
|
+
# Fetched by the tools at pinned commits. A published number lives in docs/studies/*.json
|
|
17
|
+
# and is rechecked by the tool that wrote it; anything else is not a result.
|
|
18
|
+
results/
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to valgebra-jsonschema are recorded here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project follows
|
|
5
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.0.1] - 2026-11-17
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `compile_schema` reads JSON Schema drafts 2020-12, 07, 06 and 04 into valgebra's sets over
|
|
14
|
+
the values `json.loads` returns, and raises `Unsupported` naming a keyword it does not read.
|
|
15
|
+
- Draft 2019-09 reads through `upgrade`, and a document naming any other dialect raises
|
|
16
|
+
`UnsupportedDialect`, a kind of `Unsupported`, whose message says it is not supported.
|
|
17
|
+
- A `$ref` resolves against the base URI it sits under: an embedded `$id` starts a resource,
|
|
18
|
+
and a reference names a resource of the document by its URI, then a schema in it by a JSON
|
|
19
|
+
pointer or an `$anchor`. An older draft's `$id` fragment that is a plain name reads as the
|
|
20
|
+
`$anchor` it names. A URI two schema objects of one document claim, and an anchor two of one
|
|
21
|
+
resource set, name neither, and a `$ref` or `$dynamicRef` naming one is refused, as draft
|
|
22
|
+
2020-12 asks for an error (sections 8.2.2 and 9.1.2).
|
|
23
|
+
- `compile_schema(schema, documents={uri: document})` takes the documents a reference may name
|
|
24
|
+
beside the one compiled, and `Sampler` takes them too. Each is a resource at its URI, read
|
|
25
|
+
in its own dialect or, declaring none, in the compiled document's; one in a dialect not read
|
|
26
|
+
is refused only where a reference names it, and no document is fetched. The compiled
|
|
27
|
+
document names its own URI throughout a compile, as draft 2020-12 makes the root's `$id` its
|
|
28
|
+
canonical URI (section 9.1.1), so a document supplied at that URI is not read.
|
|
29
|
+
- `$dynamicRef` reads the dynamic scope across every document: where its target sets a
|
|
30
|
+
`$dynamicAnchor` of its fragment's name, it names the outermost schema object of the scope
|
|
31
|
+
that sets one (draft 2020-12, sections 7.1 and 8.2.3.2), and `$dynamicAnchor` names its
|
|
32
|
+
schema object as `$anchor` does. Draft 2019-09's `$recursiveAnchor: true` on a resource's
|
|
33
|
+
root is a dynamic anchor with no name, and its `$recursiveRef: "#"` the `$dynamicRef: "#"`
|
|
34
|
+
that reads it, as the draft 2020-12 release notes say the two pairs agree.
|
|
35
|
+
- `unevaluatedProperties` and `unevaluatedItems` are read on each case of which in-place
|
|
36
|
+
subschemas hold, as the object group or the array that leaves the keys or items nothing
|
|
37
|
+
evaluates there to the subschema.
|
|
38
|
+
- `patternProperties` up to four patterns, and a `propertyNames` of words, are clauses over keys
|
|
39
|
+
narrowed by a pattern, so a relation reads them. `propertyNames: true` names every key, and
|
|
40
|
+
`propertyNames: false` none, so it admits the empty object alone.
|
|
41
|
+
- A `pattern` opening with lookaheads, `^(?!A)(?=C)B`, and one tempering its dot,
|
|
42
|
+
`^((?!A).)*$`, are the sets they denote, meets of patterns with complements, which a
|
|
43
|
+
relation reads. Any other lookaround is outside valgebra's dialect.
|
|
44
|
+
- A property name ending in `?` is that name. valgebra's record literal reads the suffix as
|
|
45
|
+
"optional", so such a key is written with one more and, where it is required, met with its
|
|
46
|
+
presence, which a `TypedDict` names whole.
|
|
47
|
+
- `uniqueItems` is one predicate in every schema, and a fractional `multipleOf` one per step,
|
|
48
|
+
so a schema holding either is proved below itself.
|
|
49
|
+
- `oneOf` leaves out the complement of a branch valgebra proves disjoint from another, which
|
|
50
|
+
holds none of its values: each branch is spelled once per branch it may meet.
|
|
51
|
+
- A schema past valgebra's node limit with keys read by predicate reads each `oneOf` as its
|
|
52
|
+
union met with a count of the branches that hold, and each reference to a definition that
|
|
53
|
+
does not reach itself through the definition's own set: membership stays exact, and a
|
|
54
|
+
relation reading inside those parts declines. `compile_with_fallbacks` is the cascade
|
|
55
|
+
`compile_schema` and `Sampler` share.
|
|
56
|
+
- `constants(schema)` lists the values a schema spells out with `const`, `enum`, or an `anyOf`
|
|
57
|
+
or `oneOf` of them, and such a schema lies inside another exactly where each value is a
|
|
58
|
+
member of it, over a predicate as well.
|
|
59
|
+
- NaN is a value of no schema, since JSON has none (RFC 8259 §6). An infinity is a number,
|
|
60
|
+
as `json.loads` reads one past the float range.
|
|
61
|
+
- `read_tool` reads an MCP server's tool listing into its two contracts.
|
|
62
|
+
- `assert_format=True` reads `date`, `duration`, `ipv4`, `uuid`, `date-time`, `time`, `email`,
|
|
63
|
+
`hostname` and `ipv6` as assertions, and refuses any other `format`. It is off by default.
|
|
64
|
+
- The package requires valgebra 0.0.28 and below 0.0.29, since a `0.0.x` minor of valgebra
|
|
65
|
+
is a breaking release here: each is taken by a release of this package, with its suite run on
|
|
66
|
+
it.
|
|
67
|
+
- Measured on this release, each figure in [`docs/04-results.md`](docs/04-results.md): the
|
|
68
|
+
official JSON-Schema-Test-Suite passes the 1393 draft 2020-12 cases it runs and the 1256 of
|
|
69
|
+
2019-09, each skipping the five that name a custom meta-schema, and every case of drafts 07,
|
|
70
|
+
06 and 04, 929, 841 and 618. 9486 of JSONSchemaBench's 9558 schemas compile, and membership
|
|
71
|
+
differs from the `jsonschema` package's on 13 of 404720 values, each a reading the ledger
|
|
72
|
+
records. Of the containment test suite's 10890 questions, 7048 are proven, 3560 refuted,
|
|
73
|
+
246 undecided and 36 refused.
|
|
74
|
+
|
|
75
|
+
[Unreleased]: https://github.com/ppigazzini/valgebra-jsonschema/compare/v0.0.1...HEAD
|
|
76
|
+
[0.0.1]: https://github.com/ppigazzini/valgebra-jsonschema/releases/tag/v0.0.1
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pasquale Pigazzini
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: valgebra-jsonschema
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: JSON Schema read into valgebra's sets: membership as the specification states it, and inclusion decided between two schemas.
|
|
5
|
+
Project-URL: Repository, https://github.com/ppigazzini/valgebra-jsonschema
|
|
6
|
+
Project-URL: Documentation, https://github.com/ppigazzini/valgebra-jsonschema/tree/main/docs
|
|
7
|
+
Project-URL: Changelog, https://github.com/ppigazzini/valgebra-jsonschema/blob/main/CHANGELOG.md
|
|
8
|
+
Project-URL: Issues, https://github.com/ppigazzini/valgebra-jsonschema/issues
|
|
9
|
+
Author: Pasquale Pigazzini
|
|
10
|
+
License-Expression: MIT OR Apache-2.0
|
|
11
|
+
License-File: LICENSE-APACHE
|
|
12
|
+
License-File: LICENSE-MIT
|
|
13
|
+
Keywords: json-schema,mcp,subschema,valgebra,validation
|
|
14
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Requires-Dist: annotated-types>=0.8.0
|
|
25
|
+
Requires-Dist: typing-extensions>=4.16.0
|
|
26
|
+
Requires-Dist: valgebra<0.0.29,>=0.0.28
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# valgebra-jsonschema
|
|
30
|
+
|
|
31
|
+
JSON Schema read into [valgebra](https://github.com/ppigazzini/valgebra)'s sets, so a schema
|
|
32
|
+
answers two questions: whether a value belongs, as the specification states it, and whether
|
|
33
|
+
everything one schema admits another admits too.
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from valgebra_jsonschema import compile_schema
|
|
37
|
+
|
|
38
|
+
# What an MCP server lists for a tool: its arguments, as JSON Schema.
|
|
39
|
+
tool = {
|
|
40
|
+
"name": "get_weather",
|
|
41
|
+
"inputSchema": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"properties": {
|
|
44
|
+
"location": {"type": "string", "minLength": 1},
|
|
45
|
+
"days": {"type": "number", "minimum": 1, "maximum": 7},
|
|
46
|
+
"units": {"enum": ["celsius", "fahrenheit"]},
|
|
47
|
+
},
|
|
48
|
+
"required": ["location"],
|
|
49
|
+
},
|
|
50
|
+
}
|
|
51
|
+
arguments = compile_schema(tool["inputSchema"])
|
|
52
|
+
|
|
53
|
+
assert arguments.is_valid({"location": "Paris", "days": 3})
|
|
54
|
+
assert not arguments.is_valid({"days": 3})
|
|
55
|
+
assert not arguments.is_valid({"location": "Paris", "days": 8})
|
|
56
|
+
|
|
57
|
+
# `1` and `1.0` are one JSON number, and `true` is none.
|
|
58
|
+
assert compile_schema({"type": "integer"}).is_valid(1.0)
|
|
59
|
+
assert not compile_schema({"type": "integer"}).is_valid(True)
|
|
60
|
+
|
|
61
|
+
# The next release of the tool takes another unit. Every call that was valid still is,
|
|
62
|
+
# and the converse fails: that is a compatible change, decided without running either.
|
|
63
|
+
wider = compile_schema(
|
|
64
|
+
{
|
|
65
|
+
"type": "object",
|
|
66
|
+
"properties": {
|
|
67
|
+
"location": {"type": "string", "minLength": 1},
|
|
68
|
+
"days": {"type": "number", "minimum": 1, "maximum": 7},
|
|
69
|
+
"units": {"enum": ["celsius", "fahrenheit", "kelvin"]},
|
|
70
|
+
},
|
|
71
|
+
"required": ["location"],
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
assert arguments.relation_to(wider) == "subset"
|
|
75
|
+
assert wider.relation_to(arguments) == "not_subset"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`relation_to` answers `subset`, `not_subset` or `undecided`. It is `undecided` where valgebra
|
|
79
|
+
can prove neither, which is never a wrong proof, and a keyword this package does not read raises
|
|
80
|
+
`Unsupported` naming it, since skipping one would admit values the schema refuses. A schema
|
|
81
|
+
that spells its values out, with `const`, `enum`, or an `anyOf` or `oneOf` of them, is related
|
|
82
|
+
by each value: `constants(schema)` lists them, and the schema lies inside another exactly
|
|
83
|
+
where `is_valid` admits each, a keyword valgebra reads as a predicate included.
|
|
84
|
+
|
|
85
|
+
## What it reads
|
|
86
|
+
|
|
87
|
+
Drafts 2020-12, 2019-09, 07, 06 and 04, all but the first through `upgrade`, and a document
|
|
88
|
+
naming any other dialect fails saying so, as the Model Context Protocol asks
|
|
89
|
+
([`docs/05-mcp.md`](https://github.com/ppigazzini/valgebra-jsonschema/blob/main/docs/05-mcp.md)).
|
|
90
|
+
Patterns follow ECMA-262, as the specification requires, and numbers compare by value: `1` and
|
|
91
|
+
`1.0` are one number, and `true` is none. `format` is an annotation, as 2020-12 makes it, and
|
|
92
|
+
`assert_format=True` reads nine of them as assertions. A `$ref` resolves against the base URI it
|
|
93
|
+
sits under, within the document or to one passed in `documents={uri: document}`; nothing is
|
|
94
|
+
fetched.
|
|
95
|
+
[`docs/02-compiler.md`](https://github.com/ppigazzini/valgebra-jsonschema/blob/main/docs/02-compiler.md)
|
|
96
|
+
says how each keyword becomes a set, and
|
|
97
|
+
[`docs/03-conformance.md`](https://github.com/ppigazzini/valgebra-jsonschema/blob/main/docs/03-conformance.md)
|
|
98
|
+
holds the inventory and the ledger of differences.
|
|
99
|
+
|
|
100
|
+
## Measured
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
uv run python tools/suite.py --check docs/studies/json-schema-test-suite.json
|
|
104
|
+
uv run python tools/corpus.py --check docs/studies/jsonschemabench.json
|
|
105
|
+
uv run python tools/containment.py --check docs/studies/containment.json
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
- **Against the official JSON-Schema-Test-Suite**: draft 2020-12 with the four optional files on
|
|
109
|
+
regular expressions and large numbers, 1393 of the 1393 cases it runs; draft 2019-09, 1256 of
|
|
110
|
+
1256; draft-07, 929 of 929; draft-06, 841 of 841; draft-04, 618 of 618. Skipped: the five
|
|
111
|
+
cases naming a custom meta-schema as their dialect.
|
|
112
|
+
- **Real-world schemas** (JSONSchemaBench, 9558 schemas from GitHub, the JSON Schema Store,
|
|
113
|
+
Kubernetes and function-calling data): 9486 compile, none crashes; membership differs from the
|
|
114
|
+
`jsonschema` package's on 13 of 404720 values, each a reading the ledger records.
|
|
115
|
+
- **Inclusions** (the JSON Schema containment test suite, 10890 labeled questions): 7048 proven,
|
|
116
|
+
6 against a label, each a wrong label; each of the 342 refutations against a label is a wrong label, which
|
|
117
|
+
[`docs/04-results.md`](https://github.com/ppigazzini/valgebra-jsonschema/blob/main/docs/04-results.md)
|
|
118
|
+
names.
|
|
119
|
+
|
|
120
|
+
## Install
|
|
121
|
+
|
|
122
|
+
On Python 3.11 or later, from PyPI, with valgebra, a Rust extension published as wheels:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
pip install valgebra-jsonschema
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## License
|
|
129
|
+
|
|
130
|
+
MIT or Apache-2.0, at your option.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# valgebra-jsonschema
|
|
2
|
+
|
|
3
|
+
JSON Schema read into [valgebra](https://github.com/ppigazzini/valgebra)'s sets, so a schema
|
|
4
|
+
answers two questions: whether a value belongs, as the specification states it, and whether
|
|
5
|
+
everything one schema admits another admits too.
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
from valgebra_jsonschema import compile_schema
|
|
9
|
+
|
|
10
|
+
# What an MCP server lists for a tool: its arguments, as JSON Schema.
|
|
11
|
+
tool = {
|
|
12
|
+
"name": "get_weather",
|
|
13
|
+
"inputSchema": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"properties": {
|
|
16
|
+
"location": {"type": "string", "minLength": 1},
|
|
17
|
+
"days": {"type": "number", "minimum": 1, "maximum": 7},
|
|
18
|
+
"units": {"enum": ["celsius", "fahrenheit"]},
|
|
19
|
+
},
|
|
20
|
+
"required": ["location"],
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
arguments = compile_schema(tool["inputSchema"])
|
|
24
|
+
|
|
25
|
+
assert arguments.is_valid({"location": "Paris", "days": 3})
|
|
26
|
+
assert not arguments.is_valid({"days": 3})
|
|
27
|
+
assert not arguments.is_valid({"location": "Paris", "days": 8})
|
|
28
|
+
|
|
29
|
+
# `1` and `1.0` are one JSON number, and `true` is none.
|
|
30
|
+
assert compile_schema({"type": "integer"}).is_valid(1.0)
|
|
31
|
+
assert not compile_schema({"type": "integer"}).is_valid(True)
|
|
32
|
+
|
|
33
|
+
# The next release of the tool takes another unit. Every call that was valid still is,
|
|
34
|
+
# and the converse fails: that is a compatible change, decided without running either.
|
|
35
|
+
wider = compile_schema(
|
|
36
|
+
{
|
|
37
|
+
"type": "object",
|
|
38
|
+
"properties": {
|
|
39
|
+
"location": {"type": "string", "minLength": 1},
|
|
40
|
+
"days": {"type": "number", "minimum": 1, "maximum": 7},
|
|
41
|
+
"units": {"enum": ["celsius", "fahrenheit", "kelvin"]},
|
|
42
|
+
},
|
|
43
|
+
"required": ["location"],
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
assert arguments.relation_to(wider) == "subset"
|
|
47
|
+
assert wider.relation_to(arguments) == "not_subset"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`relation_to` answers `subset`, `not_subset` or `undecided`. It is `undecided` where valgebra
|
|
51
|
+
can prove neither, which is never a wrong proof, and a keyword this package does not read raises
|
|
52
|
+
`Unsupported` naming it, since skipping one would admit values the schema refuses. A schema
|
|
53
|
+
that spells its values out, with `const`, `enum`, or an `anyOf` or `oneOf` of them, is related
|
|
54
|
+
by each value: `constants(schema)` lists them, and the schema lies inside another exactly
|
|
55
|
+
where `is_valid` admits each, a keyword valgebra reads as a predicate included.
|
|
56
|
+
|
|
57
|
+
## What it reads
|
|
58
|
+
|
|
59
|
+
Drafts 2020-12, 2019-09, 07, 06 and 04, all but the first through `upgrade`, and a document
|
|
60
|
+
naming any other dialect fails saying so, as the Model Context Protocol asks
|
|
61
|
+
([`docs/05-mcp.md`](https://github.com/ppigazzini/valgebra-jsonschema/blob/main/docs/05-mcp.md)).
|
|
62
|
+
Patterns follow ECMA-262, as the specification requires, and numbers compare by value: `1` and
|
|
63
|
+
`1.0` are one number, and `true` is none. `format` is an annotation, as 2020-12 makes it, and
|
|
64
|
+
`assert_format=True` reads nine of them as assertions. A `$ref` resolves against the base URI it
|
|
65
|
+
sits under, within the document or to one passed in `documents={uri: document}`; nothing is
|
|
66
|
+
fetched.
|
|
67
|
+
[`docs/02-compiler.md`](https://github.com/ppigazzini/valgebra-jsonschema/blob/main/docs/02-compiler.md)
|
|
68
|
+
says how each keyword becomes a set, and
|
|
69
|
+
[`docs/03-conformance.md`](https://github.com/ppigazzini/valgebra-jsonschema/blob/main/docs/03-conformance.md)
|
|
70
|
+
holds the inventory and the ledger of differences.
|
|
71
|
+
|
|
72
|
+
## Measured
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
uv run python tools/suite.py --check docs/studies/json-schema-test-suite.json
|
|
76
|
+
uv run python tools/corpus.py --check docs/studies/jsonschemabench.json
|
|
77
|
+
uv run python tools/containment.py --check docs/studies/containment.json
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
- **Against the official JSON-Schema-Test-Suite**: draft 2020-12 with the four optional files on
|
|
81
|
+
regular expressions and large numbers, 1393 of the 1393 cases it runs; draft 2019-09, 1256 of
|
|
82
|
+
1256; draft-07, 929 of 929; draft-06, 841 of 841; draft-04, 618 of 618. Skipped: the five
|
|
83
|
+
cases naming a custom meta-schema as their dialect.
|
|
84
|
+
- **Real-world schemas** (JSONSchemaBench, 9558 schemas from GitHub, the JSON Schema Store,
|
|
85
|
+
Kubernetes and function-calling data): 9486 compile, none crashes; membership differs from the
|
|
86
|
+
`jsonschema` package's on 13 of 404720 values, each a reading the ledger records.
|
|
87
|
+
- **Inclusions** (the JSON Schema containment test suite, 10890 labeled questions): 7048 proven,
|
|
88
|
+
6 against a label, each a wrong label; each of the 342 refutations against a label is a wrong label, which
|
|
89
|
+
[`docs/04-results.md`](https://github.com/ppigazzini/valgebra-jsonschema/blob/main/docs/04-results.md)
|
|
90
|
+
names.
|
|
91
|
+
|
|
92
|
+
## Install
|
|
93
|
+
|
|
94
|
+
On Python 3.11 or later, from PyPI, with valgebra, a Rust extension published as wheels:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pip install valgebra-jsonschema
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## License
|
|
101
|
+
|
|
102
|
+
MIT or Apache-2.0, at your option.
|