netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Missing serializer for LinkPeer

Open tobikris opened this issue 3 years ago • 1 comments

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.

tobikris avatar Sep 09 '22 14:09 tobikris

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 avatar Sep 26 '22 13:09 tobikris

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 avatar Oct 28 '22 18:10 arthanson

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] avatar Sep 22 '23 04:09 github-actions[bot]

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] avatar Oct 22 '23 04:10 github-actions[bot]