From dc48687a428107cc89e958185c7d985da6f5c5bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathana=C3=ABl=20Jourdane?= Date: Wed, 27 May 2020 22:04:54 +0200 Subject: [PATCH] rename judge to participant --- mv-openapi.yaml | 62 ++++++++++--------- ...poll.yaml => add-participant-to-poll.yaml} | 4 +- ...-found.yaml => participant-not-found.yaml} | 2 +- openapi/components/schemas/error.yaml | 2 +- .../schemas/{judge.yaml => participant.yaml} | 6 +- openapi/components/schemas/poll.yaml | 8 +-- openapi/mv-openapi-root.yaml | 10 +-- openapi/paths/polls@{poll-id}@ballots.yaml | 2 +- .../polls@{poll-id}@ballots@{ballot-id}.yaml | 2 +- .../polls@{poll-id}@judges@{judge-id}@.yaml | 31 ---------- ...yaml => polls@{poll-id}@participants.yaml} | 6 +- ...ll-id}@participants@{participant-id}@.yaml | 31 ++++++++++ 12 files changed, 84 insertions(+), 82 deletions(-) rename openapi/components/links/{add-judge-to-poll.yaml => add-participant-to-poll.yaml} (63%) rename openapi/components/responses/{judge-not-found.yaml => participant-not-found.yaml} (58%) rename openapi/components/schemas/{judge.yaml => participant.yaml} (63%) delete mode 100644 openapi/paths/polls@{poll-id}@judges@{judge-id}@.yaml rename openapi/paths/{polls@{poll-id}@judges.yaml => polls@{poll-id}@participants.yaml} (73%) create mode 100644 openapi/paths/polls@{poll-id}@participants@{participant-id}@.yaml diff --git a/mv-openapi.yaml b/mv-openapi.yaml index ad5a25d..6137e60 100644 --- a/mv-openapi.yaml +++ b/mv-openapi.yaml @@ -129,7 +129,7 @@ paths: $ref: '#/components/schemas/ballot' security: - {} - - judgeAuth: [] + - participantAuth: [] responses: '201': description: Created @@ -177,8 +177,8 @@ paths: '404': $ref: '#/components/responses/ballot-not-found' security: - - judgeAuth: [] - '/polls/{poll-id}/judges': + - participantAuth: [] + '/polls/{poll-id}/participants': parameters: - in: path name: poll-id @@ -186,13 +186,13 @@ paths: schema: type: string post: - operationId: add-judge-to-poll - description: Add a judge to a poll + operationId: add-participant-to-poll + description: Add a participant to a poll requestBody: content: application/json: schema: - $ref: '#/components/schemas/judge' + $ref: '#/components/schemas/participant' responses: '200': description: Invitation was sent @@ -202,36 +202,36 @@ paths: type: string '404': $ref: '#/components/responses/poll-not-found' - '/polls/{poll-id}/judges/{judge-id}/': + '/polls/{poll-id}/participants/{participant-id}/': parameters: - in: path - name: judge-id + name: participant-id required: true schema: type: string get: - operationId: get-poll-judge - summary: Get a judge from a poll + operationId: get-poll-participant + summary: Get a participant from a poll responses: '200': description: OK content: application/json: schema: - $ref: '#/components/schemas/judge' + $ref: '#/components/schemas/participant' '404': - $ref: '#/components/responses/judge-not-found' + $ref: '#/components/responses/participant-not-found' security: - {} - pollAuth: [] delete: - operationId: delete-poll-judge - summary: Delete a judge from a poll + operationId: delete-poll-participant + summary: Delete a participant from a poll responses: '200': description: OK '404': - $ref: '#/components/responses/judge-not-found' + $ref: '#/components/responses/participant-not-found' security: - pollAuth: [] '/polls/{poll-id}/results': @@ -255,7 +255,7 @@ paths: $ref: '#/components/responses/poll-not-found' components: securitySchemes: - judgeAuth: + participantAuth: type: http scheme: bearer pollAuth: @@ -308,7 +308,7 @@ components: type: string description: 'Unique but short name of the grade, like "Excellent" or "To reject".' example: Excellent - judge: + participant: type: object properties: id: @@ -318,17 +318,19 @@ components: readOnly: true has-participed: type: boolean - description: 'True if the judge 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 judge participates on. + description: The identifier of the poll that the participant participates on. example: 1jDe1e5eF_IkaYPuoIYX mail: type: object description: >- - The mail that will eventually created at the creation of the judge - (not kept in memory). + The mail that will eventually created at the creation of the + participant (not kept in memory). example: john-doe@example.com poll: type: object @@ -344,24 +346,24 @@ components: description: The title of the poll candidates: type: array - description: The candidates being judged in a poll. + description: The candidates being voted in a poll. minItems: 2 maxItems: 20 items: $ref: '#/components/schemas/candidate' grades: type: array - description: The grades on which one judges a candidate. + description: The grades on which one vote to a candidate. minItems: 2 maxItems: 10 items: $ref: '#/components/schemas/grade' - judges: + participants: type: array - description: The judges that are allowed to participate to the election. + description: The participants that are allowed to participate to the election. items: - $ref: '#/components/schemas/judge' - restrict_judges: + $ref: '#/components/schemas/participant' + restrict_participants: type: boolean description: 'True if anyone can participate to this poll, False otherwise.' example: false @@ -375,7 +377,7 @@ components: message: type: string description: The response details - example: The specified judge was not found + example: The specified participant was not found required: - code - message @@ -464,8 +466,8 @@ components: application/json: schema: $ref: '#/components/schemas/error' - judge-not-found: - description: The specified judge was not found + participant-not-found: + description: The specified participant was not found content: application/json: schema: diff --git a/openapi/components/links/add-judge-to-poll.yaml b/openapi/components/links/add-participant-to-poll.yaml similarity index 63% rename from openapi/components/links/add-judge-to-poll.yaml rename to openapi/components/links/add-participant-to-poll.yaml index e872411..e2f3934 100644 --- a/openapi/components/links/add-judge-to-poll.yaml +++ b/openapi/components/links/add-participant-to-poll.yaml @@ -1,6 +1,6 @@ -operationId: 'add-judge-to-poll' +operationId: 'add-participant-to-poll' parameters: userId: $response.body#/id description: > The `id` value returned in the response can be used as the `poll-id` parameter - in POST /polls/{poll-id}/judges. + in POST /polls/{poll-id}/participants. diff --git a/openapi/components/responses/judge-not-found.yaml b/openapi/components/responses/participant-not-found.yaml similarity index 58% rename from openapi/components/responses/judge-not-found.yaml rename to openapi/components/responses/participant-not-found.yaml index 16fa88c..8e7e0dd 100644 --- a/openapi/components/responses/judge-not-found.yaml +++ b/openapi/components/responses/participant-not-found.yaml @@ -1,4 +1,4 @@ -description: The specified judge was not found +description: The specified participant was not found content: application/json: schema: diff --git a/openapi/components/schemas/error.yaml b/openapi/components/schemas/error.yaml index 6bb55a1..24bdbcd 100644 --- a/openapi/components/schemas/error.yaml +++ b/openapi/components/schemas/error.yaml @@ -7,7 +7,7 @@ properties: message: type: string description: The response details - example: The specified judge was not found + example: The specified participant was not found required: - code - message diff --git a/openapi/components/schemas/judge.yaml b/openapi/components/schemas/participant.yaml similarity index 63% rename from openapi/components/schemas/judge.yaml rename to openapi/components/schemas/participant.yaml index 428bb6f..ef6eadf 100644 --- a/openapi/components/schemas/judge.yaml +++ b/openapi/components/schemas/participant.yaml @@ -7,13 +7,13 @@ properties: readOnly: true has-participed: type: boolean - description: True if the judge 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 judge participates on. + description: The identifier of the poll that the participant participates on. example: '1jDe1e5eF_IkaYPuoIYX' mail: type: object - description: The mail that will eventually created at the creation of the judge (not kept in memory). + description: The mail that will eventually created at the creation of the participant (not kept in memory). example: john-doe@example.com diff --git a/openapi/components/schemas/poll.yaml b/openapi/components/schemas/poll.yaml index 0e7e02a..1148386 100644 --- a/openapi/components/schemas/poll.yaml +++ b/openapi/components/schemas/poll.yaml @@ -23,12 +23,12 @@ properties: maxItems: 10 items: $ref: ./grade.yaml - judges: + participants: type: array - description: The judges that are allowed to participate to the election. + description: The participants that are allowed to participate to the election. items: - $ref: ./judge.yaml - restrict_judges: + $ref: ./participant.yaml + restrict_participants: type: boolean description: True if anyone can participate to this poll, False otherwise. example: false diff --git a/openapi/mv-openapi-root.yaml b/openapi/mv-openapi-root.yaml index cae3d57..ba39d01 100644 --- a/openapi/mv-openapi-root.yaml +++ b/openapi/mv-openapi-root.yaml @@ -21,15 +21,15 @@ paths: $ref: 'paths/polls@{poll-id}@ballots.yaml' '/polls/{poll-id}/ballots/{ballot-id}': $ref: 'paths/polls@{poll-id}@ballots@{ballot-id}.yaml' - '/polls/{poll-id}/judges': - $ref: 'paths/polls@{poll-id}@judges.yaml' - '/polls/{poll-id}/judges/{judge-id}/': - $ref: 'paths/polls@{poll-id}@judges@{judge-id}@.yaml' + '/polls/{poll-id}/participants': + $ref: 'paths/polls@{poll-id}@participants.yaml' + '/polls/{poll-id}/participants/{participant-id}/': + $ref: 'paths/polls@{poll-id}@participants@{participant-id}@.yaml' '/polls/{poll-id}/results': $ref: 'paths/polls@{poll-id}@results.yaml' components: securitySchemes: - judgeAuth: + participantAuth: type: http scheme: bearer pollAuth: diff --git a/openapi/paths/polls@{poll-id}@ballots.yaml b/openapi/paths/polls@{poll-id}@ballots.yaml index 66e4f19..4b44f14 100644 --- a/openapi/paths/polls@{poll-id}@ballots.yaml +++ b/openapi/paths/polls@{poll-id}@ballots.yaml @@ -15,7 +15,7 @@ post: $ref: ../components/schemas/ballot.yaml security: - {} - - judgeAuth: [] + - participantAuth: [] responses: '201': description: Created diff --git a/openapi/paths/polls@{poll-id}@ballots@{ballot-id}.yaml b/openapi/paths/polls@{poll-id}@ballots@{ballot-id}.yaml index 2dfa66b..e22948e 100644 --- a/openapi/paths/polls@{poll-id}@ballots@{ballot-id}.yaml +++ b/openapi/paths/polls@{poll-id}@ballots@{ballot-id}.yaml @@ -28,4 +28,4 @@ delete: '404': $ref: ../components/responses/ballot-not-found.yaml security: - - judgeAuth: [] + - participantAuth: [] diff --git a/openapi/paths/polls@{poll-id}@judges@{judge-id}@.yaml b/openapi/paths/polls@{poll-id}@judges@{judge-id}@.yaml deleted file mode 100644 index 0732f21..0000000 --- a/openapi/paths/polls@{poll-id}@judges@{judge-id}@.yaml +++ /dev/null @@ -1,31 +0,0 @@ -parameters: - - in: path - name: judge-id - required: true - schema: - type: string -get: - operationId: get-poll-judge - summary: Get a judge from a poll - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/judge.yaml - '404': - $ref: ../components/responses/judge-not-found.yaml - security: - - {} - - pollAuth: [] -delete: - operationId: delete-poll-judge - summary: Delete a judge from a poll - responses: - '200': - description: OK - '404': - $ref: ../components/responses/judge-not-found.yaml - security: - - pollAuth: [] diff --git a/openapi/paths/polls@{poll-id}@judges.yaml b/openapi/paths/polls@{poll-id}@participants.yaml similarity index 73% rename from openapi/paths/polls@{poll-id}@judges.yaml rename to openapi/paths/polls@{poll-id}@participants.yaml index 7c566b5..bc18c27 100644 --- a/openapi/paths/polls@{poll-id}@judges.yaml +++ b/openapi/paths/polls@{poll-id}@participants.yaml @@ -5,13 +5,13 @@ parameters: schema: type: string post: - operationId: add-judge-to-poll - description: Add a judge to a poll + operationId: add-participant-to-poll + description: Add a participant to a poll requestBody: content: application/json: schema: - $ref: ../components/schemas/judge.yaml + $ref: ../components/schemas/participant.yaml responses: '200': description: Invitation was sent diff --git a/openapi/paths/polls@{poll-id}@participants@{participant-id}@.yaml b/openapi/paths/polls@{poll-id}@participants@{participant-id}@.yaml new file mode 100644 index 0000000..5bdbca0 --- /dev/null +++ b/openapi/paths/polls@{poll-id}@participants@{participant-id}@.yaml @@ -0,0 +1,31 @@ +parameters: + - in: path + name: participant-id + required: true + schema: + type: string +get: + operationId: get-poll-participant + summary: Get a participant from a poll + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/participant.yaml + '404': + $ref: ../components/responses/participant-not-found.yaml + security: + - {} + - pollAuth: [] +delete: + operationId: delete-poll-participant + summary: Delete a participant from a poll + responses: + '200': + description: OK + '404': + $ref: ../components/responses/participant-not-found.yaml + security: + - pollAuth: []