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

[Metal] Interconnections retrieve fails with schema error #16

Closed
aayushrangwala opened this issue Jan 8, 2024 · 2 comments
Closed

[Metal] Interconnections retrieve fails with schema error #16

aayushrangwala opened this issue Jan 8, 2024 · 2 comments

Comments

@aayushrangwala
Copy link

What problem are you facing?

While retrieving connections for a project, using endpoint https://api.equinix.com/metal/v1/projects/{project_id}/connections and below sdk, getting json unmarshalling error for speed parameter for the connection

apiClient.InterconnectionsApi.
	ProjectListInterconnections(context.Background(), project.GetId()).
	Execute()

Note: Any available value of the speed (ex: 5000000 etc) is provided, the error remains the same

Error:

json: cannot unmarshal number 10000000000 into Go struct field _InterconnectionList.interconnections of type int32

How could the Equinix Metal Go SDK help solve this problem?

There seems to be a mismatch in the schema validation on the server and published api doc. Need to fix the marshalling of speed parameter from the server

cprivitere added a commit that referenced this issue Jan 18, 2024
This is a workaround for #16; while we wait for a valid spec to be
delivered, this PR introduces spec patches that appear to update the
necessary fields from `int32` to `int64`.
@ctreatma
Copy link
Contributor

Copying these lines from #22 (comment) for broader visibility:

It's worth noting that the VlanVirtualCircuitUpdateInput and VrfVirtualCircuitUpdateInput schemas specify that speed is a string, which makes sense for the inputs since we document those fields as accepting, e.g., 10Gbps, which is not an integer.

@ctreatma ctreatma changed the title Metal Interconnections retrieve fails with schema error [Metal] Interconnections retrieve fails with schema error Mar 28, 2024
@ctreatma
Copy link
Contributor

This was resolved in #34, which was included in the v0.34.0 release.

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

No branches or pull requests

2 participants