Sites fields in generated API have incorrect type #2113

Closed
opened 2025-12-29 17:22:25 +01:00 by adam · 0 comments
Owner

Originally created by @dje on GitHub (Nov 9, 2018).

Environment

  • Python version: 3.6.4
  • NetBox version: v2.4.8-dev

Steps to Reproduce

Visit /api/docs/ and then select the GET /dcim/sites API endpoint. In the Responses section you'll see count_prefixes and all the count_ fields have a string type.

Expected Behavior

Since the JSON response for these fields are integer this should be an integer type in the generated API.

Observed Behavior

The JSON response is an integer for these fields, but the generated types are string. This causes generated clients trouble.

Originally created by @dje on GitHub (Nov 9, 2018). ### Environment * Python version: 3.6.4 * NetBox version: v2.4.8-dev ### Steps to Reproduce Visit `/api/docs/` and then select the GET `/dcim/sites` API endpoint. In the **Responses** section you'll see `count_prefixes` and all the `count_` fields have a `string` type. ### Expected Behavior Since the JSON response for these fields are integer this should be an `integer` type in the generated API. ### Observed Behavior The JSON response is an integer for these fields, but the generated types are `string`. This causes generated clients trouble.
adam added the type: bugstatus: acceptedtype: documentation labels 2025-12-29 17:22:25 +01:00
adam closed this issue 2025-12-29 17:22:25 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2113