rename judge to participant

pull/13/head
Nathanaël Jourdane 4 years ago committed by guhur
parent 8865304612
commit dc48687a42

@ -129,7 +129,7 @@ paths:
$ref: '#/components/schemas/ballot' $ref: '#/components/schemas/ballot'
security: security:
- {} - {}
- judgeAuth: [] - participantAuth: []
responses: responses:
'201': '201':
description: Created description: Created
@ -177,8 +177,8 @@ paths:
'404': '404':
$ref: '#/components/responses/ballot-not-found' $ref: '#/components/responses/ballot-not-found'
security: security:
- judgeAuth: [] - participantAuth: []
'/polls/{poll-id}/judges': '/polls/{poll-id}/participants':
parameters: parameters:
- in: path - in: path
name: poll-id name: poll-id
@ -186,13 +186,13 @@ paths:
schema: schema:
type: string type: string
post: post:
operationId: add-judge-to-poll operationId: add-participant-to-poll
description: Add a judge to a poll description: Add a participant to a poll
requestBody: requestBody:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/judge' $ref: '#/components/schemas/participant'
responses: responses:
'200': '200':
description: Invitation was sent description: Invitation was sent
@ -202,36 +202,36 @@ paths:
type: string type: string
'404': '404':
$ref: '#/components/responses/poll-not-found' $ref: '#/components/responses/poll-not-found'
'/polls/{poll-id}/judges/{judge-id}/': '/polls/{poll-id}/participants/{participant-id}/':
parameters: parameters:
- in: path - in: path
name: judge-id name: participant-id
required: true required: true
schema: schema:
type: string type: string
get: get:
operationId: get-poll-judge operationId: get-poll-participant
summary: Get a judge from a poll summary: Get a participant from a poll
responses: responses:
'200': '200':
description: OK description: OK
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/judge' $ref: '#/components/schemas/participant'
'404': '404':
$ref: '#/components/responses/judge-not-found' $ref: '#/components/responses/participant-not-found'
security: security:
- {} - {}
- pollAuth: [] - pollAuth: []
delete: delete:
operationId: delete-poll-judge operationId: delete-poll-participant
summary: Delete a judge from a poll summary: Delete a participant from a poll
responses: responses:
'200': '200':
description: OK description: OK
'404': '404':
$ref: '#/components/responses/judge-not-found' $ref: '#/components/responses/participant-not-found'
security: security:
- pollAuth: [] - pollAuth: []
'/polls/{poll-id}/results': '/polls/{poll-id}/results':
@ -255,7 +255,7 @@ paths:
$ref: '#/components/responses/poll-not-found' $ref: '#/components/responses/poll-not-found'
components: components:
securitySchemes: securitySchemes:
judgeAuth: participantAuth:
type: http type: http
scheme: bearer scheme: bearer
pollAuth: pollAuth:
@ -308,7 +308,7 @@ components:
type: string type: string
description: 'Unique but short name of the grade, like "Excellent" or "To reject".' description: 'Unique but short name of the grade, like "Excellent" or "To reject".'
example: Excellent example: Excellent
judge: participant:
type: object type: object
properties: properties:
id: id:
@ -318,17 +318,19 @@ components:
readOnly: true readOnly: true
has-participed: has-participed:
type: boolean 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 example: true
poll-id: poll-id:
type: string 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 example: 1jDe1e5eF_IkaYPuoIYX
mail: mail:
type: object type: object
description: >- description: >-
The mail that will eventually created at the creation of the judge The mail that will eventually created at the creation of the
(not kept in memory). participant (not kept in memory).
example: john-doe@example.com example: john-doe@example.com
poll: poll:
type: object type: object
@ -344,24 +346,24 @@ components:
description: The title of the poll description: The title of the poll
candidates: candidates:
type: array type: array
description: The candidates being judged in a poll. description: The candidates being voted in a poll.
minItems: 2 minItems: 2
maxItems: 20 maxItems: 20
items: items:
$ref: '#/components/schemas/candidate' $ref: '#/components/schemas/candidate'
grades: grades:
type: array type: array
description: The grades on which one judges a candidate. description: The grades on which one vote to a candidate.
minItems: 2 minItems: 2
maxItems: 10 maxItems: 10
items: items:
$ref: '#/components/schemas/grade' $ref: '#/components/schemas/grade'
judges: participants:
type: array 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: items:
$ref: '#/components/schemas/judge' $ref: '#/components/schemas/participant'
restrict_judges: restrict_participants:
type: boolean type: boolean
description: 'True if anyone can participate to this poll, False otherwise.' description: 'True if anyone can participate to this poll, False otherwise.'
example: false example: false
@ -375,7 +377,7 @@ components:
message: message:
type: string type: string
description: The response details description: The response details
example: The specified judge was not found example: The specified participant was not found
required: required:
- code - code
- message - message
@ -464,8 +466,8 @@ components:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/error' $ref: '#/components/schemas/error'
judge-not-found: participant-not-found:
description: The specified judge was not found description: The specified participant was not found
content: content:
application/json: application/json:
schema: schema:

