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

Upgrade go-netbox to Netbox version 3.0.2 #121

Merged
merged 4 commits into from
Sep 16, 2021

Conversation

chdxD1
Copy link
Contributor

@chdxD1 chdxD1 commented Sep 10, 2021

This is my first PR here but I hope that this is fine!

This PR tries to update this library to Netbox version 3.0.2. There are some changes however from the official swagger.json file that can be fetched from a Netbox:

  • The maximumInt for scopeID in a VLANGroup was changed to an int. swagger generate client generates it in a scientific notation which does not work with go
  • I've removed all "additionalProperties": {"type": "string", "x-nullable": true} . This will result in a map of interface{} instead of the correct nested types. Swagger does not really support discriminators on the same level (like connected_endpoint_type / cable_peer_type) apparently. However the connected_endpoint and cable_peer_type can vary. Also some nested types are missing (e.g. for console ports).

I think the swagger autogeneration on the netbox side itself also needs some love to not require these changes but it's something someone needs to take care off (netbox-community/netbox#4808, netbox-community/netbox#4804)

@MaxRink
Copy link

MaxRink commented Sep 15, 2021

/cc @awlx :D

@awlx
Copy link
Collaborator

awlx commented Sep 16, 2021

@chdxD1 thanks for your PR :). Is it good to merge from your perspective or anything you'd like to add before we merge it?

@awlx awlx self-assigned this Sep 16, 2021
@chdxD1
Copy link
Contributor Author

chdxD1 commented Sep 16, 2021

@awlx is the failing go 1.16.x check something to worry about? I've tried to replicate it locally with a clean 1.16 docker container but there it worked fine.
Maybe some feedback on the wording in the README would be appreciated https://github.com/netbox-community/go-netbox/pull/121/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5 😄

@awlx
Copy link
Collaborator

awlx commented Sep 16, 2021

I don't think it's something to worry about as it fails for everything ... and I didn't figure out yet why this happens. Also it's only 1.16.

README.md Outdated Show resolved Hide resolved
@awlx awlx merged commit c6261e6 into netbox-community:master Sep 16, 2021
@awlx
Copy link
Collaborator

awlx commented Sep 16, 2021

https://github.com/netbox-community/go-netbox/releases/tag/netbox_v3.0 released! Thanks again @chdxD1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants