Skip to content

Commit 93d312f

Browse files
committed
Clarify $comment usage in vocabularies.
This ensures that comments can be used in structures such as Hyper-Schema's LDOs without every specification needing to define it separately.
1 parent 865db54 commit 93d312f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

hyper-schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
"submissionSchema": {
5050
"description": "Schema describing the data to submit along with the request",
5151
"allOf": [ { "$ref": "#" } ]
52+
},
53+
"$comment": {
54+
"type": "string"
5255
}
5356
}
5457
}

jsonschema-core.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,14 @@
583583
editing this keyword. The value of this keyword MAY be used in debug or error
584584
output which is intended for developers making use of schemas.
585585

586+
Schema vocabularies SHOULD allow "$comment" within any object containing
587+
vocabulary keywords. Implementations MAY assume "$comment" is allowed
588+
unless the vocabulary specifically forbids it. Vocabularies MUST NOT
589+
specify any effect of "$comment" beyond what is described in this
590+
specification.
591+
586592
Tools that translate other media types or programming languages
587-
to and from application/schema+json MAY choose convert that media type or
593+
to and from application/schema+json MAY choose to convert that media type or
588594
programming language's native comments to or from "$comment" values.
589595
The behavior of such translation when both native comments and "$comment"
590596
properties are present is implementation-dependent.

0 commit comments

Comments
 (0)