image-spec icon indicating copy to clipboard operation
image-spec copied to clipboard

Config schema: optional fields are not all nullable

Open rcowsill opened this issue 4 years ago • 1 comments

The config specification says "Any OPTIONAL field MAY also be set to null, which is equivalent to being absent":

Most fields in schema/config-schema.json are listed as optional, but only the following are explicitly nullable:

config.Entrypoint, config.Cmd, config.Volumes, config.Labels

This means that config files setting the other optionals to null (instead of omitting them) fail to validate against the schema.

It looks like defs.json#/definitions/stringPointer can be used for the optional string fields, and an optionalBoolean definition added for history.empty_layer. Optional objects/maps/arrays can use the same technique as Entrypoint etc.

Happy to make a PR if the above approach is OK.

rcowsill avatar Apr 09 '21 12:04 rcowsill

ah yeah, we went back and forth on this. There were reasons that a *string was not desirable, but it would take @wking notes to dig that up :grimacing: I think the correct would in the wording about the field being "null", should instead be something about being "empty"

vbatts avatar Apr 12 '21 19:04 vbatts