mirror of
https://github.com/docker/compose.git
synced 2025-07-21 12:44:54 +02:00
Remove redundant oneOf definitions
For simple definitions where a field can be multiple types, we can specify the allowed types in an array. It's simpler and clearer. This is only applicable to *simple* definitions, like number, string, list, object without any other constraints. Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
This commit is contained in:
parent
dbc68ca747
commit
32cd404c8c
@ -24,12 +24,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"container_name": {"type": "string"},
|
"container_name": {"type": "string"},
|
||||||
"cpu_shares": {
|
"cpu_shares": {"type": ["number", "string"]},
|
||||||
"oneOf": [
|
|
||||||
{"type": "number"},
|
|
||||||
{"type": "string"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"cpuset": {"type": "string"},
|
"cpuset": {"type": "string"},
|
||||||
"devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
"devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
||||||
"dns": {"$ref": "#/definitions/string_or_list"},
|
"dns": {"$ref": "#/definitions/string_or_list"},
|
||||||
@ -74,18 +69,8 @@
|
|||||||
"log_opt": {"type": "object"},
|
"log_opt": {"type": "object"},
|
||||||
|
|
||||||
"mac_address": {"type": "string"},
|
"mac_address": {"type": "string"},
|
||||||
"mem_limit": {
|
"mem_limit": {"type": ["number", "string"]},
|
||||||
"oneOf": [
|
"memswap_limit": {"type": ["number", "string"]},
|
||||||
{"type": "number"},
|
|
||||||
{"type": "string"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"memswap_limit": {
|
|
||||||
"oneOf": [
|
|
||||||
{"type": "number"},
|
|
||||||
{"type": "string"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"name": {"type": "string"},
|
"name": {"type": "string"},
|
||||||
"net": {"type": "string"},
|
"net": {"type": "string"},
|
||||||
"pid": {"type": ["string", "null"]},
|
"pid": {"type": ["string", "null"]},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user