-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSwaggerDocumentation.txt
More file actions
231 lines (225 loc) · 6.39 KB
/
SwaggerDocumentation.txt
File metadata and controls
231 lines (225 loc) · 6.39 KB
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
openapi: 3.0.3
info:
title: Authentication API
description: |-
API for user registration, login, logout, user profile management, delete user account and money transfer.
termsOfService: http://swagger.io/terms/
contact:
email: 4messijess4@gmail.com
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.11
servers:
- url: https://currencyconverter-taw1-e14f133897db.herokuapp.com/
description: Re API Project
tags:
- name: Auth JWT
description: API for user registration, login, logout, delete user account and user profile management
- name: ETC
description: Money transfer
paths:
/signup:
post:
tags:
- Auth JWT
summary: Create a new user account
description: Creates a new user account with the provided credentials.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
email:
type: string
format: email
password:
type: string
minLength: 6
name:
type: string
surname:
type: string
phone:
type: string
responses:
'201':
description: User account created successfully
content:
application/json:
schema:
type: object
properties:
user:
type: string
description: The ID of the newly created user
'400':
description: Bad request, invalid input data
content:
application/json:
schema:
type: object
properties:
errors:
type: object
description: Object containing error messages for each field
/signin:
post:
tags:
- Auth JWT
summary: Authenticate user
description: Authenticates user with provided email and password.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
email:
type: string
format: email
password:
type: string
minLength: 6
responses:
'200':
description: User authenticated successfully
content:
application/json:
schema:
type: object
properties:
user:
type: string
description: The ID of the authenticated user
'400':
description: Bad request, invalid input data
content:
application/json:
schema:
type: object
properties:
errors:
type: object
description: Object containing error messages for each field
'401':
description: Unauthorized, invalid credentials
/logout:
get:
tags:
- Auth JWT
summary: Log out user
description: Logs out the currently authenticated user.
responses:
'200':
description: User logged out successfully
'401':
description: Unauthorized, user not logged in
/update-profile:
put:
tags:
- Auth JWT
summary: Update user profile
description: Update user profile information such as name, surname, phone, email, and password.
security:
- cookieAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
surname:
type: string
phone:
type: string
email:
type: string
format: email
newPassword:
type: string
minLength: 6
responses:
'200':
description: Profile updated successfully
'400':
description: Bad request, invalid input data
content:
application/json:
schema:
type: object
properties:
errors:
type: object
description: Object containing error messages for each field
'401':
description: Unauthorized, user not logged in
/delete-account:
delete:
tags:
- Auth JWT
summary: Delete user account
description: Deletes the user account and all associated data.
security:
- cookieAuth: []
responses:
'200':
description: Account deleted successfully
'401':
description: Unauthorized, user not logged in
/send-money:
post:
tags:
- ETC
summary: Send money to another user
description: Allows the authenticated user to send money to another user's wallet.
security:
- cookieAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
email:
type: string
format: email
amount:
type: number
currency:
type: string
enum: [PLN, UAH, USD, EUR]
responses:
'200':
description: Money sent successfully
'400':
description: Bad request, invalid input data
content:
application/json:
schema:
type: object
properties:
errors:
type: object
description: Object containing error messages for each field
'401':
description: Unauthorized, user not logged in
'404':
description: Not Found, recipient user not found
'409':
description: Conflict, same email as sender
security:
- cookieAuth: []
components:
securitySchemes:
cookieAuth:
type: apiKey
in: cookie
name: jwt