Improve schemas descriptions and add examples

pull/13/head
Nathanaël Jourdane 4 years ago committed by guhur
parent d60fcf2571
commit 06adcb5f11

@ -2,12 +2,14 @@ type: object
properties: properties:
id: id:
type: string type: string
description: A unique identifier.
readOnly: true readOnly: true
name: name:
type: string type: string
description: Unique but short name of the candidate. description: Unique but short name of the candidate.
example: A new school
judgments: judgments:
type: array type: array
description: The judgments received by this candidate.
items: items:
$ref: ./judgment.yaml $ref: ./judgment.yaml
description: The judgments received by this candidate.

@ -2,8 +2,12 @@ type: object
properties: properties:
code: code:
type: string type: string
description: The HTTP code of the response
example: 404
message: message:
type: string type: string
description: The response details
example: The specified judge was not found
required: required:
- code - code
- message - message

@ -2,7 +2,9 @@ type: object
properties: properties:
id: id:
type: string type: string
description: A unique identifier
readOnly: true readOnly: true
name: name:
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

@ -2,11 +2,18 @@ type: object
properties: properties:
id: id:
type: string type: string
description: A unique identifier
example: JtRm05yjMAuFCI2uwnFp
readOnly: true readOnly: true
has-voted: has-voted:
type: string type: boolean
description: True if the judge already voted on the poll, False otherwise
example: true
poll-id: poll-id:
type: string type: string
description: The identifier of the poll that the judge participates on.
example: '1jDe1e5eF_IkaYPuoIYX'
mail: mail:
type: object type: object
description: Send a mail at the creation of the judge. The mail is not kept in memory. description: The mail that will eventually created at the creation of the judge (not kept in memory).
example: john-doe@example.com

@ -2,6 +2,8 @@ type: object
properties: properties:
id: id:
type: string type: string
description: A unique identifier
readOnly: true readOnly: true
grade: grade:
type: string type: string
description: The grade item, according to the grades array defined when creating the poll.

@ -2,27 +2,31 @@ type: object
properties: properties:
id: id:
type: string type: string
description: 'A unique identifier'
example: '1jDe1e5eF_IkaYPuoIYX'
readOnly: true readOnly: true
title: title:
type: string type: string
description: 'As <title>, I find these candidates:' example: 'What project should our neighbourhood invest in for the next year?'
description: 'The title of the poll'
candidates: candidates:
type: array type: array
description: The candidates being judged in a poll.
minItems: 2 minItems: 2
maxItems: 20 maxItems: 20
items: items:
$ref: ./candidate.yaml $ref: ./candidate.yaml
description: The candidates being judged in a poll.
grades: grades:
type: array type: array
description: The grades on which one judges a candidate.
items: items:
$ref: ./grade.yaml $ref: ./grade.yaml
description: The grades on which one judges a candidate.
judges: judges:
type: array type: array
description: The judges that are allowed to participate to the election.
items: items:
$ref: ./judge.yaml $ref: ./judge.yaml
description: The judges that are allowed to participate to the election.
restrict_judges: restrict_judges:
type: boolean type: boolean
description: Can anyone create a judge? description: True if anyone can participate to this poll, False otherwise.
example: false

@ -1,9 +1,15 @@
type: object type: object
properties: properties:
poll: poll:
type: object
description: The poll belonging to this result.
$ref: ./poll.yaml $ref: ./poll.yaml
ranking: ranking:
type: array type: array
description: An array representing grades level for each candidate,
according to the grades list, following the order of the candidates array
defined when the related poll has been created.
examples: [0, 6, 3, 2, 2]
items: items:
type: integer type: integer
format: int16 format: int16

Loading…
Cancel
Save