diff --git a/netjsonconfig/backends/openwrt/schema.py b/netjsonconfig/backends/openwrt/schema.py index a1105a4a5..94fcb614b 100644 --- a/netjsonconfig/backends/openwrt/schema.py +++ b/netjsonconfig/backends/openwrt/schema.py @@ -126,6 +126,61 @@ } } }, + "switch": { + "type": "array", + "title": "VLANs", + "uniqueItems": True, + "additionalItems": True, + "title": "Switch", + "items": { + "type": "object", + "additionalProperties": True, + "required": [ + "name", + "reset", + "enable_vlan", + "vlan" + ], + "properties": { + "name": { + "type": "string" + }, + "reset": { + "type": "boolean" + }, + "enable_vlan": { + "type": "boolean" + }, + "vlan": { + "type": "array", + "title": "VLANs", + "uniqueItems": True, + "additionalItems": True, + "items": { + "type": "object", + "title": "VLAN", + "additionalProperties": True, + "required": [ + "device", + "vlan", + "ports" + ], + "properties": { + "device": { + "type": "string" + }, + "vlan": { + "type": "integer" + }, + "ports": { + "type": "string" + } + } + } + } + } + } + }, "ip_rules": { "type": "array", "title": "Ip rules", @@ -224,61 +279,6 @@ } } }, - "switch": { - "type": "array", - "title": "VLANs", - "uniqueItems": True, - "additionalItems": True, - "title": "Programmable Switch", - "items": { - "type": "object", - "additionalProperties": True, - "required": [ - "name", - "reset", - "enable_vlan", - "vlan" - ], - "properties": { - "name": { - "type": "string" - }, - "reset": { - "type": "boolean" - }, - "enable_vlan": { - "type": "boolean" - }, - "vlan": { - "type": "array", - "title": "VLANs", - "uniqueItems": True, - "additionalItems": True, - "items": { - "type": "object", - "title": "VLAN", - "additionalProperties": True, - "required": [ - "device", - "vlan", - "ports" - ], - "properties": { - "device": { - "type": "string" - }, - "vlan": { - "type": "integer" - }, - "ports": { - "type": "string" - } - } - } - } - } - } - }, "files": { "type": "array", "title": "files", diff --git a/netjsonconfig/schema.py b/netjsonconfig/schema.py index 56184435f..1042f86af 100644 --- a/netjsonconfig/schema.py +++ b/netjsonconfig/schema.py @@ -263,8 +263,35 @@ } } }, + "interfaces": { + "type": "array", + "title": "Interfaces", + "uniqueItems": True, + "additionalItems": True, + "items": { + "oneOf": [ + {"$ref": "#/definitions/network_interface"}, + {"$ref": "#/definitions/wireless_interface"}, + {"$ref": "#/definitions/bridge_interface"} + ] } }, + "dns_servers": { + "title": "DNS Servers", + "type": "array", + "uniqueItems": True, + "additionalItems": True, + "items": { + "type": "string" + } + }, + "dns_search": { + "title": "DNS Search", + "type": "array", + "uniqueItems": True, + "additionalItems": True, + "items": { + "type": "string" } }, "radios": { @@ -310,19 +337,6 @@ } } }, - "interfaces": { - "type": "array", - "title": "Interfaces", - "uniqueItems": True, - "additionalItems": True, - "items": { - "oneOf": [ - {"$ref": "#/definitions/network_interface"}, - {"$ref": "#/definitions/wireless_interface"}, - {"$ref": "#/definitions/bridge_interface"} - ] - } - }, "routes": { "type": "array", "title": "Routes", @@ -349,24 +363,6 @@ } } } - }, - "dns_servers": { - "title": "DNS Servers", - "type": "array", - "uniqueItems": True, - "additionalItems": True, - "items": { - "type": "string" - } - }, - "dns_search": { - "title": "DNS Search", - "type": "array", - "uniqueItems": True, - "additionalItems": True, - "items": { - "type": "string" - } } } }