go-netbox icon indicating copy to clipboard operation
go-netbox copied to clipboard

Autogenerate client from swagger json

Open mraerino opened this issue 5 years ago • 5 comments

Focussed on these goals:

  • Generate client from swagger.json
  • Simplify structure of package (breaking change)
    • models and client directories

Todos:

  • [x] Have up-to-date swagger.json
    • [x] Take swagger file from blank netbox installation (2.7.10)
    • [ ] ~Patch swagger spec for incorrect definitions / missing parts~
  • [ ] Higher-level abstraction code to handle polymorphism

mraerino avatar Jan 05 '20 10:01 mraerino

@mraerino Still working for this? Sorry for late but, I am planning to add netbox v2.7 for client.

kobayashi avatar Feb 03 '20 00:02 kobayashi

@mraerino Are you still working for this? I would like to add v2.7 supported version.

kobayashi avatar Mar 03 '20 15:03 kobayashi

@kobayashi @mraerino What is the progress on the 2.7 update? Can we also have the versioning tags match, or closely match the netbox versions?

stefanmcshane avatar Mar 19 '20 19:03 stefanmcshane

I did the following to update this PR:

  • rebase against master
  • replace swagger.json with vanilla file from https://netboxdemo.com/api/docs/?format=openapi
  • regenerate operations and models using go-swagger
  • fix license, examples etc

I did not make any changes to the swagger.json which is the main goal here.

If anyone is interested in moving this forward, please try out this branch using this:

go get -u github.com/netbox-community/go-netbox@86b0ffb1e31c476e90023d048a43ae43a794e3b1

if you are using types from the models, you'd want to replace github.com/netbox-community/go-netbox/netbox/models with github.com/netbox-community/go-netbox/models

mraerino avatar Mar 21 '20 10:03 mraerino

I cherry-picked some of the ideas to master. Are we going to keep this open or close for good?

awlx avatar Oct 02 '20 08:10 awlx

Closing, since there is no activity and these changes were added in #143.

v0ctor avatar Feb 24 '23 23:02 v0ctor