From a58f01c7f1fe039f01b62dddb7d5516aa1994387 Mon Sep 17 00:00:00 2001 From: Mitja T Date: Tue, 23 Jan 2024 13:15:42 -0800 Subject: [PATCH] api: enum proposal states --- api/spec/v1.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/api/spec/v1.yaml b/api/spec/v1.yaml index 9ea34acc6..f5705ce28 100644 --- a/api/spec/v1.yaml +++ b/api/spec/v1.yaml @@ -724,12 +724,12 @@ paths: name: submitter schema: <<: *StakingAddressType - description: The submitter of the proposal. + description: Filter on the submitter of the proposal. - in: query name: state schema: - type: string - description: The state of the proposal. + $ref: '#/components/schemas/ProposalState' + description: Filter on the state of the proposal. example: *proposal_state_1 responses: '200': @@ -2058,6 +2058,12 @@ components: type: string description: The target propotocol versions for this upgrade proposal. + ProposalState: + type: string + enum: [active, passed, failed, rejected] + description: The state of the proposal. + example: 'active' + Proposal: type: object # TODO: Revise required fields. Most fields are required for actual proposals, and only absent @@ -2076,9 +2082,7 @@ components: description: The staking address of the proposal submitter. example: *staking_address_1 state: - type: string - description: The state of the proposal. - example: 'active' + $ref: '#/components/schemas/ProposalState' deposit: <<: *BigIntType description: The deposit attached to this proposal.