add ability to control json property UI order for module type profiles #11893

Open
opened 2025-12-29 21:51:17 +01:00 by adam · 2 comments
Owner

Originally created by @rconkor on GitHub (Dec 4, 2025).

NetBox version

v4.4.7

Feature type

Change to existing functionality

Proposed functionality

we are looking for the ability to control the UI order of properties in module type profiles.
Ideally via a new attribute for the property, perhaps "weight".

Use case

Currently, when modifying the JSON schema for module type profiles, the order presented in the UI is derived from the property names (alphabetically).

We would like the ability to control UI order of properties to offer a better flow to properties.
See example JSON:

{
    "if": {
        "properties": {
            "type": {
                "const": "NVMe"
            }
        }
    },
    "properties": {
        "hot_swappable": {
            "default": false,
            "title": "Hot-swappable",
            "type": "boolean"
        },
        "size": {
            "description": "Raw disk capacity",
            "title": "Size (GB)",
            "type": "integer"
        },
        "type": {
            "default": "SSD",
            "enum": [
                "HD",
                "SSD",
                "NVMe"
            ],
            "title": "Disk type",
            "type": "string"
        },
        "generation": {
            "enum": [
                "Gen3",
                "Gen4",
                "Gen5"
            ],
            "title": "NVMe Generation",
            "type": "string"
        }
    },
    "required": [
        "size"
    ],
    "then": {
        "required": [
            "generation"
        ]
    }
}

In the above example, the "generation" property actually comes before "type" in the UI because G comes before T. We'd like the ability to force "generation" to be after "type" in the UI so it makes more sense.
Right now, the only work around I've found is to name the property something like "u_generation" so now the property starts with a U and comes after T. But this is clunky.

Database changes

none

External dependencies

none

Originally created by @rconkor on GitHub (Dec 4, 2025). ### NetBox version v4.4.7 ### Feature type Change to existing functionality ### Proposed functionality we are looking for the ability to control the UI order of properties in module type profiles. Ideally via a new attribute for the property, perhaps "weight". ### Use case Currently, when modifying the JSON schema for module type profiles, the order presented in the UI is derived from the property names (alphabetically). We would like the ability to control UI order of properties to offer a better flow to properties. See example JSON: ``` { "if": { "properties": { "type": { "const": "NVMe" } } }, "properties": { "hot_swappable": { "default": false, "title": "Hot-swappable", "type": "boolean" }, "size": { "description": "Raw disk capacity", "title": "Size (GB)", "type": "integer" }, "type": { "default": "SSD", "enum": [ "HD", "SSD", "NVMe" ], "title": "Disk type", "type": "string" }, "generation": { "enum": [ "Gen3", "Gen4", "Gen5" ], "title": "NVMe Generation", "type": "string" } }, "required": [ "size" ], "then": { "required": [ "generation" ] } } ``` In the above example, the "generation" property actually comes before "type" in the UI because G comes before T. We'd like the ability to force "generation" to be after "type" in the UI so it makes more sense. Right now, the only work around I've found is to name the property something like "u_generation" so now the property starts with a U and comes after T. But this is clunky. ### Database changes none ### External dependencies none
adam added the type: featurestatus: under reviewnetbox labels 2025-12-29 21:51:17 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 4, 2025):

We're pretty much limited to whatever the JSON schema library supports. Were you able to find any native functionality therein that would support what you're proposing?

@jeremystretch commented on GitHub (Dec 4, 2025): We're pretty much limited to whatever the JSON schema library supports. Were you able to find any native functionality therein that would support what you're proposing?
Author
Owner

@rconkor commented on GitHub (Dec 4, 2025):

We're pretty much limited to whatever the JSON schema library supports. Were you able to find any native functionality therein that would support what you're proposing?

I don't pretend to be an expert, but this leads me to a possibility of a custom keyword:
https://docs.json-everything.net/schema/vocabs/

something like this example:

{
    "properties": {
        "type": {
            "default": "SSD",
            "enum": [
                "HD",
                "SSD",
                "NVMe"
            ],
            "title": "Disk type",
            "type": "string"
        },
        "generation": {
            "enum": [
                "Gen3",
                "Gen4",
                "Gen5"
            ],
            "title": "NVMe Generation",
            "type": "string"
        }
    },
    "required": [
        "type"
    ],
	"x-uiOrder": [
		"type", "generation"
	]
}
@rconkor commented on GitHub (Dec 4, 2025): > We're pretty much limited to whatever the JSON schema library supports. Were you able to find any native functionality therein that would support what you're proposing? I don't pretend to be an expert, but this leads me to a possibility of a custom keyword: https://docs.json-everything.net/schema/vocabs/ something like this example: ``` { "properties": { "type": { "default": "SSD", "enum": [ "HD", "SSD", "NVMe" ], "title": "Disk type", "type": "string" }, "generation": { "enum": [ "Gen3", "Gen4", "Gen5" ], "title": "NVMe Generation", "type": "string" } }, "required": [ "type" ], "x-uiOrder": [ "type", "generation" ] } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11893