Skip to content

Commit 5529143

Browse files
committed
Use patternProperties for $ref
While draft-wright-json-schema-00 forbids JSON References except where a schema is expected, no validators implement this until draft-writght-json-schema-01. wright-00 schemas are in practice processed as draft-04 schemas, meaning that "$ref" is always considered a JSON Reference. Or, at least, some validators do that. We can work around this by using a pattern that only matches "$ref". There is no problem with the $ref in the "required" keyword, as only "$ref" as a property name is recognized as a reference.
1 parent 13a4fd2 commit 5529143

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

schemas/v3.0/schema.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ definitions:
3535
type: object
3636
required:
3737
- $ref
38-
properties:
39-
$ref:
38+
patternProperties:
39+
'^\$ref$':
4040
type: string
4141
format: uri-reference
4242
Info:

0 commit comments

Comments
 (0)