Update usages of protoc-gen-swagger to protoc-gen-openapiv2
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
@anilCSE Any reason why we shouldn't update this? The latest version with protoc-gen-swagger is v1.15.2
@anilCSE Any reason why we shouldn't update this? The latest version with
protoc-gen-swaggeris 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.
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.
The expected structure is like the structure generated by protoc-gen-openapiv2
google.protobuf.Any:
type: object
properties:
'@type':
type: string
additionalProperties: {}
we want to upgrade, but haven't had the capacity to do so, we will look into it
@tac0turtle I updated it to fulfill my needs. If you feels it is okay, I can submit a PR: https://github.com/dadamu/cosmos-sdk/commit/9cea181a3d1fce06ee02bc46e7afda1d133e48a0