Merge pull request #452 from dnephin/compose-allow-x-fields

Allow extension fields in the v3.4 version of the compose format
This commit is contained in:
Daniel Nephin 2017-08-25 12:37:47 -04:00 committed by GitHub
commit d83752cdf2
3 changed files with 12 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -64,6 +64,7 @@
} }
}, },
"patternProperties": {"^x-": {}},
"additionalProperties": false, "additionalProperties": false,
"definitions": { "definitions": {

View File

@ -36,6 +36,16 @@ func TestValidateUndefinedTopLevelOption(t *testing.T) {
assert.Contains(t, err.Error(), "Additional property helicopters is not allowed") assert.Contains(t, err.Error(), "Additional property helicopters is not allowed")
} }
func TestValidateAllowsXTopLevelFields(t *testing.T) {
config := dict{
"version": "3.4",
"x-extra-stuff": dict{},
}
err := Validate(config, "3.4")
assert.NoError(t, err)
}
func TestValidateInvalidVersion(t *testing.T) { func TestValidateInvalidVersion(t *testing.T) {
config := dict{ config := dict{
"version": "2.1", "version": "2.1",