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

Update usages of protoc-gen-swagger to protoc-gen-openapiv2 #7620

Closed
4 tasks
clevinson opened this issue Oct 21, 2020 · 5 comments · Fixed by #20448
Closed
4 tasks

Update usages of protoc-gen-swagger to protoc-gen-openapiv2 #7620

clevinson opened this issue Oct 21, 2020 · 5 comments · Fixed by #20448
Labels
C: Proto Proto definition and proto release T:Docs Changes and features related to documentation.

Comments

@clevinson
Copy link
Contributor

clevinson commented Oct 21, 2020

Summary

GRPC Gateway has renamed the protoc-gen-swagger package to protoc-gen-openapiv2 (see here). We need to update the go get references in ./contrib/devtools/proto-tools-installer.sh here. There are possibly other places where this rename has caused issues, so we should investigate what else may broken by this.

Note: This was originally reported as a bug, but in actuality, when running make proto-tools go-get will find the old version of grpc-gateway that has the protoc-gen-swagger subdirectory.

Despite this not actually breaking anything currently, I think it would be a good idea for us to update to use protoc-gen-openapiv2, as this will get built from the current version of grpc-gateway, which does not happen for the protoc-gen-swagger binary.

Steps to Reproduce

make proto-tools


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@clevinson
Copy link
Contributor Author

@anilcse Any reason why we shouldn't update this? The latest version with protoc-gen-swagger is v1.15.2

@clevinson clevinson removed the T:Bug label Oct 22, 2020
@anilcse
Copy link
Collaborator

anilcse commented Oct 22, 2020

@anilcse Any reason why we shouldn't update this? The latest version with protoc-gen-swagger is v1.15.2

No strong reasons, we can update. We need to investigate the changes before updating this may be. I can spend some time on this.

@tac0turtle tac0turtle added C: Proto Proto definition and proto release T:Docs Changes and features related to documentation. labels Jan 19, 2022
@tac0turtle tac0turtle self-assigned this Feb 4, 2022
@tac0turtle tac0turtle moved this from Todo to In Progress in Cosmos SDK: Framework WG Feb 4, 2022
@aaronc aaronc moved this from In Progress to Todo in Cosmos SDK: Framework WG Feb 25, 2022
@aaronc aaronc moved this from Todo to Ice Box in Cosmos SDK: Framework WG Mar 29, 2022
@tac0turtle tac0turtle moved this to 📝 Todo in Cosmos-SDK May 9, 2022
@tac0turtle tac0turtle removed their assignment Aug 30, 2023
@tac0turtle tac0turtle moved this to 👀 To Do in Cosmos-SDK Nov 16, 2023
@dadamu
Copy link
Contributor

dadamu commented May 9, 2024

Hi, Any updates on this?

I found that protoc-gen-swagger translate protobuf.Any to not correct structure, while protoc-gen-openapiv2 has no this issue.

The issue is that protobuf.Any generated by protoc-gen-swagger is the structure like:

google.protobuf.Any:
    type: object
    properties:
      type_url:
        type: string
      value:
        type: string
        format: byte
        description: >-
          Must be a valid serialized protocol buffer of the above specified
          type.

image

The expected structure is like the structure generated by protoc-gen-openapiv2

google.protobuf.Any:
    type: object
    properties:
      '@type':
        type: string
    additionalProperties: {}

image

@tac0turtle
Copy link
Member

tac0turtle commented May 9, 2024

we want to upgrade, but haven't had the capacity to do so, we will look into it

@dadamu
Copy link
Contributor

dadamu commented May 17, 2024

@tac0turtle I updated it to fulfill my needs. If you feels it is okay, I can submit a PR: dadamu@9cea181

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Proto Proto definition and proto release T:Docs Changes and features related to documentation.
Projects
No open projects
4 participants