Skip to content

fix: replace int64 with NestedCable in NestedPowerPort#68

Open
aluki wants to merge 1 commit into
fbreckle:masterfrom
aluki:fix_nested_cable
Open

fix: replace int64 with NestedCable in NestedPowerPort#68
aluki wants to merge 1 commit into
fbreckle:masterfrom
aluki:fix_nested_cable

Conversation

@aluki

@aluki aluki commented Jun 23, 2026

Copy link
Copy Markdown

I get this error:

Error: json: cannot unmarshal object into Go struct field NestedPowerPort.power_port.cable of type int64
│
│   with netbox_device_power_outlet.p1,
│   on main.tf line 102, in resource "netbox_device_power_outlet" "p1":
│  102: resource "netbox_device_power_outlet" "p1" {

The NestedPowerPort model defines the Cable as int64. Changed to NestedCable, as the API returns the cable JSON, not only the id.

@aluki

aluki commented Jul 10, 2026

Copy link
Copy Markdown
Author

Any news?

@fbreckle

Copy link
Copy Markdown
Owner

First, all changes should go via the swagger.processed.json file. Then re-generate the client with make generate.

Second, if you need this for a feature in https://github.com/e-breuninger/terraform-provider-netbox, you can just make the PR there and use a go replace so I can verify that this change actually works on all netbox versions supported by the netbox provider.

Ideally, you would also extend/write a test case that verifies the erroneous behavior and then fix it in another commit (can be the same PR).

As-is, I cannot judge whether this change makes sense and, if so, if it works on all relevant netbox versions.

@aluki

aluki commented Jul 10, 2026

Copy link
Copy Markdown
Author

Thank you for your response. I didn't know the procedure. I did all changes and checks in my forks. I'm working toward doing the right way.

@aluki
aluki force-pushed the fix_nested_cable branch from 9190490 to e2ae3c1 Compare July 10, 2026 12:53
@aluki

aluki commented Jul 10, 2026

Copy link
Copy Markdown
Author

PR updated with the correct process (modify swagger.processed.json and then make generate).

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.

2 participants