Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 569050b

Browse filesBrowse files
committed
Allow extension fields in the v3.4 version of the compose format.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
1 parent 799de1d commit 569050b
Copy full SHA for 569050b

File tree

3 files changed

+12
-1
lines changed
Filter options

3 files changed

+12
-1
lines changed

‎cli/compose/schema/bindata.go

Copy file name to clipboardExpand all lines: cli/compose/schema/bindata.go
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎cli/compose/schema/data/config_schema_v3.4.json

Copy file name to clipboardExpand all lines: cli/compose/schema/data/config_schema_v3.4.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
}
6565
},
6666

67+
"patternProperties": {"^x-": {}},
6768
"additionalProperties": false,
6869

6970
"definitions": {

‎cli/compose/schema/schema_test.go

Copy file name to clipboardExpand all lines: cli/compose/schema/schema_test.go
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ func TestValidateUndefinedTopLevelOption(t *testing.T) {
3636
assert.Contains(t, err.Error(), "Additional property helicopters is not allowed")
3737
}
3838

39+
func TestValidateAllowsXTopLevelFields(t *testing.T) {
40+
config := dict{
41+
"version": "3.4",
42+
"x-extra-stuff": dict{},
43+
}
44+
45+
err := Validate(config, "3.4")
46+
assert.NoError(t, err)
47+
}
48+
3949
func TestValidateInvalidVersion(t *testing.T) {
4050
config := dict{
4151
"version": "2.1",

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.