mirror of https://github.com/docker/compose.git
Merge v1 config jsonschemas into a single file.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
adb64ef8d5
commit
be554c3a74
|
@ -1,13 +1,16 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"id": "service_schema_v1.json",
|
||||
"id": "config_schema_v1.json",
|
||||
|
||||
"type": "object",
|
||||
|
||||
"allOf": [
|
||||
{"$ref": "#/definitions/service"},
|
||||
{"$ref": "#/definitions/constraints"}
|
||||
],
|
||||
"patternProperties": {
|
||||
"^[a-zA-Z0-9._-]+$": {
|
||||
"$ref": "#/definitions/service"
|
||||
}
|
||||
},
|
||||
|
||||
"additionalProperties": false,
|
||||
|
||||
"definitions": {
|
||||
"service": {
|
||||
|
@ -162,8 +165,10 @@
|
|||
{"type": "array", "items": {"type": "string"}, "uniqueItems": true}
|
||||
]
|
||||
},
|
||||
|
||||
"constraints": {
|
||||
"id": "#/definitions/constraints",
|
||||
"services": {
|
||||
"id": "#/definitions/services/constraints",
|
||||
"anyOf": [
|
||||
{
|
||||
"required": ["build"],
|
||||
|
@ -180,3 +185,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
|
||||
"type": "object",
|
||||
"id": "fields_schema_v1.json",
|
||||
|
||||
"patternProperties": {
|
||||
"^[a-zA-Z0-9._-]+$": {
|
||||
"$ref": "service_schema_v1.json#/definitions/service"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
|
@ -388,7 +388,7 @@ def process_errors(errors, path_prefix=None):
|
|||
def validate_against_config_schema(config_file):
|
||||
_validate_against_schema(
|
||||
config_file.config,
|
||||
"service_schema_v{0}.json".format(config_file.version),
|
||||
"config_schema_v{0}.json".format(config_file.version),
|
||||
format_checker=["ports", "expose", "bool-value-in-mapping"],
|
||||
filename=config_file.filename)
|
||||
|
||||
|
|
|
@ -18,13 +18,8 @@ exe = EXE(pyz,
|
|||
a.datas,
|
||||
[
|
||||
(
|
||||
'compose/config/fields_schema_v1.json',
|
||||
'compose/config/fields_schema_v1.json',
|
||||
'DATA'
|
||||
),
|
||||
(
|
||||
'compose/config/service_schema_v1.json',
|
||||
'compose/config/service_schema_v1.json',
|
||||
'compose/config/config_schema_v1.json',
|
||||
'compose/config/config_schema_v1.json',
|
||||
'DATA'
|
||||
),
|
||||
(
|
||||
|
|
Loading…
Reference in New Issue