[PR #10239] [MERGED] Closes #10231: Add missing serializer annotations #13593

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/10239
Author: @amhn
Created: 9/1/2022
Status: Merged
Merged: 9/2/2022
Merged by: @jeremystretch

Base: developHead: Add_missing_serializer_annotation


📝 Commits (1)

📊 Changes

3 files changed (+5 additions, -0 deletions)

View changed files

📝 netbox/extras/api/serializers.py (+1 -0)
📝 netbox/ipam/api/serializers.py (+1 -0)
📝 netbox/users/api/nested_serializers.py (+3 -0)

📄 Description

Fixes: #10231

This PR adds missing annotations to all fields using serializers.SerializerMethodField, that do not return a string.

Only the annotation of VlanGroupSerializer.scope currently has an effect as the other objects are currently not exposed in the API.

Diff of swagger.json after merge:

*** swagger.orig.json   2022-09-01 17:15:26.325786061 +0200
--- swagger.new.json    2022-09-01 17:16:12.493466700 +0200
***************
*** 13184,13192 ****
                  },
                "scope" : { 
                    "readOnly" : true,
                    "title" : "Scope",
!                   "type" : "string"
                  },
                "scope_id" : { 
                    "title" : "Scope id",
                    "type" : "integer",
--- 13184,13192 ----
                  },
                "scope" : { 
                    "readOnly" : true,
                    "title" : "Scope",
!                   "type" : "object"
                  },
                "scope_id" : { 
                    "title" : "Scope id",
                    "type" : "integer",

🔄 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/10239 **Author:** [@amhn](https://github.com/amhn) **Created:** 9/1/2022 **Status:** ✅ Merged **Merged:** 9/2/2022 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `Add_missing_serializer_annotation` --- ### 📝 Commits (1) - [`b11fa53`](https://github.com/netbox-community/netbox/commit/b11fa535193c7d4bb48fcd9b5fac8156be93daf3) Closes #10231: Add missing serializer annotations ### 📊 Changes **3 files changed** (+5 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/api/serializers.py` (+1 -0) 📝 `netbox/ipam/api/serializers.py` (+1 -0) 📝 `netbox/users/api/nested_serializers.py` (+3 -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 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. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WE BE CLOSED AUTOMATICALLY. Specify your assigned issue number on the line below. --> ### Fixes: #10231 <!-- Please include a summary of the proposed changes below. --> This PR adds missing annotations to all fields using serializers.SerializerMethodField, that do not return a string. Only the annotation of VlanGroupSerializer.scope currently has an effect as the other objects are currently not exposed in the API. Diff of swagger.json after merge: ``` *** swagger.orig.json 2022-09-01 17:15:26.325786061 +0200 --- swagger.new.json 2022-09-01 17:16:12.493466700 +0200 *************** *** 13184,13192 **** }, "scope" : { "readOnly" : true, "title" : "Scope", ! "type" : "string" }, "scope_id" : { "title" : "Scope id", "type" : "integer", --- 13184,13192 ---- }, "scope" : { "readOnly" : true, "title" : "Scope", ! "type" : "object" }, "scope_id" : { "title" : "Scope id", "type" : "integer", ``` --- <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:45 +01:00
adam closed this issue 2025-12-29 23:19: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#13593