ConfigContext does not validate that JSON data is an object #2015

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

Originally created by @jeremystretch on GitHub (Sep 18, 2018).

Environment

  • Python version: 3.5.2
  • NetBox version: 2.4.4

Steps to Reproduce

  1. Create a new config context. Do not assign it to anything. (It will apply to all devices/VMs.)
  2. Enter 1 as the data and save the config context.
  3. Retrieve the rendered config context for a device.

Expected Behavior

Creating the config context with non-dictionary data should raise a validation error.

Observed Behavior

The config context was saved with the integer value. This causes a TypeError exception when attempting to retrieve the rendered context (either via the UI or API).

Originally created by @jeremystretch on GitHub (Sep 18, 2018). ### Environment * Python version: 3.5.2 * NetBox version: 2.4.4 ### Steps to Reproduce 1. Create a new config context. Do not assign it to anything. (It will apply to all devices/VMs.) 2. Enter `1` as the data and save the config context. 3. Retrieve the rendered config context for a device. ### Expected Behavior Creating the config context with non-dictionary data should raise a validation error. ### Observed Behavior The config context was saved with the integer value. This causes a TypeError exception when attempting to retrieve the rendered context (either via the UI or API).
adam added the type: bugstatus: accepted labels 2025-12-29 17:21:30 +01:00
adam closed this issue 2025-12-29 17:21:30 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2015