-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
168 lines (168 loc) · 3.85 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
swagger: "2.0"
info:
description: "REST API to provide store and catalog data to Foodie client application."
version: "0.1.0"
title: "Foodie Ordering App API"
schemes:
- "https"
paths:
/api/stores:
get:
tags:
- "stores"
summary: "Return all stores"
description: "Return data from all stores in db"
operationId: "getStores"
produces:
- "application/json"
responses:
"200":
description: "Successfully return stores data"
schema:
type: "object"
properties:
stores:
type: "array"
items:
$ref: "#/definitions/Store"
"400":
description: "Bad request"
schema:
type: "object"
properties:
error:
type: "string"
/api/stores/byId:
get:
tags:
- "stores"
summary: "Return store by id"
description: "Return one specific store data based on id provided"
operationId: "getStoreDetails"
produces:
- "application/json"
parameters:
- name: "storeId"
in: "query"
description: "Store's id to get data"
required: true
type: "string"
responses:
"200":
description: "Successfully return store data"
schema:
type: "object"
properties:
store:
$ref: "#/definitions/Store"
"400":
description: "Bad request"
schema:
type: "object"
properties:
error:
type: "string"
/api/stores/create:
post:
tags:
- "stores"
summary: "Create store"
description: "Insert store data to db"
operationId: "addStore"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
description: "Request body of store data that need to be inserted into the db"
required: true
schema:
$ref: "#/definitions/Store"
responses:
"200":
description: "Successfully create and add store to db"
schema:
type: "object"
properties:
store:
$ref: "#/definitions/Store"
"400":
description: "Bad request"
schema:
type: "object"
properties:
error:
type: "string"
definitions:
Product:
type: "object"
properties:
_id:
type: "integer"
title:
type: "string"
description:
type: "string"
price:
type: "integer"
quantity:
type: "integer"
Catalog:
type: "object"
properties:
_id:
type: "integer"
category:
type: "string"
products:
type: "array"
items:
$ref: "#/definitions/Product"
Address:
type: "object"
properties:
_id:
type: "integer"
street:
type: "string"
region:
type: "string"
postal_code:
type: "string"
city:
type: "string"
Store:
type: "object"
properties:
_id:
type: "integer"
name:
type: "string"
description:
type: "string"
address:
$ref: "#/definitions/Address"
categories:
type: "array"
items:
type: "string"
rating:
type: "integer"
format: "double"
deliveryTimeRange:
type: "array"
items:
type: "integer"
minOrder:
type: "string"
isOpen:
type: "boolean"
catalog:
type: "array"
items:
$ref: "#/definitions/Catalog"
externalDocs:
description: "Find out more about Swagger"
url: "http://swagger.io"