Skip to content

Commit 1ea9b25

Browse files
committed
encoding/jsonschema: add tests for empty fragments in metaschema URIs
This adds some tests which currently result in errors, but will be fixed in a subsequent CL. Signed-off-by: Roger Peppe <[email protected]> Change-Id: I57092165d364c980c8b45f9749aa83041aca02c9 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1201676 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent 7c32807 commit 1ea9b25

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// This tests that we can use an ID with an empty fragment that's
2+
// not present in the canonical URI.
3+
-- schema.json --
4+
{
5+
"$schema": "https://json-schema.org/draft/2019-09/schema#",
6+
"$id": "http://example.test",
7+
"type": "string"
8+
}
9+
-- out/decode/extract --
10+
ERROR:
11+
invalid $schema URL "https://json-schema.org/draft/2019-09/schema#": $schema URI not recognized:
12+
schema.json:2:3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// This tests that we can use an ID without the conventional empty fragment that's
2+
// present in the canonical URI.
3+
-- schema.json --
4+
{
5+
"$schema": "http://json-schema.org/draft-04/schema",
6+
"id": "http://example.test",
7+
"type": "string"
8+
}
9+
-- out/decode/extract --
10+
ERROR:
11+
invalid $schema URL "http://json-schema.org/draft-04/schema": $schema URI not recognized:
12+
schema.json:2:3

0 commit comments

Comments
 (0)