Skip to content

Commit

Permalink
Fix swagger and openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
iKapitonau committed Jan 4, 2025
1 parent c1ad1a3 commit 62963d5
Show file tree
Hide file tree
Showing 9 changed files with 89,829 additions and 203,597 deletions.
31 changes: 21 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
VERSION ?= $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf

# SPID and API_KEY are used for Intel SGX attestation
SPID ?= 00000000000000000000000000000000
Expand Down Expand Up @@ -541,30 +540,42 @@ aesm-image:
docker build -f deployment/dockerfiles/aesm.Dockerfile -t enigmampc/aesm .

###############################################################################
### Protobuf ###
### Swagger & Protobuf ###
###############################################################################

protoVer=0.14.0
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)

proto-all: proto-format proto-gen proto-swagger-gen
.PHONY: update-swagger-openapi-docs statik statik-install proto-swagger-openapi-gen

statik-install:
@echo "Installing statik..."
@go install github.com/rakyll/[email protected]

statik:
statik -src=client/docs/static/ -dest=client/docs -f -m

proto-swagger-openapi-gen:
@echo "Generating Protobuf Swagger: $@"
@./scripts/protoc-swagger-openapi-gen.sh

# Example `CHAIN_VERSION=v1.4.0 make update-swagger-openapi-docs`
update-swagger-openapi-docs: statik-install proto-swagger-openapi-gen statik

proto-all: proto-format proto-gen proto-swagger-openapi-gen

proto-gen:
@echo "Generating Protobuf files"
@$(protoImage) sh ./scripts/protocgen.sh

proto-swagger-gen:
@echo "Generating Protobuf Swagger: $@"
@$(shell ./scripts/protoc-swagger-gen.sh $@)
proto-lint:
@$(protoImage) buf lint --error-format=json

proto-format:
@$(protoImage) find ./proto -name "*.proto" -exec clang-format -i {} \;

proto-lint:
@$(protoImage) buf lint --error-format=json

.PHONY: proto-all proto-gen proto-swagger-gen proto-format proto-lint
.PHONY: proto-all proto-gen proto-format proto-lint proto-check-breaking

.PHONY: check-hw
check-hw: build-linux
Expand Down
72 changes: 0 additions & 72 deletions client/docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,6 @@
}
}
},
{
"url": "../../tmp-swagger-gen/cosmos/autocli/v1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "../../tmp-swagger-gen/cosmos/autocli/v1/query.swagger.jsonParams",
"Pool": "../../tmp-swagger-gen/cosmos/autocli/v1/query.swagger.jsonPool",
"DelegatorValidators": "../../tmp-swagger-gen/cosmos/autocli/v1/query.swagger.jsonDelegatorValidators",
"UpgradedConsensusState": "../../tmp-swagger-gen/cosmos/autocli/v1/query.swagger.jsonUpgradedConsensusState",
"Accounts": "../../tmp-swagger-gen/cosmos/autocli/v1/query.swagger.jsonAccounts",
"Account": "../../tmp-swagger-gen/cosmos/autocli/v1/query.swagger.jsonAccount",
"Proposal": "../../tmp-swagger-gen/cosmos/autocli/v1/query.swagger.jsonProposal",
"Proposals": "../../tmp-swagger-gen/cosmos/autocli/v1/query.swagger.jsonProposals",
"Deposits": "../../tmp-swagger-gen/cosmos/autocli/v1/query.swagger.jsonDeposits",
"Deposit": "../../tmp-swagger-gen/cosmos/autocli/v1/query.swagger.jsonDeposit",
"TallyResult": "../../tmp-swagger-gen/cosmos/autocli/v1/query.swagger.jsonTallyResult",
"Votes": "../../tmp-swagger-gen/cosmos/autocli/v1/query.swagger.jsonVotes",
"Vote": "../../tmp-swagger-gen/cosmos/autocli/v1/query.swagger.jsonVote",
"Balance": "../../tmp-swagger-gen/cosmos/autocli/v1/query.swagger.jsonBalance",
"Code": "../../tmp-swagger-gen/cosmos/autocli/v1/query.swagger.jsonCode"
}
}
},
{
"url": "../../tmp-swagger-gen/cosmos/bank/v1beta1/query.swagger.json",
"operationIds": {
Expand Down Expand Up @@ -424,28 +402,6 @@
}
}
},
{
"url": "../../tmp-swagger-gen/cosmos/tx/v1beta1/fixed-service.swagger.json",
"operationIds": {
"rename": {
"Params": "../../tmp-swagger-gen/cosmos/tx/v1beta1/fixed-service.swagger.jsonParams",
"Pool": "../../tmp-swagger-gen/cosmos/tx/v1beta1/fixed-service.swagger.jsonPool",
"DelegatorValidators": "../../tmp-swagger-gen/cosmos/tx/v1beta1/fixed-service.swagger.jsonDelegatorValidators",
"UpgradedConsensusState": "../../tmp-swagger-gen/cosmos/tx/v1beta1/fixed-service.swagger.jsonUpgradedConsensusState",
"Accounts": "../../tmp-swagger-gen/cosmos/tx/v1beta1/fixed-service.swagger.jsonAccounts",
"Account": "../../tmp-swagger-gen/cosmos/tx/v1beta1/fixed-service.swagger.jsonAccount",
"Proposal": "../../tmp-swagger-gen/cosmos/tx/v1beta1/fixed-service.swagger.jsonProposal",
"Proposals": "../../tmp-swagger-gen/cosmos/tx/v1beta1/fixed-service.swagger.jsonProposals",
"Deposits": "../../tmp-swagger-gen/cosmos/tx/v1beta1/fixed-service.swagger.jsonDeposits",
"Deposit": "../../tmp-swagger-gen/cosmos/tx/v1beta1/fixed-service.swagger.jsonDeposit",
"TallyResult": "../../tmp-swagger-gen/cosmos/tx/v1beta1/fixed-service.swagger.jsonTallyResult",
"Votes": "../../tmp-swagger-gen/cosmos/tx/v1beta1/fixed-service.swagger.jsonVotes",
"Vote": "../../tmp-swagger-gen/cosmos/tx/v1beta1/fixed-service.swagger.jsonVote",
"Balance": "../../tmp-swagger-gen/cosmos/tx/v1beta1/fixed-service.swagger.jsonBalance",
"Code": "../../tmp-swagger-gen/cosmos/tx/v1beta1/fixed-service.swagger.jsonCode"
}
}
},
{
"url": "../../tmp-swagger-gen/cosmos/upgrade/v1beta1/query.swagger.json",
"operationIds": {
Expand Down Expand Up @@ -556,28 +512,6 @@
}
}
},
{
"url": "../../tmp-swagger-gen/ibc-apps/packetforward/v1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "../../tmp-swagger-gen/ibc-apps/packetforward/v1/query.swagger.jsonParams",
"Pool": "../../tmp-swagger-gen/ibc-apps/packetforward/v1/query.swagger.jsonPool",
"DelegatorValidators": "../../tmp-swagger-gen/ibc-apps/packetforward/v1/query.swagger.jsonDelegatorValidators",
"UpgradedConsensusState": "../../tmp-swagger-gen/ibc-apps/packetforward/v1/query.swagger.jsonUpgradedConsensusState",
"Accounts": "../../tmp-swagger-gen/ibc-apps/packetforward/v1/query.swagger.jsonAccounts",
"Account": "../../tmp-swagger-gen/ibc-apps/packetforward/v1/query.swagger.jsonAccount",
"Proposal": "../../tmp-swagger-gen/ibc-apps/packetforward/v1/query.swagger.jsonProposal",
"Proposals": "../../tmp-swagger-gen/ibc-apps/packetforward/v1/query.swagger.jsonProposals",
"Deposits": "../../tmp-swagger-gen/ibc-apps/packetforward/v1/query.swagger.jsonDeposits",
"Deposit": "../../tmp-swagger-gen/ibc-apps/packetforward/v1/query.swagger.jsonDeposit",
"TallyResult": "../../tmp-swagger-gen/ibc-apps/packetforward/v1/query.swagger.jsonTallyResult",
"Votes": "../../tmp-swagger-gen/ibc-apps/packetforward/v1/query.swagger.jsonVotes",
"Vote": "../../tmp-swagger-gen/ibc-apps/packetforward/v1/query.swagger.jsonVote",
"Balance": "../../tmp-swagger-gen/ibc-apps/packetforward/v1/query.swagger.jsonBalance",
"Code": "../../tmp-swagger-gen/ibc-apps/packetforward/v1/query.swagger.jsonCode"
}
}
},
{
"url": "../../tmp-swagger-gen/ibc/core/channel/v1/query.swagger.json",
"operationIds": {
Expand Down Expand Up @@ -709,12 +643,6 @@
"Code": "../../tmp-swagger-gen/secret/registration/v1beta1/query.swagger.jsonCode"
}
}
},
{
"url": "./swagger_legacy.yaml",
"dereference": {
"circular": "ignore"
}
}
]
}
Loading

0 comments on commit 62963d5

Please sign in to comment.