TLDR: Add tags to this SDK that match previous releases of Netbox, so that we can import a version that works based on our version of Netbox.
netbox and go-netbox versioning mismatch:
The crux of the issue here is that Netbox does not seem to fully respect Semantic Versioning.
An example (among others) that bit me: Going from 2.6 --> 2.7 , the following API breaking change was introduced:
As Go, and OpenAPI are statically typed, this results in a predictible unmarshal error if you try to use what is currently on master for go-netbox with Netbox v2.6:
json: cannot unmarshal number into Go struct field PrefixStatus.results.status.value of type string
If API Changes were purely additive in Netbox, this wouldn't be an issue (as defined by SemVer as using the same major version).
Since this SDK is not versioned, there are PR and commits coming in for all version of Netbox. For example, this PR attempts to fix the SDK for the issue above for Netbox v2.6 users:
https://github.com/netbox-community/go-netbox/pull/70
As this PR describes, it was initially there, then got overwritten (with the v2.7 changes). After this PR got applied, master went back to v2.6 for a little while, then another PR replaced it with the v2.7 breaking changes again:
How to resolve this
The simplest is to assume that master is always up to date with the latest netbox API. I would suggest making sure that all the PR that get accepted are relevant for the latest netbox API as well.
For previous Netbox version, a tag/label should be added to specific commit that are known to be the latest working commits for those versions. A table of compatibility should then ideally be available. For example, the kubernetes go-client does this pretty well IMO:
TLDR: Add tags to this SDK that match previous releases of Netbox, so that we can import a version that works based on our version of Netbox.
netbox and go-netbox versioning mismatch:
The crux of the issue here is that Netbox does not seem to fully respect Semantic Versioning. An example (among others) that bit me: Going from
2.6
-->2.7
, the following API breaking change was introduced:In NetBox v2.7, it now looks like this:
As Go, and OpenAPI are statically typed, this results in a predictible unmarshal error if you try to use what is currently on master for
go-netbox
with Netboxv2.6
:If API Changes were purely additive in Netbox, this wouldn't be an issue (as defined by SemVer as using the same major version).
Since this SDK is not versioned, there are PR and commits coming in for all version of Netbox. For example, this PR attempts to fix the SDK for the issue above for Netbox
v2.6
users: https://github.com/netbox-community/go-netbox/pull/70As this PR describes, it was initially there, then got overwritten (with the
v2.7
changes). After this PR got applied, master went back tov2.6
for a little while, then another PR replaced it with thev2.7
breaking changes again:How to resolve this
The simplest is to assume that master is always up to date with the latest netbox API. I would suggest making sure that all the PR that get accepted are relevant for the latest netbox API as well.
For previous Netbox version, a tag/label should be added to specific commit that are known to be the latest working commits for those versions. A table of compatibility should then ideally be available. For example, the kubernetes
go-client
does this pretty well IMO:https://github.com/kubernetes/client-go#compatibility-matrix