[PR #10187] [MERGED] 9895 remove json field inspector #13577

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/10187
Author: @amhn
Created: 8/29/2022
Status: Merged
Merged: 8/30/2022
Merged by: @jeremystretch

Base: developHead: 9895_Remove_JSONFieldInspector


📝 Commits (3)

  • cd6911f Replace custom JSONField inspector with the one from drf_yasg
  • 0b5478a Fixes #9895: Change DictField serializers to JSONField
  • 4f7287f Add _occupied as BooleanField for nested serializers

📊 Changes

9 files changed (+23 additions, -25 deletions)

View changed files

📝 netbox/dcim/api/nested_serializers.py (+8 -0)
📝 netbox/dcim/api/serializers.py (+5 -5)
📝 netbox/extras/api/serializers.py (+3 -3)
📝 netbox/ipam/api/serializers.py (+3 -3)
📝 netbox/netbox/api/serializers/generic.py (+1 -1)
📝 netbox/netbox/settings.py (+1 -1)
📝 netbox/tenancy/api/serializers.py (+1 -1)
📝 netbox/utilities/custom_inspectors.py (+0 -10)
📝 netbox/virtualization/api/serializers.py (+1 -1)

📄 Description

Fixes: #9895

This removes the (unused) custom JSONFieldInspector in favor of the one in drf_yasg.

Fields with serializers.DictField are changed to serializers.JSONField. This change fixes #9895 for ipam/ip-addresses and other objects. This allows an arbitrary object as the respective field instead of a dict of strings.

The third commit fixes the type of the _occupied field for NestedSerializers as mentioned in https://github.com/netbox-community/netbox/issues/9895#issuecomment-1203166847


🔄 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/10187 **Author:** [@amhn](https://github.com/amhn) **Created:** 8/29/2022 **Status:** ✅ Merged **Merged:** 8/30/2022 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `9895_Remove_JSONFieldInspector` --- ### 📝 Commits (3) - [`cd6911f`](https://github.com/netbox-community/netbox/commit/cd6911f83c3696cb5d0e1b89518fe7bc816f593e) Replace custom JSONField inspector with the one from drf_yasg - [`0b5478a`](https://github.com/netbox-community/netbox/commit/0b5478ad2d9738e793e6cbf26e45c3656a563060) Fixes #9895: Change DictField serializers to JSONField - [`4f7287f`](https://github.com/netbox-community/netbox/commit/4f7287fec5f7157cfc37096449cb7be2e104a56f) Add _occupied as BooleanField for nested serializers ### 📊 Changes **9 files changed** (+23 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/api/nested_serializers.py` (+8 -0) 📝 `netbox/dcim/api/serializers.py` (+5 -5) 📝 `netbox/extras/api/serializers.py` (+3 -3) 📝 `netbox/ipam/api/serializers.py` (+3 -3) 📝 `netbox/netbox/api/serializers/generic.py` (+1 -1) 📝 `netbox/netbox/settings.py` (+1 -1) 📝 `netbox/tenancy/api/serializers.py` (+1 -1) 📝 `netbox/utilities/custom_inspectors.py` (+0 -10) 📝 `netbox/virtualization/api/serializers.py` (+1 -1) </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 approved and assigned 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 assigned feature request or bug report below. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WE BE CLOSED AUTOMATICALLY. For example: ### Fixes: #9895 --> ### Fixes: #9895 <!-- Please include a summary of the proposed changes below. --> This removes the (unused) custom JSONFieldInspector in favor of the one in drf_yasg. Fields with serializers.DictField are changed to serializers.JSONField. This change fixes #9895 for ipam/ip-addresses and other objects. This allows an arbitrary object as the respective field instead of a dict of strings. The third commit fixes the type of the _occupied field for NestedSerializers as mentioned in https://github.com/netbox-community/netbox/issues/9895#issuecomment-1203166847 --- <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 23:19:40 +01:00
adam closed this issue 2025-12-29 23:19:40 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13577