diff --git a/encoding/jsonschema/testdata/txtar/pattern_with_empty_field.txtar b/encoding/jsonschema/testdata/txtar/pattern_with_empty_field.txtar new file mode 100644 index 00000000000..d310cadd17f --- /dev/null +++ b/encoding/jsonschema/testdata/txtar/pattern_with_empty_field.txtar @@ -0,0 +1,21 @@ +# This tests the case where there's a patternProperties keyword +# and no other fields. +# TODO the empty-field test should fail but currently does not. + +-- schema.json -- +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } +} +-- out/decode/extract -- +@jsonschema(schema="https://json-schema.org/draft/2020-12/schema") + +{[=~".*" & !~"^()$"]: string} +... +-- test/empty-field.json -- +{"": true}