-
Notifications
You must be signed in to change notification settings - Fork 1
/
openapi.yml
169 lines (164 loc) · 3.68 KB
/
openapi.yml
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
164
165
166
167
168
169
openapi: '3.0.3'
info:
version: 1.0.0
title: TODO MVC REST API
contact:
name: Antoine Cheron
email: cheron.antoine@gmail.com
paths:
/todos:
get:
summary: Get all the todos
operationId: listTodos
tags:
- todo
security:
- basicAuth: []
parameters:
- name: status
in: query
description: The status expected for the queried todos
required: false
schema:
type: string
enum:
- all
- completed
- active
default: all
responses:
'200':
description: List of todos
content:
application/json:
schema:
$ref: '#/components/schemas/TodoCollection'
delete:
summary: Delete the todos with the selected status, by default the completed todos
operationId: deleteTodosByStatus
tags:
- todo
parameters:
- name: status
in: query
description: The status expected for the queried todos
required: false
schema:
type: string
enum:
- all
- completed
- active
default: completed
security:
- basicAuth: []
responses:
'204':
description: Confirmation
/todo:
post:
summary: Create a new todo
operationId: createTodo
tags:
- todo
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TodoCreationRequest'
security:
- basicAuth: []
responses:
'201':
description: The newly created todo
content:
application/json:
schema:
$ref: '#/components/schemas/Todo'
/todo/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: string
put:
summary: Update an existing todo
operationId: updateTodo
tags:
- todo
security:
- basicAuth: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/TodoUpdateRequest'
responses:
'204':
description: Confirmation
delete:
summary: Delete the todo
operationId: deleteTodoById
tags:
- todo
security:
- basicAuth: []
responses:
'204':
description: Confirmation
components:
parameters:
status:
name: status
in: query
description: The status expected for the queried todos
required: false
schema:
type: string
enum:
- all
- completed
- active
securitySchemes:
basicAuth:
type: http
scheme: basic
description: Basic login/password http authentication
schemas:
TodoCollection:
type: object
properties:
todos:
$ref: '#/components/schemas/Todos'
Todos:
type: array
items:
$ref: '#/components/schemas/Todo'
Todo:
type: object
required: ['id', 'title', 'completed']
properties:
id:
type: string
title:
type: string
minLength: 1
completed:
type: boolean
TodoCreationRequest:
type: object
required: ['title']
properties:
title:
type: string
minLength: 1
TodoUpdateRequest:
type: object
required: ['title', 'completed']
properties:
title:
type: string
minLength: 1
completed:
type: boolean