|
16 | 16 | tags: |
17 | 17 | - name: Authentication |
18 | 18 | description: Login and register routes |
19 | | - - name: Complete Profile |
20 | | - - name: Edit Profile |
21 | | - - name: Report Profile |
22 | | - - name: View Profile |
| 19 | + - name: Profile |
23 | 20 | - name: Like |
24 | 21 | description: Like, unlike user etc... |
25 | 22 | - name: Match |
@@ -246,7 +243,7 @@ paths: |
246 | 243 | /profile/complete: |
247 | 244 | post: |
248 | 245 | tags: |
249 | | - - Complete Profile |
| 246 | + - Profile |
250 | 247 | summary: Complete user profile |
251 | 248 | description: "" |
252 | 249 | operationId: completeProfile |
@@ -280,6 +277,86 @@ paths: |
280 | 277 | message: |
281 | 278 | type: string |
282 | 279 | example: Profile completed ! |
| 280 | + /profile/edit: |
| 281 | + post: |
| 282 | + tags: |
| 283 | + - Profile |
| 284 | + summary: Edit user profile |
| 285 | + description: "" |
| 286 | + operationId: editProfile |
| 287 | + security: |
| 288 | + - bearerAuth: [] |
| 289 | + requestBody: |
| 290 | + description: Parameters to edit profile |
| 291 | + required: true |
| 292 | + content: |
| 293 | + application/json: |
| 294 | + schema: |
| 295 | + $ref: '#/components/schemas/EditProfile' |
| 296 | + responses: |
| 297 | + "409": |
| 298 | + $ref: "#/components/responses/BadRequest" |
| 299 | + "200": |
| 300 | + description: Profile edited successfully |
| 301 | + content: |
| 302 | + application/json: |
| 303 | + schema: |
| 304 | + type: object |
| 305 | + properties: |
| 306 | + success: |
| 307 | + type: boolean |
| 308 | + description: If the request is a success |
| 309 | + example: true |
| 310 | + code: |
| 311 | + type: integer |
| 312 | + description: The status code |
| 313 | + example: 200 |
| 314 | + message: |
| 315 | + type: string |
| 316 | + example: User successfully modified ! |
| 317 | + /profile/report/{uid}: |
| 318 | + post: |
| 319 | + summary: Report a profile |
| 320 | + operationId: reportProfile |
| 321 | + tags: |
| 322 | + - Profile |
| 323 | + parameters: |
| 324 | + - name: uid |
| 325 | + in: path |
| 326 | + required: true |
| 327 | + description: The id of the user to report. Either username, email or id |
| 328 | + schema: |
| 329 | + type: string |
| 330 | + requestBody: |
| 331 | + description: Parameters to report profile |
| 332 | + required: true |
| 333 | + content: |
| 334 | + application/json: |
| 335 | + schema: |
| 336 | + $ref: '#/components/schemas/ReportProfile' |
| 337 | + responses: |
| 338 | + "400": |
| 339 | + $ref: '#/components/responses/BadRequest' |
| 340 | + "404": |
| 341 | + $ref: '#/components/responses/NotFound' |
| 342 | + "200": |
| 343 | + description: Report created successfully |
| 344 | + content: |
| 345 | + application/json: |
| 346 | + schema: |
| 347 | + type: object |
| 348 | + properties: |
| 349 | + success: |
| 350 | + type: boolean |
| 351 | + description: If the request is a success |
| 352 | + example: true |
| 353 | + code: |
| 354 | + type: integer |
| 355 | + description: The status code |
| 356 | + example: 200 |
| 357 | + message: |
| 358 | + type: string |
| 359 | + example: Report created on user {email_adress}. |
283 | 360 |
|
284 | 361 | servers: |
285 | 362 | - url: https://api.matcha.com |
@@ -377,6 +454,36 @@ components: |
377 | 454 | type: string |
378 | 455 | solution: |
379 | 456 | type: string |
| 457 | + NotFound: |
| 458 | + description: Not Found error |
| 459 | + content: |
| 460 | + application/json: |
| 461 | + schema: |
| 462 | + type: object |
| 463 | + properties: |
| 464 | + code: |
| 465 | + type: string |
| 466 | + example: 401 |
| 467 | + default: 401 |
| 468 | + success: |
| 469 | + type: boolean |
| 470 | + default: false |
| 471 | + example: false |
| 472 | + error: |
| 473 | + type: object |
| 474 | + properties: |
| 475 | + type: |
| 476 | + type: string |
| 477 | + default: NotFoundError |
| 478 | + example: NotFoundError |
| 479 | + name: |
| 480 | + type: string |
| 481 | + default: NotFound Error |
| 482 | + example: NotFound Error |
| 483 | + message: |
| 484 | + type: string |
| 485 | + solution: |
| 486 | + type: string |
380 | 487 |
|
381 | 488 | securitySchemes: |
382 | 489 | accessToken: |
@@ -437,3 +544,40 @@ components: |
437 | 544 | tags: |
438 | 545 | type: array |
439 | 546 | example: ["food", "sex", "drugs"] |
| 547 | + EditProfile: |
| 548 | + type: object |
| 549 | + properties: |
| 550 | + first_name: |
| 551 | + type: string |
| 552 | + example: Foo |
| 553 | + last_name: |
| 554 | + type: string |
| 555 | + example: Bar |
| 556 | + username: |
| 557 | + type: string |
| 558 | + example: FooBar |
| 559 | + gender: |
| 560 | + type: string |
| 561 | + enum: ["male", "female", "other"] |
| 562 | + birthdate: |
| 563 | + type: date |
| 564 | + example: 06/04/1998 |
| 565 | + description: Formatted as DAY/MONTH/YEAR |
| 566 | + orientation: |
| 567 | + type: string |
| 568 | + enum: ["heterosexual", "homosexual", "bisexual", "other"] |
| 569 | + bio: |
| 570 | + type: string |
| 571 | + example: I like running around on horses |
| 572 | + tags: |
| 573 | + type: array |
| 574 | + example: ["food", "sex", "drugs"] |
| 575 | + ReportProfile: |
| 576 | + type: object |
| 577 | + properties: |
| 578 | + reason: |
| 579 | + type: string |
| 580 | + enum: ["harassment", "bot", "spam", "inappropriate content"] |
| 581 | + details: |
| 582 | + type: string |
| 583 | + example: He spammed me of dick pics |
0 commit comments