feat(std/json-schema): validate JSON against the in-place keywords of 2020-12 #436
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/434-json-schema"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #434
Task: step 1 of #80,
std/json-schemavalidates JSON against the in-place keywords of JSON Schema 2020-12.What
JsonSchema.read(text)/JsonSchema.parse(value)read a 2020-12 schema into a value;validate(instance)answers aValidationwith oneValidationErrorper failed keyword (keyword, schema location, instance location as a JSON Pointer such as/items/2/name, message).JsonSchemaError: another$schema,$ref/$dynamicRef/unevaluatedItems/unevaluatedProperties, and a pattern RE2 does not run.std/json-schema/tests/suite-cases.trb(694 cases, notice in the header). Each case is its own test. Files about$ref,$dynamicRef,unevaluated*,format,content,vocabulary,optional/(withbignum) are left out by name; two groups that mix in a later-step keyword are listed in the test with their reason and asserted to be refused.docs/standard-library/json-schema.md, index entry, regeneratedskills/, ROADMAP Formats item notes the package as started.seed/is not touched.Test
Locally with the nightly VM:
torb test std/json-schema(718 passed),torb check std/json-schema,torb doc --check --no-run std/json-schema,torb docs index --check,torb docs skill --check,torb format --checkon the touched files,tools/check-commits.sh origin/main. Tier A gates run in forge CI.std/json-schema(step 1 of #80) #434Approved at
432241278d.json-schema.test.trbfor locations, escaping, refusals and annotations. Exclusions are listed with reasons and asserted to be refused. CI green on this head (tier A, gates, pdisc, commit messages).contains/minContains/maxContains,prefixItems/items,additionalPropertiesandoneOfmatch 2020-12. Pointer escaping applied to property names.seed/untouched. Refusals of other$schema,$ref/$dynamicRef/unevaluated*and non-RE2 patterns are by name, so a schema is never answered "valid" unchecked.skills/, ROADMAP note; pdisc green.Non-blocking:
$reflands.