Skip to content

Commit

Permalink
chore: remove gov v1beta1 endpoints from docs (#3589)
Browse files Browse the repository at this point in the history
* chore: remove gov v1beta1 endpoints from docs

* also restore missing upgrade module

* set deprecated option

* Add deprecated options and fully qualified naming
  • Loading branch information
gartnera authored Feb 26, 2025
1 parent 280c75c commit e8ae60f
Show file tree
Hide file tree
Showing 8 changed files with 5,190 additions and 6,467 deletions.
3 changes: 3 additions & 0 deletions docs/openapi/openapi.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
dom_id: "#swagger-ui",
deepLinking: true,
layout: "BaseLayout",
showExtensions: true,
showCommonExtensions: true,
defaultModelExpandDepth: 5
});
}
</script>
Expand Down
11,185 changes: 4,933 additions & 6,252 deletions docs/openapi/openapi.swagger.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion proto/buf.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ plugins:
- name: openapiv2
out: .
strategy: all
opt: allow_merge=true,merge_file_name=zetachain,output_format=yaml,json_names_for_fields=false
opt: allow_merge=true,merge_file_name=zetachain,output_format=yaml,openapi_naming_strategy=fqn,simple_operation_ids=true,enable_rpc_deprecation=true
8 changes: 8 additions & 0 deletions proto/zetachain/zetacore/crosschain/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -166,52 +166,60 @@ service Query {
returns (QueryGetOutboundTrackerResponse) {
option (google.api.http).get =
"/zeta-chain/crosschain/outTxTracker/{chainID}/{nonce}";
option deprecated = true;
}

// Deprecated(v17): use OutboundTrackerAll
rpc OutTxTrackerAll(QueryAllOutboundTrackerRequest)
returns (QueryAllOutboundTrackerResponse) {
option (google.api.http).get = "/zeta-chain/crosschain/outTxTracker";
option deprecated = true;
}

// Deprecated(v17): use OutboundTrackerAllByChain
rpc OutTxTrackerAllByChain(QueryAllOutboundTrackerByChainRequest)
returns (QueryAllOutboundTrackerByChainResponse) {
option (google.api.http).get =
"/zeta-chain/crosschain/outTxTrackerByChain/{chain}";
option deprecated = true;
}

// Deprecated(v17): use InboundTrackerAllByChain
rpc InTxTrackerAllByChain(QueryAllInboundTrackerByChainRequest)
returns (QueryAllInboundTrackerByChainResponse) {
option (google.api.http).get =
"/zeta-chain/crosschain/inTxTrackerByChain/{chain_id}";
option deprecated = true;
}

// Deprecated(v17): use InboundTrackerAll
rpc InTxTrackerAll(QueryAllInboundTrackersRequest)
returns (QueryAllInboundTrackersResponse) {
option (google.api.http).get = "/zeta-chain/crosschain/inTxTracker";
option deprecated = true;
}

// Deprecated(v17): use InboundHashToCctx
rpc InTxHashToCctx(QueryGetInboundHashToCctxRequest)
returns (QueryGetInboundHashToCctxResponse) {
option (google.api.http).get =
"/zeta-chain/crosschain/inTxHashToCctx/{inboundHash}";
option deprecated = true;
}

// Deprecated(v17): use InboundHashToCctxData
rpc InTxHashToCctxData(QueryInboundHashToCctxDataRequest)
returns (QueryInboundHashToCctxDataResponse) {
option (google.api.http).get =
"/zeta-chain/crosschain/inTxHashToCctxData/{inboundHash}";
option deprecated = true;
}

// Deprecated(v17): use InboundHashToCctxAll
rpc InTxHashToCctxAll(QueryAllInboundHashToCctxRequest)
returns (QueryAllInboundHashToCctxResponse) {
option (google.api.http).get = "/zeta-chain/crosschain/inTxHashToCctx";
option deprecated = true;
}
}

Expand Down
7 changes: 7 additions & 0 deletions proto/zetachain/zetacore/lightclient/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,46 @@ service Query {
rpc BlockHeaderAll(QueryAllBlockHeaderRequest)
returns (QueryAllBlockHeaderResponse) {
option (google.api.http).get = "/zeta-chain/lightclient/block_headers";
option deprecated = true;
}

rpc BlockHeader(QueryGetBlockHeaderRequest)
returns (QueryGetBlockHeaderResponse) {
option (google.api.http).get =
"/zeta-chain/lightclient/block_headers/{block_hash}";
option deprecated = true;
}

rpc ChainStateAll(QueryAllChainStateRequest)
returns (QueryAllChainStateResponse) {
option (google.api.http).get = "/zeta-chain/lightclient/chain_state";
option deprecated = true;
}

rpc ChainState(QueryGetChainStateRequest)
returns (QueryGetChainStateResponse) {
option (google.api.http).get =
"/zeta-chain/lightclient/chain_state/{chain_id}";
option deprecated = true;
}

rpc Prove(QueryProveRequest) returns (QueryProveResponse) {
option (google.api.http).get = "/zeta-chain/lightclient/prove";
option deprecated = true;
}

rpc HeaderSupportedChains(QueryHeaderSupportedChainsRequest)
returns (QueryHeaderSupportedChainsResponse) {
option (google.api.http).get =
"/zeta-chain/lightclient/header_supported_chains";
option deprecated = true;
}

rpc HeaderEnabledChains(QueryHeaderEnabledChainsRequest)
returns (QueryHeaderEnabledChainsResponse) {
option (google.api.http).get =
"/zeta-chain/lightclient/header_enabled_chains";
option deprecated = true;
}
}

Expand Down
15 changes: 12 additions & 3 deletions scripts/protoc-gen-openapi.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash

go install github.com/grpc-ecosystem/grpc-gateway/v2/[email protected]
set -eo pipefail

go install github.com/grpc-ecosystem/grpc-gateway/v2/[email protected]

go mod download

Expand Down Expand Up @@ -54,12 +56,19 @@ keys=$(yq e '.paths | keys' $OUTPUT_DIR/$MERGED_SWAGGER_FILE)
for key in $keys; do
# Check if key starts with '/cosmos/NAME'
if [[ $key == "/cosmos/"* ]]; then
# Exclude paths starting with /cosmos/gov/v1beta1
# these endpoints are broken post v0.47 upgrade
if [[ $key == "/cosmos/gov/v1beta1"* ]]; then
yq e "del(.paths.\"$key\")" -i $OUTPUT_DIR/$MERGED_SWAGGER_FILE
continue
fi

# Extract NAME
name=$(echo $key | cut -d '/' -f 3)
# Check if the standard module is not imported in the app.go
if ! grep -q "github.com/cosmos/cosmos-sdk/x/$name" $APP_GO; then
# Keep the standard "base" and "tx" endpoints
if [[ $name == "base" || $name == "tx" ]]; then
# Keep the standard "base", "tx", and "upgrade" endpoints
if [[ $name == "base" || $name == "tx" || $name == "upgrade" ]]; then
continue
fi
# If not found, delete the key from the YAML file in-place
Expand Down
Loading

0 comments on commit e8ae60f

Please sign in to comment.