rename judge to participant

pull/9/head
Nathanaël Jourdane 4 years ago
parent cbebaa06da
commit 812b979e46

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

@ -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.

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

@ -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

@ -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

@ -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

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

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

@ -28,4 +28,4 @@ delete:
'404':
$ref: ../components/responses/ballot-not-found.yaml
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:
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

@ -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