JSON custom field with default value {} is set as null #11552

Closed
opened 2025-12-29 21:46:40 +01:00 by adam · 0 comments
Owner

Originally created by @lucagubler on GitHub (Sep 2, 2025).

Originally assigned to: @jnovinger on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.3.7

Python Version

3.12

Steps to Reproduce

  1. Create a new custom field test_config of type JSON with default value {} (empty dict) and assign it to virtual machines.
  2. Create a new virtual machine but leave the test_config custom field blank.
  3. Virtual machine is created, but test_config is set to null instead of empty dict {}

Expected Behavior

The default value should be set to an empty dict {} instead of null

Observed Behavior

The default value was set to null

Originally created by @lucagubler on GitHub (Sep 2, 2025). Originally assigned to: @jnovinger on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.3.7 ### Python Version 3.12 ### Steps to Reproduce 1. Create a new custom field `test_config` of type `JSON` with default value `{}` (empty dict) and assign it to virtual machines. 2. Create a new virtual machine but leave the `test_config` custom field blank. 3. Virtual machine is created, but `test_config` is set to `null` instead of empty dict `{}` ### Expected Behavior The default value should be set to an empty dict `{}` instead of `null` ### Observed Behavior The default value was set to `null`
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:46:40 +01:00
adam closed this issue 2025-12-29 21:46:41 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11552