-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtodo-backend.yaml
147 lines (146 loc) · 3.49 KB
/
todo-backend.yaml
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
openapi: 3.0.1
info:
title: Todo Backend
version: "1.0"
servers:
- url: http://localhost:8080
paths:
/:
get:
summary: Redirect page to load the user interface
operationId: redirect
responses:
200:
description: OK
content:
'*/*': {}
/api:
get:
summary: Get the list of all Todos
operationId: todoGetAll
responses:
200:
description: List of all Todos
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Todo'
post:
summary: Create a new todo
operationId: todoCreate
requestBody:
description: The todo to create
content:
application/json:
schema:
$ref: '#/components/schemas/Todo'
responses:
201:
description: The created Todo
content:
application/json:
schema:
$ref: '#/components/schemas/Todo'
delete:
summary: Delete the all todos that are completed
operationId: todoDeleteCompleted
responses:
204:
description: No content
options:
summary: Get the options
operationId: todoOpt
responses:
200:
description: OK
content:
application/json: {}
/api/{id}:
get:
summary: Get one todo
operationId: todoGetOne
parameters:
- name: id
in: path
description: The id of the todo
required: true
schema:
format: int64
type: integer
example: 42
responses:
200:
description: The requested Todo
content:
application/json:
schema:
$ref: '#/components/schemas/Todo'
delete:
summary: Delete one todo
operationId: todoDeleteOne
parameters:
- name: id
in: path
description: The id of the todo
required: true
schema:
format: int64
type: integer
example: 42
responses:
204:
description: No content
patch:
summary: Update an existing todo
operationId: todoUpdate
parameters:
- name: id
in: path
description: The id of the todo
required: true
schema:
format: int64
type: integer
example: 42
requestBody:
description: The todo to update
content:
application/json:
schema:
$ref: '#/components/schemas/Todo'
responses:
200:
description: The updated Todo
content:
application/json:
schema:
$ref: '#/components/schemas/Todo'
components:
schemas:
Todo:
description: Object representing a Todo
type: object
properties:
id:
description: id of the entity
format: int64
type: integer
example: 42
title:
description: title of the todo
type: string
example: My task
completed:
description: whether the todo is completed or not
type: boolean
example: false
url:
description: url associated with the todo
type: string
order:
format: int32
description: order in the priority list
type: integer
example: 10