Skip to content

Commit

Permalink
schema: network-config optional network key. route uses oneOf (#4482)
Browse files Browse the repository at this point in the history
network-config schema now permits optional top-level network key.

We should generally be using oneOf declarations in JSON schema.
Fix anyOf_type_route schema definition.

Update route definition to oneOf from anyOf requiring either
'network' or 'destination' key, combined with a 'gateway' key.
  • Loading branch information
blackboxsw authored and holmanb committed Nov 14, 2023
1 parent 15dc96a commit fe32c32
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions cloudinit/config/schemas/schema-network-config-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@
"anyOf_type_route": {
"type": "object",
"additionalProperties": false,
"anyOf": [
"oneOf": [
{
"required": [
"network",
Expand Down Expand Up @@ -566,13 +566,20 @@
}
}
},
"required": [
"network"
],
"properties": {
"network": {
"oneOf": [
{
"$ref": "#/$defs/network_config_version1"
},
{
"required": [
"network"
],
"properties": {
"network": {
"$ref": "#/$defs/network_config_version1"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
]
}

0 comments on commit fe32c32

Please sign in to comment.