mirror of
https://github.com/netravnen/devicetype-library.git
synced 2024-05-10 07:55:01 +00:00
Added component definitions to add weight as a valid definition (#1061)
Added the required validation information Updated the readme
This commit is contained in:
15
README.md
15
README.md
@ -63,6 +63,21 @@ The following fields may **optionally** be declared:
|
||||
- `comments`: A string field which allows for comments to be added to the device. (**Default: None**)
|
||||
- Type: String
|
||||
> :test_tube: **Example**: `comments: This is a comment that will appear on all NetBox devices of this type`
|
||||
- `weight`: An array with a **single** item that allow for a value and unit of measurement to be defined. (**Default: None**)
|
||||
- Type: Array
|
||||
- Value: Number - must be multiple of 0.01
|
||||
- Unit: String
|
||||
- Options:
|
||||
- kg
|
||||
- g
|
||||
- lb
|
||||
- oz
|
||||
>:test_tube: **Example**:
|
||||
>```
|
||||
>weight:
|
||||
> - value: 12.21
|
||||
> unit: lb
|
||||
>```
|
||||
|
||||
For further detail on these attributes and those listed below, please reference the
|
||||
[schema definitions](schema/) and the [Component Definitions](#component-definitions) below.
|
||||
|
@ -594,6 +594,27 @@
|
||||
}
|
||||
},
|
||||
"required": ["name"]
|
||||
},
|
||||
|
||||
"weight": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"value": {
|
||||
"type": "number",
|
||||
"minimum": 0,
|
||||
"multipleOf": 0.01
|
||||
},
|
||||
"unit": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"kg",
|
||||
"g",
|
||||
"lb",
|
||||
"oz"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["value", "unit"]
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -33,6 +33,13 @@
|
||||
"passive"
|
||||
]
|
||||
},
|
||||
"weight": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "components.json#/definitions/weight"
|
||||
},
|
||||
"maxItems": 1
|
||||
},
|
||||
"subdevice_role": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
|
@ -54,6 +54,13 @@
|
||||
},
|
||||
"comments": {
|
||||
"type": "string"
|
||||
},
|
||||
"weight": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "components.json#/definitions/weight"
|
||||
},
|
||||
"maxItems": 1
|
||||
}
|
||||
},
|
||||
"required": ["manufacturer", "model"],
|
||||
|
Reference in New Issue
Block a user