Closed
Description
Historically, up to Draft 7, the $ref
keyword overrides sibling keywords. This resulted in many schema developers being forced to wrap instances of $ref
in an applicator like allOf
. However, that is no longer necessary in 2019-09 and later.
For example, consider this schema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"allOf": [
{ "$ref": "https://example.com" }
]
}
As long as there is no $ref
sibling to allOf
, it can be extracted as follows:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "https://example.com"
}
Of course it applies if there are multiple branches in the allOf
, etc.
Metadata
Metadata
Assignees
Labels
No labels