Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid REST API request setting custom fields raises TypeError #10134

Closed
jeremystretch opened this issue Aug 24, 2022 · 0 comments
Closed

Invalid REST API request setting custom fields raises TypeError #10134

jeremystretch opened this issue Aug 24, 2022 · 0 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@jeremystretch
Copy link
Member

NetBox version

v3.3.0

Python version

3.8

Steps to Reproduce

Send a malformed REST API request attempting to set custom fields for an object. For example:

curl -X PATCH \
-H "Authorization: Token $TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json; indent=4" \
http://netbox:8000/api/dcim/sites/1/ \
--data '{"custom_fields": "xxx"}'

Note that custom_fields maps to a string rather than a dictionary.

Expected Behavior

NetBox should return a 400 Bad Request response indicating the reason for the failure.

Observed Behavior

A TypeError exception is raised.

@jeremystretch jeremystretch added type: bug A confirmed report of unexpected behavior in the application status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Aug 24, 2022
@jeremystretch jeremystretch self-assigned this Aug 24, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

1 participant