-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
152 lines (152 loc) · 4.01 KB
/
openapi.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
openapi: 3.0.3
info:
title: Backend Product
description: |-
This is Like micorservice for backend of **HRV-Mart**. This API will contains operations related to Like and have its own database. For more information, visit
contact:
email: harshverma3305@gmail.com
name: Harsh Verma
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 0.0.1
servers:
- url: http://localhost:8080
tags:
- name: like
description: Operations about like
paths:
/like:
post:
tags:
- like
summary: Add product to like
operationId: createLike
requestBody:
description: Like Operation
content:
application/json:
schema:
$ref: '#/components/schemas/Like'
application/xml:
schema:
$ref: '#/components/schemas/Like'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Like'
responses:
default:
description: Like added successfully
content:
application/json:
schema:
$ref: '#/components/schemas/Like'
application/xml:
schema:
$ref: '#/components/schemas/Like'
500:
description: Like already exist.
/like/{userId}:
get:
tags:
- like
summary: Get like products of user
description: 'Pageable'
operationId: getLikeOfUser
parameters:
- name: userId
in: path
description: The id that needs to be fetched. Use userId for testing.
required: true
schema:
type: string
- name: size
in: query
description: Requested page size. Default will be 10
required: false
- name: page
in: query
description: Requested page index. Default will be 0
required: false
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/LikePageable'
application/xml:
schema:
$ref: '#/components/schemas/LikePageable'
/like/{userId}/{productId}:
delete:
tags:
- like
summary: Remove like
operationId: deleteLike
parameters:
- name: userId
in: path
description: The userId that needs to be deleted
required: true
schema:
type: string
- name: productId
in: path
description: Like removed successfully
required: true
schema:
type: string
responses:
404:
description: Like nor found
get:
tags:
- like
summary: Give whether like exist in database of not
operationId: likeExistByUserIdAndProductId
parameters:
- name: userId
in: path
description: id of user who liked product
required: true
schema:
type: string
- name: productId
in: path
required: true
schema:
type: string
responses:
200:
description: Return true or false
components:
schemas:
Like:
type: object
properties:
userId:
type: string
example: 123456absc
description: This will be use as user Id.
productId:
type: string
example: 123456absc
description: This will be use as product Id.
xml:
name: product
LikePageable:
type: object
properties:
size:
type: number
example: 10
description: Maximum like object which can be retrieve from database
nextPage:
type: number
example: 2
description: Next page index if available else it will be null
data:
type: array
items:
type: object