Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netbox openapi schema is generating incorrect response types #15404

Open
deathbeam opened this issue Mar 11, 2024 · 4 comments · May be fixed by #15449
Open

Netbox openapi schema is generating incorrect response types #15404

deathbeam opened this issue Mar 11, 2024 · 4 comments · May be fixed by #15449
Assignees
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation topic: OpenAPI type: bug A confirmed report of unexpected behavior in the application

Comments

@deathbeam
Copy link
Contributor

deathbeam commented Mar 11, 2024

Deployment Type

Self-hosted

NetBox Version

v3.7.3

Python Version

3.9

Steps to Reproduce

  1. Check swagger for /api/dcim/sites
  2. Create some dummy site with random ASN
  3. Observe that swagger openapi schema tells that response for site.asns is supposed to be list of integers (e.g ids)
  4. Observe that actual rest response for site.asns is the asns objects themselves

image

image

Expected Behavior

Openapi schema and actual API response must always match otherwise the schema is basically unusable. The response and schema used to match in past (confirmed on 3.4.5 at least) so something broke since.

Observed Behavior

Schema and response do not match. Observed behaviour is for site.asns, configcontext.roles, configcontext.tenants, virtualizationinterface.tagged_vlans, but there are probably more.

@deathbeam deathbeam added the type: bug A confirmed report of unexpected behavior in the application label Mar 11, 2024
@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation topic: OpenAPI severity: low Does not significantly disrupt application functionality, or a workaround is available labels Mar 12, 2024
@deathbeam
Copy link
Contributor Author

deathbeam commented Mar 12, 2024

Is this really low severity? This breaks clients that use the openapi to generate/implement clients for netbox and its pretty big regression. We for example cannot upgrade to new Netbox without this feature working properly as we rely on openapi heavily.

@jeremystretch
Copy link
Member

Yes, it's considered low severity as only the schema is affected; the function of the API itself is not.

Of course, if this is pressing for you, you are more then welcome to submit a PR for it. Can I assign this to you?

@deathbeam
Copy link
Contributor Author

deathbeam commented Mar 12, 2024

Yes, it's considered low severity as only the schema is affected; the function of the API itself is not.

Of course, if this is pressing for you, you are more then welcome to submit a PR for it. Can I assign this to you?

Alright. For now we are not upgrading past 3.5.0, if I will have some time I will look at it, but can't make any promises so probs dont assign it to me (in case someone that might know what caused this would want to look at this like @arthanson as I assume this PR caused the incorrect behavior: #11626)

@arthanson arthanson self-assigned this Mar 15, 2024
@arthanson arthanson removed the status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation label Mar 15, 2024
@arthanson arthanson added the status: accepted This issue has been accepted for implementation label Mar 18, 2024
@olekgo
Copy link

olekgo commented Apr 9, 2024

Interface.TaggedVlans is another one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity: low Does not significantly disrupt application functionality, or a workaround is available status: accepted This issue has been accepted for implementation topic: OpenAPI type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants