From 85217a9c78c561dbf0d418a8bd4b9846f8073da8 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Guhur Date: Sun, 7 Jun 2020 12:21:05 +0200 Subject: [PATCH] fix(schemas): add required --- mv-openapi.yaml | 22 ++++++++++++++++++--- openapi/components/schemas/mention.yaml | 2 ++ openapi/components/schemas/participant.yaml | 12 ++++++++--- openapi/components/schemas/poll.yaml | 3 +++ openapi/components/schemas/proposal.yaml | 2 ++ openapi/components/schemas/result.yaml | 3 +++ 6 files changed, 38 insertions(+), 6 deletions(-) diff --git a/mv-openapi.yaml b/mv-openapi.yaml index 817c728..30ddd3b 100644 --- a/mv-openapi.yaml +++ b/mv-openapi.yaml @@ -394,6 +394,8 @@ components: type: string description: An optional description of the proposal example: This school would welcome 500 pupils. + required: + - name mention: type: object properties: @@ -412,34 +414,42 @@ components: type: string description: An optional description of the mention example: 'In this poll, the mention *To reject* disqualifies the proposal.' + required: + - name participant: type: object properties: id: type: string - description: A unique identifier + description: A unique identifier. example: JtRm05yjMAuFCI2uwnFp readOnly: true description: type: string - description: An optional description of the participant + description: An optional description of the participant. example: John Doe has-participed: type: boolean description: >- True if the participant already participed to the poll, False - otherwise + otherwise. example: true poll-id: type: string description: The identifier of the poll that the participant participates on. example: 1jDe1e5eF_IkaYPuoIYX + user-id: + type: string + description: The identifier of the user. + example: 1jDe1e5eF_IkaYPuoIYX mail: type: string description: >- The mail that will eventually created at the creation of the participant (not kept in memory). example: john-doe@example.com + required: + - poll-id poll: type: object properties: @@ -482,6 +492,9 @@ components: type: boolean description: 'True if anyone can participate to this poll, False otherwise.' example: false + required: + - title + - proposals error: type: object properties: @@ -518,6 +531,9 @@ components: items: type: integer format: int16 + required: + - ranking + - poll user: type: object properties: diff --git a/openapi/components/schemas/mention.yaml b/openapi/components/schemas/mention.yaml index 081bbfd..dc84d6c 100644 --- a/openapi/components/schemas/mention.yaml +++ b/openapi/components/schemas/mention.yaml @@ -13,3 +13,5 @@ properties: type: string description: An optional description of the mention example: In this poll, the mention *To reject* disqualifies the proposal. +required: + - name diff --git a/openapi/components/schemas/participant.yaml b/openapi/components/schemas/participant.yaml index 1e7970f..05d7f1b 100644 --- a/openapi/components/schemas/participant.yaml +++ b/openapi/components/schemas/participant.yaml @@ -2,22 +2,28 @@ type: object properties: id: type: string - description: A unique identifier + description: A unique identifier. example: JtRm05yjMAuFCI2uwnFp readOnly: true description: type: string - description: An optional description of the participant + description: An optional description of the participant. example: John Doe has-participed: type: boolean - description: True if the participant already participed to the poll, False otherwise + description: True if the participant already participed to the poll, False otherwise. example: true poll-id: type: string description: The identifier of the poll that the participant participates on. example: 1jDe1e5eF_IkaYPuoIYX + user-id: + type: string + description: The identifier of the user. + example: 1jDe1e5eF_IkaYPuoIYX mail: type: string description: The mail that will eventually created at the creation of the participant (not kept in memory). example: john-doe@example.com +required: + - poll-id diff --git a/openapi/components/schemas/poll.yaml b/openapi/components/schemas/poll.yaml index 51e9640..3f20575 100644 --- a/openapi/components/schemas/poll.yaml +++ b/openapi/components/schemas/poll.yaml @@ -39,3 +39,6 @@ properties: type: boolean description: True if anyone can participate to this poll, False otherwise. example: false +required: + - title + - proposals diff --git a/openapi/components/schemas/proposal.yaml b/openapi/components/schemas/proposal.yaml index a6d7124..143e144 100644 --- a/openapi/components/schemas/proposal.yaml +++ b/openapi/components/schemas/proposal.yaml @@ -18,3 +18,5 @@ properties: type: string description: An optional description of the proposal example: This school would welcome 500 pupils. +required: + - name diff --git a/openapi/components/schemas/result.yaml b/openapi/components/schemas/result.yaml index 1e02b53..8f9f873 100644 --- a/openapi/components/schemas/result.yaml +++ b/openapi/components/schemas/result.yaml @@ -13,3 +13,6 @@ properties: items: type: integer format: int16 +required: + - ranking + - poll