-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathv1.yml
95 lines (87 loc) · 2.92 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
openapi: 3.0.0
info:
title: Locations service api
version: '1.0'
servers:
- url: 'http://localhost:8001'
description: Development
tags:
- name: distance
paths:
/distance/:
get:
summary: Total distance calculated by user's locations
tags:
- distance
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: after
description: |
Follows "gte" filter logic. ISO 8601 (RFC3339) format of datetime.
Must be greater than "before" field. Default value - 24 hours ago.
required: false
schema:
type: string
pattern: RFC(3339)
example: "2021-09-02T11:26:18+00:00"
- in: query
name: before
description: |
Follows "lte" filter logic. ISO 8601 (RFC3339) format of datetime.
Must be less than "after" field. Default value - now.
required: false
schema:
type: string
pattern: RFC(3339)
example: "2021-09-02T11:26:18+00:00"
responses:
'200':
description: Total distance
content:
application/json:
schema:
properties:
distance:
type: integer
example: 773
'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 username
example: Username contains forbidden characters. Only letters and numbers allowed
before:
type: string
description: what is incorrect about "before" field
example: incorrect format. ISO 8601 allowed
after:
type: string
description: what is incorrect about "after" field
example: Time label 'Before' follows 'After'
'404':
description: Cannot find enough locations to calculate distance
content:
application/json:
schema:
properties:
errors:
properties:
distance:
type: string
example: not enough Locations to calculate distance