Remove requirement for image dimensions in API #17070
Labels
severity: low
Does not significantly disrupt application functionality, or a workaround is available
status: accepted
This issue has been accepted for implementation
type: bug
A confirmed report of unexpected behavior in the application
NetBox version
v4.0.8
Feature type
Change to existing functionality
Proposed functionality
When uploading an image attachment via API, it should not require
image_height
andimage_width
fields. These should be calculated automatically, as they are when uploading using the GUI. Actually this already works, if you provide incorrect values (any integer) they will be ignored, and Netbox figures out the correct dimensions.As an example, I'd like to use code like this:
This currently fails with 400:
{"image_height":["This field is required."],"image_width":["This field is required."]}
Use case
Calculating image dimensions requires extra work, and Netbox is already capable of doing this automatically, as it does when you upload using the GUI.
Database changes
none
External dependencies
No response
The text was updated successfully, but these errors were encountered: