Closed
Description
Deployment Type
Self-hosted
NetBox Version
v3.7.1
Python Version
3.11
Steps to Reproduce
- Look at the API documentation for /api/dcim/device-types/{id}, on the demo site (https://demo.netbox.dev/api/schema/swagger-ui/#/dcim/dcim_device_types_retrieve) and inspect the Schema for DeviceType, see that front_image and rear_image are declared as strings
- Use https://demo.netbox.dev/dcim/device-types/7/ as an example to test, a device_type that has no front or rear images associated with the object
- Send an http GET request to /api/dcim/device-types/7/ using the netbox demo's swagger documentation website here: https://demo.netbox.dev/api/schema/swagger-ui/#/dcim/dcim_device_types_retrieve, click "try it out!", for the ID, enter in 7, click Execute
- Observe that the response payload for front_image and/or rear_image is set to null and not an empty string despite the Model specifying "string" for the type and not specfying "nullable:true" on the field. See screenshots below:
Expected Behavior
I expected that the types in the response from the query would match what types are defined in the model.
Observed Behavior
We get back the wrong type in the response from the API when a front and/or rear image is not attached to a device_type.