Skip to content

Commit

Permalink
schema/defs-image: Remove 'null' from valid annotations
Browse files Browse the repository at this point in the history
The 'null' option has been in the JSON Schema since 78c7ff7
(manifest: add annotations, 2016-04-27, #44), although I expect it was
accidental.  The spec has clearly not allowed:

  "annotations": null

since 873b9b6 (Add some text about extensions, 2016-06-26, #164)
landed with the following (still current) requirements:

  Annotations MUST be a key-value map where both the key and value
  MUST be strings.

and:

  If there are no annotations then this property MUST either be absent
  or be an empty map.

Folks without annotations should not set the property at all, or they
should set it to:

  "annotations": {}

Signed-off-by: W. Trevor King <wking@tremily.us>
  • Loading branch information
wking committed Jan 28, 2017
1 parent 00850ec commit acd8a30
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions schema/defs-image.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,7 @@
},
"annotations": {
"id": "https://opencontainers.org/schema/image/annotations",
"oneOf": [
{
"$ref": "defs.json#/definitions/mapStringString"
},
{
"type": "null"
}
]
"$ref": "defs.json#/definitions/mapStringString"
}
}
}

0 comments on commit acd8a30

Please sign in to comment.