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

transform-swagger: fix GoogleRPCStatus case #138

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

lbajolet-hashicorp
Copy link
Contributor

🛠️ Description

When updating cloud-packer-service to grpc-gateway v2, we broke the generated SDK for the service because the error type for all our API calls was changed from #/definitions/grpc.gateway.runtime.Error to #/definitions/google.rpc.Status.

This change then conflicted with the transform-swagger code, as it would invoke toCamel on it, rendering the generated type as *cloud.GoogleRpcStatus, where the real type is
*cloud.GoogleRPCStatus.

To circumvent this problem, we hard-code this special case in the transform command, so we end-up with the expected type in the generated Go code.

🔗 External Links

👍 Definition of Done

  • SDK added
  • SDK updated
  • Tests added?
  • Docs updated?

@lbajolet-hashicorp lbajolet-hashicorp requested a review from a team November 25, 2022 17:22
cmd/transform-swagger/main.go Outdated Show resolved Hide resolved
When updating cloud-packer-service to grpc-gateway v2, we broke the
generated SDK for the service because the error type for all our API
calls was changed from #/definitions/grpc.gateway.runtime.Error to
\#/definitions/google.rpc.Status.

This change then conflicted with the transform-swagger code, as it would
invoke `toCamel' on it, rendering the generated type as
`*cloud.GoogleRpcStatus', where the real type is
`*cloud.GoogleRPCStatus'.

To circumvent this problem, we hard-code this special case in the
transform command, so we end-up with the expected type in the generated
Go code.
@itsjaspermilan itsjaspermilan merged commit c81b933 into main Nov 28, 2022
@itsjaspermilan itsjaspermilan deleted the fix_transform_grpc_gateway_v2 branch November 28, 2022 21:15
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.

3 participants