[PR #4304] [MERGED] Set local_context_data serializer on Device and VM to method #12812

Closed
opened 2025-12-29 22:23:45 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/4304
Author: @dstarner
Created: 3/2/2020
Status: Merged
Merged: 3/3/2020
Merged by: @jeremystretch

Base: developHead: 4288-incorrect-swagger-type


📝 Commits (3)

  • 4067082 set local_context_data serializer on device and vm to method
  • 3070c7e fix linting mistake
  • e6ee980 use FieldInspector for JSONField type

📊 Changes

2 files changed (+11 additions, -0 deletions)

View changed files

📝 netbox/netbox/settings.py (+1 -0)
📝 netbox/utilities/custom_inspectors.py (+10 -0)

📄 Description

Fixes: #4288 Incorrect Type for Device & VM local_context_data

For some reason, local_context_data fields were being parsed by Swagger as strings, which broke any swagger clients that attempted to operate against devices or VMs containing this data. This fixes that issue by explicitly denoting local_context_data to be of type DictField in the serializer


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/4304 **Author:** [@dstarner](https://github.com/dstarner) **Created:** 3/2/2020 **Status:** ✅ Merged **Merged:** 3/3/2020 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `4288-incorrect-swagger-type` --- ### 📝 Commits (3) - [`4067082`](https://github.com/netbox-community/netbox/commit/406708218bf41d5fb72db814399b2011d9e48856) set local_context_data serializer on device and vm to method - [`3070c7e`](https://github.com/netbox-community/netbox/commit/3070c7e9911568637bc0a9a8ca8ea777dcb14425) fix linting mistake - [`e6ee980`](https://github.com/netbox-community/netbox/commit/e6ee9803d49276b5a31ae6d977b32fb4cd486a27) use FieldInspector for JSONField type ### 📊 Changes **2 files changed** (+11 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `netbox/netbox/settings.py` (+1 -0) 📝 `netbox/utilities/custom_inspectors.py` (+10 -0) </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be opened for approval prior to filing a pull request. This helps avoid wasting time and effort on something that we might not be able to accept. Please indicate the relevant feature request or bug report below. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ACCEPTED BUG REPORT OR FEATURE REQUEST, IT WILL BE MARKED AS INVALID AND CLOSED. --> ### Fixes: #4288 Incorrect Type for Device & VM `local_context_data` <!-- Please include a summary of the proposed changes below. --> For some reason, `local_context_data` fields were being parsed by Swagger as strings, which broke any swagger clients that attempted to operate against devices or VMs containing this data. This fixes that issue by explicitly denoting `local_context_data` to be of type `DictField` in the serializer --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:23:45 +01:00
adam closed this issue 2025-12-29 22:23:45 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12812