@@ -311,7 +311,7 @@ type Schema struct {
311311 // unless the vocabulary specifically forbids it. Vocabularies MUST
312312 // NOT specify any effect of "$comment" beyond what is described in
313313 // this specification.
314- Comment string `json:"comment,omitempty"`
314+ Comment string `json:"$ comment,omitempty"`
315315 // Ref is used to reference a schema, and provides the ability to
316316 // validate recursive structures through self-reference. An object
317317 // schema with a "$ref" property MUST be interpreted as a "$ref"
@@ -393,7 +393,7 @@ func (s Schema) JSONProp(name string) interface{} {
393393 return s .ReadOnly
394394 case "writeOnly" :
395395 return s .WriteOnly
396- case "comment" :
396+ case "$ comment" :
397397 return s .Comment
398398 case "$ref" :
399399 return s .Ref
@@ -444,7 +444,7 @@ type _schema struct {
444444 Examples []interface {} `json:"examples,omitempty"`
445445 ReadOnly * bool `json:"readOnly,omitempty"`
446446 WriteOnly * bool `json:"writeOnly,omitempty"`
447- Comment string `json:"comment,omitempty"`
447+ Comment string `json:"$ comment,omitempty"`
448448 Ref string `json:"$ref,omitempty"`
449449 Definitions map [string ]* Schema `json:"definitions,omitempty"`
450450 Format string `json:"format,omitempty"`
@@ -508,7 +508,7 @@ func (s *Schema) UnmarshalJSON(data []byte) error {
508508 } else {
509509 switch prop {
510510 // skip any already-parsed props
511- case "$schema" , "$id" , "title" , "description" , "default" , "examples" , "readOnly" , "writeOnly" , "comment" , "$ref" , "definitions" , "format" :
511+ case "$schema" , "$id" , "title" , "description" , "default" , "examples" , "readOnly" , "writeOnly" , "$ comment" , "$ref" , "definitions" , "format" :
512512 continue
513513 default :
514514 // assume non-specified props are "extra definitions"
@@ -587,7 +587,7 @@ func (s Schema) MarshalJSON() ([]byte, error) {
587587 obj ["writeOnly" ] = s .WriteOnly
588588 }
589589 if s .Comment != "" {
590- obj ["comment" ] = s .Comment
590+ obj ["$ comment" ] = s .Comment
591591 }
592592 if s .Ref != "" {
593593 obj ["$ref" ] = s .Ref
0 commit comments