Skip to content

Commit

Permalink
Added "propertyOrder" attributes to schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Feb 5, 2016
1 parent 028a45b commit e2bb3b2
Show file tree
Hide file tree
Showing 3 changed files with 173 additions and 79 deletions.
9 changes: 6 additions & 3 deletions netjsonconfig/backends/openwisp/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,18 @@
],
"properties": {
"name": {
"type": "string"
"type": "string",
"propertyOrder": 1,
},
"input_bandwidth": {
"title": "Input bandwidth (kbps)",
"type": "integer"
"type": "integer",
"propertyOrder": 2,
},
"output_bandwidth": {
"title": "Output bandwidth (kbps)",
"type": "integer"
"type": "integer",
"propertyOrder": 3,
}
}
}
Expand Down
109 changes: 75 additions & 34 deletions netjsonconfig/backends/openwrt/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
"timezone": {
"type": "string",
"default": "Coordinated Universal Time",
"enum": list(timezones.keys())
"enum": list(timezones.keys()),
"propertyOrder": 1,
}
}
},
Expand All @@ -90,7 +91,8 @@
"ath5k",
"ath9k",
"broadcom"
]
],
"propertyOrder": 0,
},
"protocol": {
"type": "string",
Expand All @@ -100,7 +102,8 @@
"802.11g",
"802.11n",
"802.11ac"
]
],
"propertyOrder": 1,
}
}
}
Expand All @@ -109,17 +112,21 @@
"type": "object",
"title": "ntp settings",
"additionalProperties": True,
"propertyOrder": 7,
"properties": {
"enabled": {
"type": "boolean"
"type": "boolean",
"propertyOrder": 1,
},
"enable_server": {
"type": "boolean"
"type": "boolean",
"propertyOrder": 2,
},
"server": {
"type": "array",
"uniqueItems": True,
"additionalItems": True,
"propertyOrder": 3,
"items": {
"type": "string"
}
Expand All @@ -132,6 +139,7 @@
"uniqueItems": True,
"additionalItems": True,
"title": "Switch",
"propertyOrder": 8,
"items": {
"type": "object",
"additionalProperties": True,
Expand All @@ -143,19 +151,23 @@
],
"properties": {
"name": {
"type": "string"
"type": "string",
"propertyOrder": 1,
},
"reset": {
"type": "boolean"
"type": "boolean",
"propertyOrder": 2,
},
"enable_vlan": {
"type": "boolean"
"type": "boolean",
"propertyOrder": 3,
},
"vlan": {
"type": "array",
"title": "VLANs",
"uniqueItems": True,
"additionalItems": True,
"propertyOrder": 4,
"items": {
"type": "object",
"title": "VLAN",
Expand All @@ -167,13 +179,16 @@
],
"properties": {
"device": {
"type": "string"
"type": "string",
"propertyOrder": 1,
},
"vlan": {
"type": "integer"
"type": "integer",
"propertyOrder": 2,
},
"ports": {
"type": "string"
"type": "string",
"propertyOrder": 3,
}
}
}
Expand All @@ -186,38 +201,48 @@
"title": "Ip rules",
"uniqueItems": True,
"additionalItems": True,
"propertyOrder": 9,
"items": {
"type": "object",
"title": "Ip rule",
"additionalProperties": True,
"properties": {
"in": {
"type": "string"
"type": "string",
"propertyOrder": 1,
},
"out": {
"type": "string"
"type": "string",
"propertyOrder": 2,
},
"src": {
"type": "string"
"type": "string",
"propertyOrder": 3,
},
"dest": {
"type": "string"
"type": "string",
"propertyOrder": 4,
},
"tos": {
"type": "integer"
"type": "integer",
"propertyOrder": 5,
},
"mark": {
"type": "string"
"type": "string",
"propertyOrder": 6,
},
"invert": {
"type": "boolean",
"default": False
"default": False,
"propertyOrder": 7,
},
"lookup": {
"type": "string"
"type": "string",
"propertyOrder": 8,
},
"goto": {
"type": "integer"
"type": "integer",
"propertyOrder": 9,
},
"action": {
"type": "string",
Expand All @@ -226,7 +251,8 @@
"unreachable",
"blackhole",
"throw"
]
],
"propertyOrder": 10,
}
}
}
Expand All @@ -236,6 +262,7 @@
"title": "LED config",
"uniqueItems": True,
"additionalItems": True,
"propertyOrder": 10,
"items": {
"type": "object",
"title": "LED",
Expand All @@ -247,34 +274,44 @@
],
"properties": {
"name": {
"type": "string"
"type": "string",
"propertyOrder": 1,
},
"default": {
"type": "boolean"
"type": "boolean",
"propertyOrder": 2,
},
"dev": {
"type": "string"
"type": "string",
"propertyOrder": 3,
},
"sysfs": {
"type": "string"
"type": "string",
"propertyOrder": 4,
},
"trigger": {
"type": "string"
"type": "string",
"propertyOrder": 5,
},
"delayoff": {
"type": "integer"
"type": "integer",
"propertyOrder": 6,
},
"delayon": {
"type": "integer"
"type": "integer",
"propertyOrder": 7,
},
"interval": {
"type": "integer"
"type": "integer",
"propertyOrder": 8,
},
"message": {
"type": "string"
"type": "string",
"propertyOrder": 9,
},
"mode": {
"type": "string"
"type": "string",
"propertyOrder": 10,
}
}
}
Expand All @@ -284,6 +321,7 @@
"title": "files",
"uniqueItems": True,
"additionalItems": True,
"propertyOrder": 11,
"items": {
"type": "object",
"title": "file",
Expand All @@ -294,15 +332,18 @@
],
"properties": {
"path": {
"type": "string"
"type": "string",
"propertyOrder": 1,
},
"contents": {
"type": "string",
"format": "textarea"
"format": "textarea",
"propertyOrder": 2,
},
"mode": {
"type": "string",
"maxLength": 4
"maxLength": 4,
"propertyOrder": 3,
}
}
}
Expand Down

0 comments on commit e2bb3b2

Please sign in to comment.