@ -1,6 +1,6 @@
operationId: 'add-judge-to-poll' operationId: 'add-participant-to-poll'
parameters: parameters:
userId: $response.body#/id userId: $response.body#/id
description: > description: >
The `id` value returned in the response can be used as the `poll-id` parameter 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.

@ -1,4 +1,4 @@
description: The specified judge was not found description: The specified participant was not found
content: content:
application/json: application/json:
schema: schema:

@ -7,7 +7,7 @@ properties:
message: message:
type: string type: string
description: The response details description: The response details
example: The specified judge was not found example: The specified participant was not found
required: required:
- code - code
- message - message

@ -7,13 +7,13 @@ properties:
readOnly: true readOnly: true
has-participed: has-participed:
type: boolean 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 example: true
poll-id: poll-id:
type: string 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' example: '1jDe1e5eF_IkaYPuoIYX'
mail: mail:
type: object 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 example: john-doe@example.com

@ -23,12 +23,12 @@ properties:
maxItems: 10 maxItems: 10
items: items:
$ref: ./grade.yaml $ref: ./grade.yaml
judges: participants:
type: array 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: items:
$ref: ./judge.yaml $ref: ./participant.yaml
restrict_judges: restrict_participants:
type: boolean type: boolean
description: True if anyone can participate to this poll, False otherwise. description: True if anyone can participate to this poll, False otherwise.
example: false example: false

@ -21,15 +21,15 @@ paths:
$ref: 'paths/polls@{poll-id}@ballots.yaml' $ref: 'paths/polls@{poll-id}@ballots.yaml'
'/polls/{poll-id}/ballots/{ballot-id}': '/polls/{poll-id}/ballots/{ballot-id}':
$ref: 'paths/polls@{poll-id}@ballots@{ballot-id}.yaml' $ref: 'paths/polls@{poll-id}@ballots@{ballot-id}.yaml'
'/polls/{poll-id}/judges': '/polls/{poll-id}/participants':
$ref: 'paths/polls@{poll-id}@judges.yaml' $ref: 'paths/polls@{poll-id}@participants.yaml'
'/polls/{poll-id}/judges/{judge-id}/': '/polls/{poll-id}/participants/{participant-id}/':
$ref: 'paths/polls@{poll-id}@judges@{judge-id}@.yaml' $ref: 'paths/polls@{poll-id}@participants@{participant-id}@.yaml'
'/polls/{poll-id}/results': '/polls/{poll-id}/results':
$ref: 'paths/polls@{poll-id}@results.yaml' $ref: 'paths/polls@{poll-id}@results.yaml'
components: components:
securitySchemes: securitySchemes:
judgeAuth: participantAuth:
type: http type: http
scheme: bearer scheme: bearer
pollAuth: pollAuth:

@ -15,7 +15,7 @@ post:
$ref: ../components/schemas/ballot.yaml $ref: ../components/schemas/ballot.yaml
security: security:
- {} - {}
- judgeAuth: [] - participantAuth: []
responses: responses:
'201': '201':
description: Created description: Created

@ -28,4 +28,4 @@ delete:
'404': '404':
$ref: ../components/responses/ballot-not-found.yaml $ref: ../components/responses/ballot-not-found.yaml
security: security:
- judgeAuth: [] - participantAuth: []

@ -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: []

@ -5,13 +5,13 @@ parameters:
schema: schema:
type: string type: string
post: post:
operationId: add-judge-to-poll operationId: add-participant-to-poll
description: Add a judge to a poll description: Add a participant to a poll
requestBody: requestBody:
content: content:
application/json: application/json:
schema: schema:
$ref: ../components/schemas/judge.yaml $ref: ../components/schemas/participant.yaml
responses: responses:
'200': '200':
description: Invitation was sent description: Invitation was sent

@ -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: []
Loading…
Cancel
Save