-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathv1.yml
145 lines (135 loc) · 4.57 KB
/
v1.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
openapi: 3.0.0
info:
title: User service api
version: '1.0'
servers:
- url: 'http://localhost:8000'
description: Development
tags:
- name: users
- name: location
paths:
/users/:
get:
summary: Get a list of users in the specified radius, excluding the target user
tags:
- users
parameters:
- in: query
name: username
description: 4-16 symbols (a-zA-Z0-9 symbols are acceptable)
required: true
schema:
type: string
example: "User1"
- in: query
name: distance
description: radius (kilometers) of search area
required: true
schema:
type: integer
example: 150
responses:
'200':
description: List of users
content:
application/json:
schema:
properties:
result:
type: array
items:
type: string
example: "User1"
'400':
description: Incorrect input
content:
application/json:
schema:
properties:
errors:
description: all properties are optional, and will be shown depending which field contains the error
required:
- ...
properties:
username:
type: string
description: what is incorrect about the username
example: Username contains forbidden characters. Only letters and numbers allowed
distance:
type: string
description: what is incorrect about the distance
example: Distance must be an integer larger than zero
pagination:
properties:
offset:
type: string
example: Incorrect format. Integer values allowed
limit:
type: string
example: Incorrect format. Integer values allowed
'404':
description: Cannot find user
content:
application/json:
schema:
properties:
errors:
type: string
example: user doesn't exist
/location/:
post:
summary: Update a user's location
tags:
- location
requestBody:
required: true
content:
application/json:
schema:
properties:
username:
type: string
description: 4-16 symbols (a-zA-Z0-9 symbols are acceptable)
example: "User1"
longitude:
description: float64, range -180...180
type: number
example: 12.3456
latitude:
description: float64, range -90...90
type: number
example: -12.3456
responses:
'200':
description: successfully updated
content:
application/json:
schema:
properties:
success:
type: string
example: Your location has been updated
'400':
description: Incorrect input
content:
application/json:
schema:
properties:
errors:
description: all properties are optional, and will be shown depending which field contains the error
required:
- ...
properties:
username:
type: string
description: what is incorrect about the username
example: Username contains forbidden characters. Only letters and numbers allowed
longitude:
type: string
description: what is incorrect about the longitude
example: Longitude is incorrect. Values within -180 and 180 allowed
latitude:
type: string
description: what is incorrect about the latitude
example: Longitude is incorrect. Values within -90 and 90 allowed