-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
NetBox version
v3.2.9
Python version
3.9
Steps to Reproduce
- Create a custom field of the multiobject type
- create a device that uses that custom field and populate with some data
- retrieve the custom field through the API
- update the custom field with a new ID
- save the device
Expected Behavior
The device with customs fields is updated with the new value's
Observed Behavior
The save of the object fails with the message that a dict is not acceptable, only ID's are allowed
This is because
- the GET API returns the multiobject custom fields as an array of dicts.
- the POST API expects only ID's and not dicts
Reason:
API GET call returns the expanded dicts for custom_fields multiobjects
when adding a new object to the custom_fields, we use the ID of the object
This causes the custom_fields to be a mix of dict and id's
But the deserializer of the CustomField class expects only ID's
Metadata
Metadata
Assignees
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application