Missing serializer for LinkPeer #6960

Closed
opened 2025-12-29 19:47:11 +01:00 by adam · 4 comments
Owner

Originally created by @tobikris on GitHub (Sep 9, 2022).

NetBox version

v3.3.2

Python version

3.10

Steps to Reproduce

  1. Download the OpenAPI schema from http://demo.netbox.dev/api/docs/?format=openapi
  2. Investigate the Schema for CircuitTermination.

Expected Behavior

The Schema should include a NestedLinkPeer representation including its attributes.

Observed Behavior

Instead it seems there is some kind of dummy in the schema.

                    "title": "Link peer",
                    "description": "\nReturn the appropriate serializer for the link termination model.\n",
                    "type": "object",
                    "additionalProperties": {
                        "type": "string",
                        "x-nullable": true
                    },
                    "readOnly": true

The same thing applies to several other models (I think all that can have link peers).

I went searching through the code but unfortunately do not understand the details of the automatically generated schema.
I would love to get this fixed as it currently requires me to fix the generated code manually and updates are very hard in this way.
Let me know if I can be of any help here.

Originally created by @tobikris on GitHub (Sep 9, 2022). ### NetBox version v3.3.2 ### Python version 3.10 ### Steps to Reproduce 1. Download the OpenAPI schema from http://demo.netbox.dev/api/docs/\?format\=openapi 2. Investigate the Schema for CircuitTermination. ### Expected Behavior The Schema should include a NestedLinkPeer representation including its attributes. ### Observed Behavior Instead it seems there is some kind of dummy in the schema. ``` "title": "Link peer", "description": "\nReturn the appropriate serializer for the link termination model.\n", "type": "object", "additionalProperties": { "type": "string", "x-nullable": true }, "readOnly": true ``` The same thing applies to several other models (I think all that can have link peers). I went searching through the code but unfortunately do not understand the details of the automatically generated schema. I would love to get this fixed as it currently requires me to fix the generated code manually and updates are very hard in this way. Let me know if I can be of any help here.
adam closed this issue 2025-12-29 19:47:11 +01:00
Author
Owner

@tobikris commented on GitHub (Sep 26, 2022):

Can you point me in the right direction so I can take a look myself? Is there any documentation for the automatic OpenAPI schema generation NetBox is using under the hood?

@tobikris commented on GitHub (Sep 26, 2022): Can you point me in the right direction so I can take a look myself? Is there any documentation for the automatic OpenAPI schema generation NetBox is using under the hood?
Author
Owner

@arthanson commented on GitHub (Oct 28, 2022):

marking as blocked for #9608 see: https://stackoverflow.com/questions/36576447/swagger-specify-two-responses-with-same-code-based-on-optional-parameter
This isn't really a dummy return, there is no NestedLinkPeer model, the return can be one of a couple different types, but OpenAPI 2 doesn't look like it can support this. OpenAPI 3 does have a convention for this.

@arthanson commented on GitHub (Oct 28, 2022): marking as blocked for #9608 see: https://stackoverflow.com/questions/36576447/swagger-specify-two-responses-with-same-code-based-on-optional-parameter This isn't really a dummy return, there is no NestedLinkPeer model, the return can be one of a couple different types, but OpenAPI 2 doesn't look like it can support this. OpenAPI 3 does have a convention for this.
Author
Owner

@github-actions[bot] commented on GitHub (Sep 22, 2023):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Sep 22, 2023): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Oct 22, 2023):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Oct 22, 2023): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6960