Skip to content

Commit

Permalink
Merge pull request #452 from dnephin/compose-allow-x-fields
Browse files Browse the repository at this point in the history
Allow extension fields in the v3.4 version of the compose format
  • Loading branch information
dnephin authored Aug 25, 2017
2 parents cfb228b + 2a1857e commit d83752c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cli/compose/schema/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cli/compose/schema/data/config_schema_v3.4.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
}
},

"patternProperties": {"^x-": {}},
"additionalProperties": false,

"definitions": {
Expand Down
10 changes: 10 additions & 0 deletions cli/compose/schema/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ func TestValidateUndefinedTopLevelOption(t *testing.T) {
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) {
config := dict{
"version": "2.1",
Expand Down

0 comments on commit d83752c

Please sign in to comment.