Skip to content

Commit

Permalink
chore: update protoc-swagger-gen to protoc-openapi-gen
Browse files Browse the repository at this point in the history
  • Loading branch information
dadamu committed May 17, 2024
1 parent 2c3fd19 commit 9cea181
Show file tree
Hide file tree
Showing 8 changed files with 9,899 additions and 13,255 deletions.
23,136 changes: 9,886 additions & 13,250 deletions client/docs/swagger-ui/swagger.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions contrib/devtools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ ENV GOLANG_PROTOBUF_VERSION=1.28.1 \

RUN go install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar@latest && \
go install google.golang.org/protobuf/cmd/protoc-gen-go@v${GOLANG_PROTOBUF_VERSION} && \
go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v${GRPC_GATEWAY_VERSION} \
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@v${GRPC_GATEWAY_VERSION} && \
go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v${GRPC_GATEWAY_VERSION} && \
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest && \
go install cosmossdk.io/orm/cmd/protoc-gen-go-cosmos-orm@v1.0.0-beta.3 && \
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

Expand Down
4 changes: 2 additions & 2 deletions proto/buf.gen.swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: v1
plugins:
- name: swagger
- name: openapiv2
out: ../tmp-swagger-gen
opt: logtostderr=true,fqn_for_swagger_name=true,simple_operation_ids=true
opt: logtostderr=true,fqn_for_openapi_name=true,simple_operation_ids=true,json_names_for_fields=false
2 changes: 2 additions & 0 deletions proto/cosmos/app/v1alpha1/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package cosmos.app.v1alpha1;

import "google/protobuf/any.proto";

option go_package = "cosmossdk.io/api/app/v1alpha1";

// Config represents the configuration for a Cosmos SDK ABCI app.
// It is intended that all state machine logic including the version of
// baseapp and tx handlers (and possibly even Tendermint) that an app needs
Expand Down
2 changes: 2 additions & 0 deletions proto/cosmos/app/v1alpha1/module.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package cosmos.app.v1alpha1;

import "google/protobuf/descriptor.proto";

option go_package = "cosmossdk.io/api/app/v1alpha1";

extend google.protobuf.MessageOptions {
// module indicates that this proto type is a config object for an app module
// and optionally provides other descriptive information about the module.
Expand Down
2 changes: 2 additions & 0 deletions proto/cosmos/app/v1alpha1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package cosmos.app.v1alpha1;

import "cosmos/app/v1alpha1/config.proto";

option go_package = "cosmossdk.io/api/app/v1alpha1";

// Query is the app module query service.
service Query {

Expand Down
2 changes: 2 additions & 0 deletions proto/cosmos/orm/query/v1alpha1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import "google/protobuf/duration.proto";
import "google/protobuf/any.proto";
import "cosmos/base/query/v1beta1/pagination.proto";

option go_package = "cosmossdk.io/api/app/cosmos/orm/query/v1alpha1";

// Query is a generic gRPC service for querying ORM data.
service Query {

Expand Down
2 changes: 1 addition & 1 deletion scripts/protoc-swagger-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -eo pipefail

mkdir -p ./tmp-swagger-gen
cd proto
proto_dirs=$(find ./cosmos -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
proto_dirs=$(find ./cosmos ../x -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
for dir in $proto_dirs; do
# generate swagger files (filter query files)
query_file=$(find "${dir}" -maxdepth 1 \( -name 'query.proto' -o -name 'service.proto' \))
Expand Down

0 comments on commit 9cea181

Please sign in to comment.