API-Version header could be more precise #8188

Closed
opened 2025-12-29 20:33:36 +01:00 by adam · 1 comment
Owner

Originally created by @CADbloke on GitHub (Jun 13, 2023).

NetBox version

3.5.3

Feature type

Change to existing functionality

Proposed functionality

API header API-Version for API calls to https://demo.netbox.dev/api/ is 3.5 but https://demo.netbox.dev/api/status/ says "netbox-version": "3.5.3". There are differences between versions 3.5.1 & 3.5.3, for example, so the version header could be more precise.

In some cases the difference is significant. When integer maximums change, sat from 2147483647 to 32767 it changes the expected type in many strongly-typed languages. This example is from PowerPortRequest.allocated_draw

Use case

Object validation which differs between API versions

Database changes

none.

External dependencies

none.

Originally created by @CADbloke on GitHub (Jun 13, 2023). ### NetBox version 3.5.3 ### Feature type Change to existing functionality ### Proposed functionality API header `API-Version` for API calls to https://demo.netbox.dev/api/ is 3.5 but https://demo.netbox.dev/api/status/ says "netbox-version": "3.5.3". There are differences between versions 3.5.1 & 3.5.3, for example, so the version header could be more precise. In some cases the difference is significant. When integer maximums change, sat from 2147483647 to 32767 it changes the expected type in many strongly-typed languages. This example is from `PowerPortRequest.allocated_draw` ### Use case Object validation which differs between API versions ### Database changes none. ### External dependencies none.
adam added the type: feature label 2025-12-29 20:33:36 +01:00
adam closed this issue 2025-12-29 20:33:36 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jun 13, 2023):

The status endpoint reports the specific NetBox version; the API itself is versioned only to the minor release, as it is not intended to change between e.g. 3.4 and 3.5.

In some cases the difference is significant. When integer maximums change, sat from 2147483647 to 32767 it changes the expected type in many strongly-typed languages. This example is from PowerPortRequest.allocated_draw

You could make a case that such changes should be deferred to the next minor release, however that did not seem to be a concern regarding this particular change.

@jeremystretch commented on GitHub (Jun 13, 2023): The status endpoint reports the specific NetBox version; the API itself is versioned only to the minor release, as it is not intended to change between e.g. 3.4 and 3.5. > In some cases the difference is significant. When integer maximums change, sat from 2147483647 to 32767 it changes the expected type in many strongly-typed languages. This example is from PowerPortRequest.allocated_draw You could make a case that such changes should be deferred to the next minor release, however that did not seem to be a concern regarding this particular change.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8188