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

Upstream patches of forked go-netbox client

Open hensoko opened this issue 4 years ago • 4 comments

Hey there,

we're using netbox with go for quite some time now but started working on a fork of go-netbox as the swagger.json was often out of date. I'm currently preparing simple patches that can be applied hopefully against new versions of swagger.json to fix several (type of *_id fields / number fields) and wonder how I can help upstream.

You can find my changes in feature/modernize.

Regards

hensoko avatar Sep 16 '20 10:09 hensoko

I just merged https://github.com/netbox-community/go-netbox/pull/92 so we have master working with netbox 2.9

awlx avatar Sep 16 '20 11:09 awlx

As far as I can see there are still several fields that seem to be generated wrong.

For example: /virtualization/cluster-types or /virtualization/clusters The id field of the list operation is defined as string instead of integers. I have a lot of examples of this kind that I have fixed, eg for virtualization see here

hensoko avatar Sep 16 '20 12:09 hensoko

Could you make a PR with the revlevant changes?

awlx avatar Sep 16 '20 12:09 awlx

Sure, gonna prepare something.

hensoko avatar Sep 16 '20 15:09 hensoko

Closing, because now there are two ways to fix issues in generated code:

  • Changing the OpenAPI spec with pre-generation hooks (see scripts/pre-generation).
  • If the above is not possible, changing the generated code with post-generation hooks (see scripts/post-generation).

v0ctor avatar Feb 25 '23 17:02 v0ctor