-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
103 lines (103 loc) · 2.14 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
consumes:
- application/json
definitions:
Product:
properties:
createdAt:
type: string
x-go-name: CreatedAt
description:
type: string
x-go-name: Description
id:
description: the id of the product
format: int64
minimum: 1
type: integer
x-go-name: ID
name:
type: string
x-go-name: Name
price:
description: product price in cents
format: int64
minimum: 0
type: integer
x-go-name: Price
sku:
type: string
x-go-name: SKU
updatedAt:
type: string
x-go-name: UpdatedAt
required:
- id
- price
type: object
x-go-package: github.com/chrischenyc/microservices-in-go/ep-07/data
info:
description: Package classification of Product API
version: 1.0.0
paths:
/products:
get:
description: Returns a list of products
operationId: list
responses:
"200":
$ref: '#/responses/productsResponse'
tags:
- products
post:
description: Create a product
operationId: create
responses:
"202":
$ref: '#/responses/noContent'
tags:
- products
/products/{id}:
delete:
description: Delete a product by its id
operationId: delete
parameters:
- description: The id of the product
format: int64
in: path
name: id
required: true
type: integer
x-go-name: ID
responses:
"202":
$ref: '#/responses/noContent'
tags:
- products
put:
description: Update a product by its id
operationId: update
parameters:
- description: The id of the product
format: int64
in: path
name: id
required: true
type: integer
x-go-name: ID
responses:
"202":
$ref: '#/responses/noContent'
tags:
- products
produces:
- application/json
responses:
productsResponse:
description: ""
schema:
items:
$ref: '#/definitions/Product'
type: array
schemes:
- http
swagger: "2.0"