-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yaml
138 lines (130 loc) · 3.46 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
openapi: 3.0.0
info:
description: Minsk tours ticket shop API
version: 1.3.0
title: Minsk tours ticket shop API
contact:
email: ilya_kushlianski@epam.com
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
servers:
- url: "https://dspss0mtn2.execute-api.eu-west-1.amazonaws.com/{basePath}"
description: API Gateway API. Currently, only 'dev' stage is supported
variables:
basePath:
default: "dev"
enum:
- dev
- qa
- prod
# Added by API Auto Mocking Plugin
- description: SwaggerHub API Auto Mocking
url: https://virtserver.swaggerhub.com/ikushlianski/minsk-tours-api/1.0.0
tags:
- name: product
description: Store's products section
paths:
'/products':
get:
tags:
- product
summary: Get all products
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
'500':
description: Internal server error
post:
tags:
- product
summary: Create new product
requestBody:
description: Attributes required to create a product
required: true
content:
application/json:
schema:
type: object
properties:
title:
type: string
description:
type: string
price:
type: number
count:
type: number
required:
- title
- price
- count
responses:
'201':
description: Created
content:
application/json:
schema:
type: object
properties:
id:
type: string
format: uuidv4
example: "eeaf9772-f6b2-4896-b569-3f5a2b30dc4d"
'400':
description: Bad request. Body structure does not match the one that's expected
'500':
description: Internal server error
'/products/{productId}':
get:
tags:
- product
summary: Find product by ID
description: Returns a single product
parameters:
- name: productId
in: path
description: 'ID of product to return: 1, 2, 3 etc. Values over 5 do not exist in mock database'
required: true
schema:
type: string
format: uuid
example: 'eeaf9772-f6b2-4896-b569-3f5a2b30dc4d'
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
'404':
description: Product not found
'422':
description: Invalid ID supplied
'500':
description: Internal server error
components:
schemas:
Product:
type: object
properties:
id:
type: string
format: uuid
example: 'eeaf9772-f6b2-4896-b569-3f5a2b30dc4d'
title:
type: string
example: Some title
description:
type: string
example: Some longer description
price:
type: number
example: 50
count:
type: number
example: 15