OpenAPI Spec not matching observed behaviour for Interface Model #13792
Labels
pending closure
Requires immediate attention to avoid being closed for inactivity
severity: low
Does not significantly disrupt application functionality, or a workaround is available
status: needs owner
This issue is tentatively accepted pending a volunteer committed to its implementation
topic: OpenAPI
type: bug
A confirmed report of unexpected behavior in the application
NetBox version
v.3.6.1
Python version
3.8
Steps to Reproduce
Expected Behavior
According to the OpenAPI spec, the Interface Model returns an array of integers.
See https://demo.netbox.dev/api/schema/swagger-ui/#/dcim/dcim_interfaces_list
Observed Behavior
The InterfaceSerializer returns the full objects instead of the expected wlan ids.
This is more useful as an api itself, but openapi generators which consume this api spec (e.g. https://github.com/OpenAPITools/openapi-generator/), generate wrong client implementations leading to unexpected behaviour.
In my case i used openapi generator to generate a golang client for netbox 3.6.1 (the official go-netbox client is still stuck at 3.4: netbox-community/go-netbox#157).
Assigning a wlan to an interface in netbox lead to golang unmarshalling an empty interface struct due to unexpected values in the response (a struct/object instead of integers), where it fails silently for some reason.
Unassigning the wlan from the interface "fixes" this bug.
The text was updated successfully, but these errors were encountered: