Skip to content

CustomField MultiObject returns dict but expects id's #10241

@PieterL75

Description

@PieterL75

NetBox version

v3.2.9

Python version

3.9

Steps to Reproduce

  1. Create a custom field of the multiobject type
  2. create a device that uses that custom field and populate with some data
  3. retrieve the custom field through the API
  4. update the custom field with a new ID
  5. 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 implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions