-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR #5061: Swagger Auto Gen - Staking
- Loading branch information
1 parent
1e204a1
commit 235dc49
Showing
10 changed files
with
4,756 additions
and
217 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
package rest | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
auth "github.com/cosmos/cosmos-sdk/x/auth" | ||
"github.com/cosmos/cosmos-sdk/x/staking/types" | ||
) | ||
|
||
// Concrete Swagger types used to generate REST documentation. Note, these types | ||
// are not actually used but since all queries return a generic JSON raw message, | ||
// they enabled typed documentation. | ||
// | ||
//nolint:deadcode,unused | ||
type ( | ||
postDelegation struct { | ||
auth.StdTx | ||
Msgs []types.MsgDelegate `json:"msg"` | ||
} | ||
|
||
postRedelegation struct { | ||
auth.StdTx | ||
Msgs []types.MsgBeginRedelegate `json:"msg"` | ||
} | ||
|
||
postUndelegate struct { | ||
auth.StdTx | ||
Msgs []types.MsgUndelegate `json:"msg"` | ||
} | ||
|
||
delegatorDelegations struct { | ||
Height int64 `json:"height"` | ||
Result []types.DelegationResponse `json:"result"` | ||
} | ||
|
||
delegatorUnbondingDelegations struct { | ||
Height int64 `json:"height"` | ||
Result []types.UnbondingDelegation `json:"result"` | ||
} | ||
|
||
// XXX: This type won't render correct documentation at the moment due to aliased | ||
// fields. | ||
// | ||
// Ref: https://github.com/swaggo/swag/issues/483 | ||
delegatorTxs struct { | ||
Height int64 `json:"height"` | ||
Result []*sdk.SearchTxsResult `json:"result" swaggertype:"array"` | ||
} | ||
|
||
delegatorValidators struct { | ||
Height int64 `json:"height"` | ||
Result []types.Validator `json:"result"` | ||
} | ||
|
||
delegatorValidator struct { | ||
Height int64 `json:"height"` | ||
Result types.Validator `json:"result"` | ||
} | ||
|
||
delegation struct { | ||
Height int64 `json:"height"` | ||
Result types.DelegationResponse `json:"result"` | ||
} | ||
|
||
unbondingDelegation struct { | ||
Height int64 `json:"height"` | ||
Result types.UnbondingDelegation `json:"result"` | ||
} | ||
|
||
redelegations struct { | ||
Height int64 `json:"height"` | ||
Result types.RedelegationResponses `json:"result"` | ||
} | ||
|
||
validators struct { | ||
Height int64 `json:"height"` | ||
Result []types.Validator `json:"result"` | ||
} | ||
|
||
validator struct { | ||
Height int64 `json:"height"` | ||
Result types.Validator `json:"result"` | ||
} | ||
|
||
validatorDelegations struct { | ||
Height int64 `json:"height"` | ||
Result types.DelegationResponses `json:"result"` | ||
} | ||
|
||
validatorUnbondingDelegations struct { | ||
Height int64 `json:"height"` | ||
Result []types.UnbondingDelegation `json:"result"` | ||
} | ||
|
||
pool struct { | ||
Height int64 `json:"height"` | ||
Result types.Pool `json:"result"` | ||
} | ||
|
||
params struct { | ||
Height int64 `json:"height"` | ||
Result types.Params `json:"result"` | ||
} | ||
) |
Oops, something went wrong.