Skip to content

API serializer foreign count fields do not have a default value #5450

@markkuleinio

Description

@markkuleinio

Environment

  • Python version: 3.7.3
  • NetBox version: 2.9.11

Steps to Reproduce

  1. Create a new tag with any name, like "Testing"
  2. Get the same tag via API and see tagged_items field

Expected Behavior

tagged_items is 0 (API docs say the field is integer)

Observed Behavior

tagged_items is null

$ curl -s -X GET "http://netbox-test.example.net/api/extras/tags/?name=Testing" -H "Authorization: token xxx" | jq .
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 4,
      "url": "http://netbox-test.example.net/api/extras/tags/4/",
      "name": "Testing",
      "slug": "testing",
      "color": "9e9e9e",
      "description": "",
      "tagged_items": null
    }
  ]
}

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