Enforce component properties (#3391)

* Disable additional properties for components

It is not a global option, it needs to be set per-definition.
Enabling it produces a lot of validation errors.

* Update json schema

Add missing fields and value constraints. The `rf_role` enum is
currently not included in the `generated_schema.json` from upstream,
so I "faked" it for now by added it manually.

* Rework custom power source marker

While you could technically have a device that does PoE and serial
console on the same port, this is just one very specific scenario.
Rename the custom property from `poe` to `_is_power_source` to be more
general and better reflect its intention, and properly document it in
the json schema.
Remove the property from device types where it is false, and where it's
unneeded because power-ports exist.

* Fix power draw

In NetBox the PSU modules have a power draw, but not the module-bays you
can put them into; so remove it from those. Plus some minor corrections.

* Fix PoE

Basically fix the casing by renaming from the wrong kebab-case to the
correct snake_case.

* Turn invalid comments into description

Only device types can have `comments`, everything else is limited to
`description`. So turn all invalid comments into descriptions.

* Fix mgmt_only

Console port in NetBox don't have a `mgmt_only` property, because they
are by definition management-only.

* Fix position(s)

Device bays don't have a position, because the child devices are
completely separate and don't share any naming/numbering.

* Miscellaneous fixes

Everything that didn't fit into the prior larger error categories.
Validation now passes again.
This commit is contained in:
m-hau
2025-08-08 23:10:01 +02:00
committed by GitHub
parent eeadf01038
commit 9e6cf8d017
173 changed files with 752 additions and 1037 deletions

View File

@@ -300,7 +300,6 @@ front-ports:
type: lc-apc
rear_port: Rear Port 72
rear_port_position: 1
rear-ports: lc-apc
rear-ports:
- name: Rear Port 1
type: splice
@@ -340,181 +339,181 @@ rear-ports:
positions: 1
- name: Rear Port 13
type: splice
position: 1
positions: 1
- name: Rear Port 14
type: splice
position: 1
positions: 1
- name: Rear Port 15
type: splice
position: 1
positions: 1
- name: Rear Port 16
type: splice
position: 1
positions: 1
- name: Rear Port 17
type: splice
position: 1
positions: 1
- name: Rear Port 18
type: splice
position: 1
positions: 1
- name: Rear Port 19
type: splice
position: 1
positions: 1
- name: Rear Port 20
type: splice
position: 1
positions: 1
- name: Rear Port 21
type: splice
position: 1
positions: 1
- name: Rear Port 22
type: splice
position: 1
positions: 1
- name: Rear Port 23
type: splice
position: 1
positions: 1
- name: Rear Port 24
type: splice
position: 1
positions: 1
- name: Rear Port 25
type: splice
position: 1
positions: 1
- name: Rear Port 26
type: splice
position: 1
positions: 1
- name: Rear Port 27
type: splice
position: 1
positions: 1
- name: Rear Port 28
type: splice
position: 1
positions: 1
- name: Rear Port 29
type: splice
position: 1
positions: 1
- name: Rear Port 30
type: splice
position: 1
positions: 1
- name: Rear Port 31
type: splice
position: 1
positions: 1
- name: Rear Port 32
type: splice
position: 1
positions: 1
- name: Rear Port 33
type: splice
position: 1
positions: 1
- name: Rear Port 34
type: splice
position: 1
positions: 1
- name: Rear Port 35
type: splice
position: 1
positions: 1
- name: Rear Port 36
type: splice
position: 1
positions: 1
- name: Rear Port 37
type: splice
position: 1
positions: 1
- name: Rear Port 38
type: splice
position: 1
positions: 1
- name: Rear Port 39
type: splice
position: 1
positions: 1
- name: Rear Port 40
type: splice
position: 1
positions: 1
- name: Rear Port 41
type: splice
position: 1
positions: 1
- name: Rear Port 42
type: splice
position: 1
positions: 1
- name: Rear Port 43
type: splice
position: 1
positions: 1
- name: Rear Port 44
type: splice
position: 1
positions: 1
- name: Rear Port 45
type: splice
position: 1
positions: 1
- name: Rear Port 46
type: splice
position: 1
positions: 1
- name: Rear Port 47
type: splice
position: 1
positions: 1
- name: Rear Port 48
type: splice
position: 1
positions: 1
- name: Rear Port 49
type: splice
position: 1
positions: 1
- name: Rear Port 50
type: splice
position: 1
positions: 1
- name: Rear Port 51
type: splice
position: 1
positions: 1
- name: Rear Port 52
type: splice
position: 1
positions: 1
- name: Rear Port 53
type: splice
position: 1
positions: 1
- name: Rear Port 54
type: splice
position: 1
positions: 1
- name: Rear Port 55
type: splice
position: 1
positions: 1
- name: Rear Port 56
type: splice
position: 1
positions: 1
- name: Rear Port 57
type: splice
position: 1
positions: 1
- name: Rear Port 58
type: splice
position: 1
positions: 1
- name: Rear Port 59
type: splice
position: 1
positions: 1
- name: Rear Port 60
type: splice
position: 1
positions: 1
- name: Rear Port 61
type: splice
position: 1
positions: 1
- name: Rear Port 62
type: splice
position: 1
positions: 1
- name: Rear Port 63
type: splice
position: 1
positions: 1
- name: Rear Port 64
type: splice
position: 1
positions: 1
- name: Rear Port 65
type: splice
position: 1
positions: 1
- name: Rear Port 66
type: splice
position: 1
positions: 1
- name: Rear Port 67
type: splice
position: 1
positions: 1
- name: Rear Port 68
type: splice
position: 1
positions: 1
- name: Rear Port 69
type: splice
position: 1
positions: 1
- name: Rear Port 70
type: splice
position: 1
positions: 1
- name: Rear Port 71
type: splice
position: 1
positions: 1
- name: Rear Port 72
type: splice
position: 1
positions: 1