-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
165 lines (165 loc) · 4.41 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
153
154
155
156
157
158
159
160
161
162
163
164
165
openapi: 3.0.3
info:
title: Backend Review
description: |-
This is Review micorservice for backend of **HRV-Mart**. This API will contains operations related to Review and have its own database. For more information, visit
contact:
email: harshverma3305@gmail.com
name: Harsh Verma
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
version: 0.0.1
servers:
- url: http://localhost:8080
tags:
- name: review
description: Operations about review
paths:
/review:
post:
tags:
- review
summary: Create review
description: This operation is not meant to be expose publicly.
operationId: createReview
requestBody:
description: Created review object
content:
application/json:
schema:
$ref: '#/components/schemas/Review'
application/xml:
schema:
$ref: '#/components/schemas/Review'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Review'
responses:
default:
description: Review created successfully
'500':
description: Review already exist
/review?userId={userId}&productId={productId}&page={page}&size={size}:
get:
tags:
- review
summary: Get review by reviewId
description: ''
operationId: getReview
parameters:
- name: userId
in: path
description: userId of user
example: userId1
required: false
schema:
type: string
- name: productId
in: path
description: productId of product
example: productId1
required: false
schema:
type: string
- name: page
in: path
description: page index
example: 0
required: false
schema:
type: number
- name: size
in: path
description: pge size
example: 10
required: false
schema:
type: number
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ReviewPageable'
application/xml:
schema:
$ref: '#/components/schemas/ReviewPageable'
'404':
description: Review not found
/review/{userId}/{productId}:
delete:
tags:
- review
summary: Delete review
operationId: deleteUser
parameters:
- name: userId
in: path
description: The userId of user
required: true
schema:
type: string
- name: productId
in: path
description: The productId of product
required: true
schema:
type: string
responses:
default:
description: Review deleted successfully
'404':
description: Review not found
components:
schemas:
ReviewResponse:
type: object
properties:
review:
type: object
description: Review Object
user:
type: object
description: User Object. For more information, checkout [Backend-User](https://github.com/HRV-Mart/Backend-User)
Review:
type: object
properties:
userId:
type: string
example: userId1
description: This will be use as userID.
productId:
type: string
example: productId1
description: This will be use as productId.
title:
type: string
example: Test Review
images:
type: array
items:
type: string
example: [https://image.test.com/1, https://image.test.com/2]
description:
type: string
example: Test Description
xml:
name: review
ReviewPageable:
type: object
properties:
size:
type: number
example: 10
description: Maximum review 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
description: Get ReviewResponse object