Add a data_type field to the CustomField API serializer #5921

Closed
opened 2025-12-29 19:34:15 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Jan 10, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.1.5

Feature type

Change to existing functionality

Proposed functionality

Add a read-only data_type field to the REST API serializer for the custom field model. This will convey the JSON data type being returned by the custom field.

For example, a text, longtext, or url custom field would return a data type of string. The value of this field is inferred entirely from the custom field type; no user input is required or possible.

Use case

This would provide a convenient mechanism by which an API client can "learn" how to process the custom fields without needing to rely on a predefined mapping of field types.

Database changes

No response

External dependencies

No response

Originally created by @jeremystretch on GitHub (Jan 10, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.1.5 ### Feature type Change to existing functionality ### Proposed functionality Add a read-only `data_type` field to the REST API serializer for the custom field model. This will convey the JSON data type being returned by the custom field. For example, a `text`, `longtext`, or `url` custom field would return a data type of `string`. The value of this field is inferred entirely from the custom field type; no user input is required or possible. ### Use case This would provide a convenient mechanism by which an API client can "learn" how to process the custom fields without needing to rely on a predefined mapping of field types. ### Database changes _No response_ ### External dependencies _No response_
adam added the status: acceptedtype: feature labels 2025-12-29 19:34:15 +01:00
adam closed this issue 2025-12-29 19:34:15 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5921