-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yml
More file actions
163 lines (163 loc) · 4.01 KB
/
openapi.yml
File metadata and controls
163 lines (163 loc) · 4.01 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
openapi: "3.0.2"
info:
title: Subtitles OpenAPI
version: "2.0.0"
description: Description of the HTTP endpoints of the Polyflix Subtitle service
servers:
- url: "http://{server}/v{version}"
description: Local
variables:
server:
default: localhost:5000
version:
default: "2.0.0"
- url: "https://{server}/v{version}"
description: QA
variables:
server:
default: qapolyflix.dopolytech.fr/api
version:
default: "2.0.0"
tags:
- name: TODOs
components:
schemas:
TODO:
type: object
allOf:
- $ref: "#/components/schemas/TODOBase"
- properties:
id:
type: string
description: The id of the TODO
required:
- id
- userId
- url
- status
TODOBase:
type: object
properties:
name:
type: string
description: The name of the TODO
description:
type: string
description: The TODO description
paginatedTODOs:
type: object
properties:
data:
type: array
description: An array of TODOs
items:
$ref: "#/components/schemas/TODO"
totalCount:
type: integer
description: The total number of TODO, ignoring pagination parameters
requestBodies:
editTODO:
description: The DTO of a new TODO
content:
application/json:
schema:
oneOf:
- allOf:
- $ref: "#/components/schemas/TODOBase"
- type: object
properties:
newField:
type: string
description: The newField of the TODO
responses:
TODOResponse:
description: A TODO
content:
application/json:
schema:
$ref: "#/components/schemas/TODO"
TODOsResponse:
description: Returns a list of paginated TODOs _(for administration purposes)_.
content:
application/json:
schema:
$ref: "#/components/schemas/paginatedTODOs"
notFoundError:
description: The TODO was not found.
parameters:
limit:
name: limit
in: query
description: The maximum number of TODOs to return
required: false
schema:
type: number
offset:
name: offset
in: query
description: The number of TODOs to skip
required: false
schema:
type: number
id:
name: id
in: path
description: The id of the TODO
required: true
schema:
type: string
paths:
/:
get:
tags:
- TODOs
summary: Get a list of paginated TODOs
parameters:
- $ref: "#/components/parameters/limit"
- $ref: "#/components/parameters/offset"
responses:
"200":
$ref: "#/components/responses/TODOsResponse"
post:
tags:
- TODOs
summary: Creates a TODO
description: >
Creates a TODO. _Add optional description_.
requestBody:
$ref: "#/components/requestBodies/editTODO"
responses:
"201":
$ref: "#/components/responses/TODOResponse"
/{id}:
get:
tags:
- TODOs
summary: Get a TODO by its id
parameters:
- $ref: "#/components/parameters/id"
responses:
"200":
$ref: "#/components/responses/TODOResponse"
"404":
$ref: "#/components/responses/notFoundError"
put:
tags:
- TODOs
summary: Update a TODO by its id
parameters:
- $ref: "#/components/parameters/id"
requestBody:
$ref: "#/components/requestBodies/editTODO"
responses:
"200":
$ref: "#/components/responses/TODOResponse"
delete:
tags:
- TODOs
summary: Delete a TODO by its id
parameters:
- $ref: "#/components/parameters/id"
responses:
"204":
description: The TODO was deleted successfully