forked from alexbrahastoll/oas-db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecommerce.yml
150 lines (150 loc) · 3.86 KB
/
ecommerce.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
146
147
148
149
150
openapi: 3.0.0
info:
version: 1.0.0
title: Ecommerce
license:
name: MIT
servers:
- url: http://example.com/v1/api
paths:
/orders:
get:
summary: List all orders of the authenticated user.
operationId: list_orders
tags:
- orders
responses:
200:
description: An array of orders
content:
application/json:
schema:
$ref: "#/components/schemas/Orders"
/orders/{order_id}:
post:
summary: Shows a given order.
operationId: show_order
tags:
- orders
parameters:
- name: order_id
in: path
required: true
description: The id of an order.
schema:
type: integer
responses:
200:
description: Details of an order.
content:
application/json:
schema:
$ref: "#/components/schemas/Order"
/orders/{order_id}/items/{item_id}:
get:
summary: Shows an item of a given order.
operationId: show_item
tags:
- items
parameters:
- name: order_id
in: path
required: true
description: The id of an order.
schema:
type: integer
- name: item_id
in: path
required: true
description: The id of an item.
schema:
type: integer
responses:
200:
description: An item belonging to an order.
content:
application/json:
schema:
$ref: "#/components/schemas/Item"
/customers/{customer_token}:
get:
summary: Allows a partner to fetch profile info from a customer it has sold at least one product to.
operationId: show_customer_by_token
tags:
- customer
parameters:
- name: customer_token
in: path
required: true
description: A token that identifies a customer and gives access to its information.
schema:
type: string
responses:
200:
description: Profile information of a customer.
content:
application/json:
schema:
$ref: "#/components/schemas/Customer"
components:
schemas:
Order:
description: An order.
required:
- id
- name
properties:
id:
description: The unique identifier of an order.
type: integer
format: int64
name:
description: The name of an order.
type: string
tag:
description: The tag of an order.
type: string
Orders:
description: A collection of orders.
type: array
items:
$ref: "#/components/schemas/Order"
Item:
description: An item (e.g. instances of a product or service) belonging to an order.
required:
- id
- name
- qty
- price
properties:
id:
description: The unique identifier of an item.
type: integer
format: int64
name:
description: The name of an item.
type: string
qty:
description: The number of items of this kind included in the order.
type: integer
format: int64
price:
description: The price of each unity of this item.
type: number
format: float
Customer:
description: Profile information of a customer.
required:
- name
- date_of_birth
- email
properties:
name:
description: The full name of a customer.
type: string
date_of_birth:
description: "The data of birth of a customer. Format: mm-dd-yyyy"
type: string
email:
description: The email of a customer.
type: string