Skip to content

Commit 8bebd9c

Browse files
committed
schema: remove unrecognized keywords
I noticed in passing that some of the entries inside the JSON Schema did not do anything: - under 2019-09 `id` does not mean anything (as of draft-06, it's [spelled `$id`](https://json-schema.org/draft-06/json-schema-release-notes)), and there's no need to define explicit IDs for internal references. - there is no recongized "expose" format - the `constraints` definition is never referenced and has no constraints (`service` is not a valid keyword). I've chosen a top level `$id` URI that works, but this is arbitrary and could be replaced by something less github-specific: although not a requirement, it's nice if this is a working URL. I've also added a newline at the end of the file because that's reasonably standard. This new schema should be functionally identical to the original. Signed-off-by: Roger Peppe <[email protected]> Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 77ab539 commit 8bebd9c

File tree

1 file changed

+3
-36
lines changed

1 file changed

+3
-36
lines changed

schema/compose-spec.json

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"$schema": "https://json-schema.org/draft/2019-09/schema#",
3-
"id": "compose_spec.json",
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "compose_spec.json",
44
"type": "object",
55
"title": "Compose Specification",
66
"description": "The Compose file is a YAML file defining a multi-containers based application.",
@@ -25,7 +25,6 @@
2525
},
2626

2727
"services": {
28-
"id": "#/properties/services",
2928
"type": "object",
3029
"patternProperties": {
3130
"^[a-zA-Z0-9._-]+$": {
@@ -36,7 +35,6 @@
3635
},
3736

3837
"networks": {
39-
"id": "#/properties/networks",
4038
"type": "object",
4139
"patternProperties": {
4240
"^[a-zA-Z0-9._-]+$": {
@@ -46,7 +44,6 @@
4644
},
4745

4846
"volumes": {
49-
"id": "#/properties/volumes",
5047
"type": "object",
5148
"patternProperties": {
5249
"^[a-zA-Z0-9._-]+$": {
@@ -57,7 +54,6 @@
5754
},
5855

5956
"secrets": {
60-
"id": "#/properties/secrets",
6157
"type": "object",
6258
"patternProperties": {
6359
"^[a-zA-Z0-9._-]+$": {
@@ -68,7 +64,6 @@
6864
},
6965

7066
"configs": {
71-
"id": "#/properties/configs",
7267
"type": "object",
7368
"patternProperties": {
7469
"^[a-zA-Z0-9._-]+$": {
@@ -85,7 +80,6 @@
8580
"definitions": {
8681

8782
"service": {
88-
"id": "#/definitions/service",
8983
"type": "object",
9084

9185
"properties": {
@@ -246,8 +240,7 @@
246240
"expose": {
247241
"type": "array",
248242
"items": {
249-
"type": ["string", "number"],
250-
"format": "expose"
243+
"type": ["string", "number"]
251244
},
252245
"uniqueItems": true
253246
},
@@ -469,7 +462,6 @@
469462
},
470463

471464
"healthcheck": {
472-
"id": "#/definitions/healthcheck",
473465
"type": "object",
474466
"properties": {
475467
"disable": {"type": ["boolean", "string"]},
@@ -489,7 +481,6 @@
489481
"patternProperties": {"^x-": {}}
490482
},
491483
"development": {
492-
"id": "#/definitions/development",
493484
"type": ["object", "null"],
494485
"properties": {
495486
"watch": {
@@ -513,7 +504,6 @@
513504
"patternProperties": {"^x-": {}}
514505
},
515506
"deployment": {
516-
"id": "#/definitions/deployment",
517507
"type": ["object", "null"],
518508
"properties": {
519509
"mode": {"type": "string"},
@@ -615,7 +605,6 @@
615605
},
616606

617607
"generic_resources": {
618-
"id": "#/definitions/generic_resources",
619608
"type": "array",
620609
"items": {
621610
"type": "object",
@@ -636,7 +625,6 @@
636625
},
637626

638627
"devices": {
639-
"id": "#/definitions/devices",
640628
"type": "array",
641629
"items": {
642630
"type": "object",
@@ -656,7 +644,6 @@
656644
},
657645

658646
"gpus": {
659-
"id": "#/definitions/gpus",
660647
"oneOf": [
661648
{"type": "string", "enum": ["all"]},
662649
{"type": "array",
@@ -677,7 +664,6 @@
677664
},
678665

679666
"include": {
680-
"id": "#/definitions/include",
681667
"oneOf": [
682668
{"type": "string"},
683669
{
@@ -693,7 +679,6 @@
693679
},
694680

695681
"network": {
696-
"id": "#/definitions/network",
697682
"type": ["object", "null"],
698683
"properties": {
699684
"name": {"type": "string"},
@@ -757,7 +742,6 @@
757742
},
758743

759744
"volume": {
760-
"id": "#/definitions/volume",
761745
"type": ["object", "null"],
762746
"properties": {
763747
"name": {"type": "string"},
@@ -786,7 +770,6 @@
786770
},
787771

788772
"secret": {
789-
"id": "#/definitions/secret",
790773
"type": "object",
791774
"properties": {
792775
"name": {"type": "string"},
@@ -813,7 +796,6 @@
813796
},
814797

815798
"config": {
816-
"id": "#/definitions/config",
817799
"type": "object",
818800
"properties": {
819801
"name": {"type": "string"},
@@ -845,7 +827,6 @@
845827
},
846828

847829
"service_hook": {
848-
"id": "#/definitions/service_hook",
849830
"type": "object",
850831
"properties": {
851832
"command": {"$ref": "#/definitions/command"},
@@ -1010,20 +991,6 @@
1010991
]
1011992
}
1012993
}
1013-
},
1014-
"constraints": {
1015-
"service": {
1016-
"id": "#/definitions/constraints/service",
1017-
"anyOf": [
1018-
{"required": ["build"]},
1019-
{"required": ["image"]}
1020-
],
1021-
"properties": {
1022-
"build": {
1023-
"required": ["context"]
1024-
}
1025-
}
1026-
}
1027994
}
1028995
}
1029996
}

0 commit comments

Comments
 (0)