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

Delete fields that need custom serializer handling #26

Closed
wants to merge 1 commit into from

Conversation

hollow
Copy link

@hollow hollow commented Dec 27, 2022

link_peers is actually an array of objects and is not implemented properly in the swagger.json definition.

As soon as a circuit termination is connected to a device interface the Terraform provider cannot unmarshal the response anymore:

│ Error: json: cannot unmarshal object into Go struct field CircuitTermination.link_peers of type string
│ 
│   with netbox_circuit_termination.megaport-leaseweb["WDC-02"],
│   on megaport.tf line 92, in resource "netbox_circuit_termination" "megaport-leaseweb":
│   92: resource "netbox_circuit_termination" "megaport-leaseweb" {

However, this attribute is not used in the provider anyway, so I have removed it instead of trying to fix it.

@fbreckle
Copy link
Owner

fbreckle commented Jan 3, 2023

You have to update the preprocess script to reflect your changes. Else, next time I regenerate the client from a fresh netbox swagger file, your changes are lost.
The process is:

  • download swagger file from netbox
  • preprocess it with the script
  • generate client from preprocessed swagger file

Also, circuit termination and link peers are outside my area of expertise - are link peers a feature nobody will ever need? I would prefer it to be fixed instead of being removed.

@hollow hollow changed the title Remove broken link_peers Delete fields that need custom serializer handling May 17, 2023
@hollow
Copy link
Author

hollow commented May 17, 2023

@fbreckle I have added the removal of fields that need a custom serializer implementation to the preprocessor and regenerated all files. Please let me know if this works and I'll follow up with a PR in the terraform provider.

@hollow
Copy link
Author

hollow commented May 17, 2023

Also, circuit termination and link peers are outside my area of expertise - are link peers a feature nobody will ever need? I would prefer it to be fixed instead of being removed.

I agree with you, but implementing custom serializers is beyond my scope (read: available time), and with the current implementation, the provider cannot be made to work to create circuit terminations

@hollow
Copy link
Author

hollow commented May 17, 2023

Just realized that this is now a duplicate of #28

@hollow hollow closed this Dec 9, 2024
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