device module profile type - properties jsonschema - convert enum options to dropdown list in forms #116

Open
opened 2026-04-05 16:21:50 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @ITJamie on 3/18/2026

NetBox version

v4.5.5

Feature type

Data model extension

Proposed functionality

create a module profile with the following jsonschema

{
    "properties": {
        "form_factor": {
            "enum": [
                "onboard",
                "mezzanine",
                "pcie",
                "ocp",
                "lom",
                "unknown"
            ],
            "title": "Form factor",
            "type": "string"
        },
        "max_speed_gbps": {
            "title": "Max port speed (Gbps)",
            "type": "number"
        },
        "media": {
            "items": {
                "enum": [
                    "copper",
                    "sfp",
                    "sfp28",
                    "qsfp",
                    "qsfp28",
                    "base-t",
                    "dac",
                    "aoc",
                    "unknown"
                ],
                "type": "string"
            },
            "title": "Media",
            "type": "array"
        },
        "port_count": {
            "title": "Port count",
            "type": "integer"
        }
    },
    "required": [
        "port_count"
    ]
}

2: create a module type and assign it to that profile created above
The "media" field appears once the module type is selected.
note that the field is a text field & that it does not give any hint about allowed values (possibly another fr?)

instead of this being a text array field that is csv formatted (note that it will accept sfp,sfp28 )

if this was instead changed to be a dropdown multiselect box when its type:array + enum list it would be much more user friendly

Use case

right now the fields which use a predefined list of values, its not currently obvious as to what values are accepted until the form validation is done when saving. exposing that list via a hint OR converting it to a dropdown selection (or multiselection box) would be useful

Database changes

n/a

External dependencies

n/a

*Originally created by @ITJamie on 3/18/2026* ### NetBox version v4.5.5 ### Feature type Data model extension ### Proposed functionality create a module profile with the following jsonschema ``` { "properties": { "form_factor": { "enum": [ "onboard", "mezzanine", "pcie", "ocp", "lom", "unknown" ], "title": "Form factor", "type": "string" }, "max_speed_gbps": { "title": "Max port speed (Gbps)", "type": "number" }, "media": { "items": { "enum": [ "copper", "sfp", "sfp28", "qsfp", "qsfp28", "base-t", "dac", "aoc", "unknown" ], "type": "string" }, "title": "Media", "type": "array" }, "port_count": { "title": "Port count", "type": "integer" } }, "required": [ "port_count" ] } ``` 2: create a module type and assign it to that profile created above The "media" field appears once the module type is selected. note that the field is a text field & that it does not give any hint about allowed values (possibly another fr?) instead of this being a text array field that is csv formatted (note that it will accept `sfp,sfp28` ) if this was instead changed to be a dropdown multiselect box when its type:array + enum list it would be much more user friendly ### Use case right now the fields which use a predefined list of values, its not currently obvious as to what values are accepted until the form validation is done when saving. exposing that list via a hint OR converting it to a dropdown selection (or multiselection box) would be useful ### Database changes n/a ### External dependencies n/a
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#116