-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yaml
204 lines (203 loc) · 5.3 KB
/
swagger.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# this is an example of the Uber API
# as a demonstration of an API spec in YAML
swagger: '2.0'
info:
title: Pomodoro API
description: save your tasks with Pomodoro API
version: "1.0.0"
# the domain of the service
# TODO: set it to the real address, most likely localhost
host: api.pomodoro.com
# array of all schemes that your API supports
schemes:
- https
- http
# will be prefixed to all paths
basePath: /v1
consumes:
- application/json
produces:
- application/json
paths:
/pomodorotasks/all:
get:
summary: Pomodoro Tasks for a user
description: Returns all of the pomodoro tasks of a user.
parameters:
- name: user
in: query
description: uuid of the user
required: true
type: string
tags:
- Pomodoro
responses:
200:
description: An array of products
schema:
type: array
items:
$ref: '#/definitions/PomodoroTask'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/pomodorotasks/todo:
get:
summary: Pomodoro Tasks for a user
description: Returns pomodoro tasks from the todo list of a user.
parameters:
- name: user
in: query
description: uuid of the user
required: true
type: string
tags:
- Pomodoro
responses:
200:
description: An array of pomodoros
schema:
type: array
items:
$ref: '#/definitions/PomodoroTask'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/pomodorotasks/activity:
get:
summary: Pomodoro Tasks for a user
description: Returns pomodoro tasks from the activity list of a user.
parameters:
- name: user
in: query
description: uuid of the user
required: true
type: string
tags:
- Pomodoro
responses:
200:
description: An array of pomodoros
schema:
type: array
items:
$ref: '#/definitions/PomodoroTask'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/pomodorotasks:
get:
summary: Pomodoro Tasks for a user
description: Returns all of the pomodoro tasks of a user.
parameters:
- name: user
in: query
description: uuid of the user
required: true
type: string
tags:
- Pomodoro
responses:
200:
description: An array of products
schema:
type: array
items:
$ref: '#/definitions/PomodoroTask'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
post:
summary: Upload a pomodoro task
description: Upload a pomodoro task to the server. Returns the uploaded task.
parameters:
- name: pomodoro_task
in: body
description: pomodoro task to upload
required: true
schema:
$ref: '#/definitions/PomodoroTask'
tags:
- Pomodoro
responses:
200:
description: Success response
schema:
$ref: '#/definitions/PomodoroTask'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
delete:
summary: Delete a pomodoro task
description: Delete a pomodoro task to the server. Returns the deleted task.
parameters:
- name: pomodoro_task
in: body
description: pomodoro task to delete
required: true
schema:
$ref: '#/definitions/PomodoroTask'
tags:
- Pomodoro
responses:
200:
description: Success response
schema:
$ref: '#/definitions/PomodoroTask'
default:
description: Unexpected error
schema:
$ref: '#/definitions/Error'
definitions:
PomodoroTask:
type: object
properties:
id:
type: integer
format: int32
description: Unique identifier of a Pomodoro task
user_uuid:
type: string
description: Unique identifier of the owner of the Pomodoro
created_on:
type: string
format: date
description: The day the pomodoro task was created
finished_on:
type: string
format: date
description: The day the pomodoto task was finished
estimate1:
type: integer
format: int32
description: First estimate try
estimate2:
type: integer
format: int32
description: Second estimate try
estimate3:
type: integer
format: int32
description: Third estimate try
is_to_do_today:
type: boolean
description: Is the task int the todo today list?
pomodoros_done:
type: integer
format: int32
description: Number of completed pomodoros
Error:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
fields:
type: string