Skip to content

Commit 3be602b

Browse files
committed
Mention relative $schema as a common pitfall
Signed-off-by: Juan Cruz Viotti <[email protected]>
1 parent fcdf763 commit 3be602b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

content/2020-12/core/schema.markdown

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ Bundling](https://github.com/sourcemeta/jsonschema/blob/main/docs/bundle.markdow
5050
to inline externally referenced schemas that might be based on different
5151
dialects of JSON Schema.
5252

53+
{{<common-pitfall>}}JSON Schema prohibits referencing meta-schemas using
54+
relative URIs. The fundamental reason for this is that resolving the
55+
meta-schema is necessary for correctly determining the base URI of the schema,
56+
from which a relative meta-schema reference would be resolved, introducing a
57+
circular problem.
58+
59+
A common occurrence of this issue is setting the `$schema` keyword to a
60+
relative path, which is again invalid according to the
61+
specification.{{</common-pitfall>}}
62+
5363
{{<common-pitfall>}}JSON Schema prohibits the use of the this keyword on
5464
arbitrary subschemas that do not represent schema resources. It can only be
5565
present at the root of the schema (an implicit schema resource) or as a sibling

0 commit comments

Comments
 (0)