-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopen-api.yaml
More file actions
67 lines (66 loc) · 2.22 KB
/
open-api.yaml
File metadata and controls
67 lines (66 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
openapi: 3.0.1
info:
title: Assessment API
description: 'Assessment API'
version: v1
paths:
/questions:
get:
summary: Returns the list of translated questions and associated choices
parameters:
- in: query
required: true
name: lang
schema:
type: string
description: Language (ISO-639-1 code) in which the questions and choices should be translated
responses:
200:
description: List of translated questions and associated choices
content:
application/json:
schema:
$ref: '#/components/schemas/QuestionList'
post:
summary: Creates a new question and associated choices (the number of associated choices must be exactly equal to 3)
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Question'
responses:
200:
description: Question and associated choices (not translated)
content:
application/json:
schema:
$ref: '#/components/schemas/Question'
components:
schemas:
QuestionList:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Question'
Question:
type: object
properties:
text:
type: string
createdAt:
type: string
format: date-time
description: Creation date of the question
choices:
type: array
description: Choices associated to the question
items:
$ref: '#/components/schemas/Choice'
Choice:
type: object
properties:
text:
type: string