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

Fix sawgger gen output dir #7374

Merged
merged 5 commits into from
Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ distclean: clean
clean:
rm -rf \
$(BUILDDIR)/ \
artifacts/
artifacts/ \
tmp-swagger-gen/

.PHONY: distclean clean

Expand Down
28 changes: 14 additions & 14 deletions client/docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,71 +13,71 @@
}
},
{
"url": "./cosmos/auth/v1beta1/query.swagger.json",
"url": "./tmp-swagger-gen/cosmos/auth/v1beta1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "AuthParams"
}
}
},
{
"url": "./cosmos/bank/v1beta1/query.swagger.json",
"url": "./tmp-swagger-gen/cosmos/bank/v1beta1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "BankParams"
}
}
},
{
"url": "./cosmos/distribution/v1beta1/query.swagger.json",
"url": "./tmp-swagger-gen/cosmos/distribution/v1beta1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "DistributionParams"
}
}
},
{
"url": "./cosmos/evidence/v1beta1/query.swagger.json",
"url": "./tmp-swagger-gen/cosmos/evidence/v1beta1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "EvidenceParams"
}
}
},
{
"url": "./cosmos/gov/v1beta1/query.swagger.json",
"url": "./tmp-swagger-gen/cosmos/gov/v1beta1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "GovParams"
}
}
},
{
"url": "./cosmos/mint/v1beta1/query.swagger.json",
"url": "./tmp-swagger-gen/cosmos/mint/v1beta1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "MintParams"
}
}
},
{
"url": "./cosmos/params/v1beta1/query.swagger.json",
"url": "./tmp-swagger-gen/cosmos/params/v1beta1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "Params"
}
}
},
{
"url": "./cosmos/slashing/v1beta1/query.swagger.json",
"url": "./tmp-swagger-gen/cosmos/slashing/v1beta1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "SlashingParams"
}
}
},
{
"url": "./cosmos/staking/v1beta1/query.swagger.json",
"url": "./tmp-swagger-gen/cosmos/staking/v1beta1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "StakingParams",
Expand All @@ -86,39 +86,39 @@
}
},
{
"url": "./cosmos/upgrade/v1beta1/query.swagger.json",
"url": "./tmp-swagger-gen/cosmos/upgrade/v1beta1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "UpgradeParams"
}
}
},
{
"url": "./ibc/channel/query.swagger.json",
"url": "./tmp-swagger-gen/ibc/channel/query.swagger.json",
"operationIds": {
"rename": {
"Params": "IBCChannelParams"
}
}
},
{
"url": "./ibc/client/query.swagger.json",
"url": "./tmp-swagger-gen/ibc/client/query.swagger.json",
"operationIds": {
"rename": {
"Params": "IBCClientParams"
}
}
},
{
"url": "./ibc/connection/query.swagger.json",
"url": "./tmp-swagger-gen/ibc/connection/query.swagger.json",
"operationIds": {
"rename": {
"Params": "IBCConnectionParams"
}
}
},
{
"url": "./ibc/transfer/query.swagger.json",
"url": "./tmp-swagger-gen/ibc/transfer/query.swagger.json",
"operationIds": {
"rename": {
"Params": "IBCTransferParams"
Expand Down
7 changes: 4 additions & 3 deletions scripts/protoc-swagger-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

set -eo pipefail

mkdir -p ./tmp-swagger-gen
proto_dirs=$(find ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
for dir in $proto_dirs; do

Expand All @@ -12,7 +13,8 @@ for dir in $proto_dirs; do
-I "proto" \
-I "third_party/proto" \
"$query_file" \
--swagger_out=logtostderr=true,stderrthreshold=1000,fqn_for_swagger_name=true,simple_operation_ids=true:.
--swagger_out ./tmp-swagger-gen \
--swagger_opt logtostderr=true --swagger_opt fqn_for_swagger_name=true --swagger_opt simple_operation_ids=true
fi
done

Expand All @@ -22,5 +24,4 @@ done
swagger-combine ./client/docs/config.json -o ./client/docs/swagger-ui/swagger.yaml -f yaml --continueOnConflictingPaths true --includeDefinitions true

# clean swagger files
rm -rf cosmos
rm -rf ibc
rm -rf ./tmp-swagger-gen
alessio marked this conversation as resolved.
Show resolved Hide resolved