Skip to content

Commit af4366a

Browse files
committed
Updated doc
1 parent 19762d6 commit af4366a

File tree

1 file changed

+299
-38
lines changed

1 file changed

+299
-38
lines changed

backend/schemas/swagger.yaml

Lines changed: 299 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -351,27 +351,154 @@ paths:
351351
message:
352352
type: string
353353
example: Profile completed !
354-
/profile/edit:
355-
put:
354+
/profile/edit/first_name:
355+
patch:
356+
tags:
357+
- Profile
358+
summary: Edit first name of user
359+
description: ""
360+
operationId: editProfileFirstName
361+
security:
362+
- bearerAuth: []
363+
requestBody:
364+
description: Parameters to edit first name
365+
required: true
366+
content:
367+
application/json:
368+
schema:
369+
type: object
370+
properties:
371+
first_name:
372+
type: string
373+
example: Foo
374+
responses:
375+
"409":
376+
$ref: "#/components/responses/BadRequest"
377+
"200":
378+
description: First name edited successfully
379+
content:
380+
application/json:
381+
schema:
382+
type: object
383+
properties:
384+
success:
385+
type: boolean
386+
description: If the request is a success
387+
example: true
388+
code:
389+
type: integer
390+
description: The status code
391+
example: 200
392+
message:
393+
type: string
394+
example: First name successfully modified !
395+
/profile/edit/last_name:
396+
patch:
397+
tags:
398+
- Profile
399+
summary: Edit last name of user
400+
description: ""
401+
operationId: editProfileLastName
402+
security:
403+
- bearerAuth: []
404+
requestBody:
405+
description: Parameters to edit last name
406+
required: true
407+
content:
408+
application/json:
409+
schema:
410+
type: object
411+
properties:
412+
last_name:
413+
type: string
414+
example: Bar
415+
responses:
416+
"409":
417+
$ref: "#/components/responses/BadRequest"
418+
"200":
419+
description: Last name edited successfully
420+
content:
421+
application/json:
422+
schema:
423+
type: object
424+
properties:
425+
success:
426+
type: boolean
427+
description: If the request is a success
428+
example: true
429+
code:
430+
type: integer
431+
description: The status code
432+
example: 200
433+
message:
434+
type: string
435+
example: Last name successfully modified !
436+
/profile/edit/username:
437+
patch:
438+
tags:
439+
- Profile
440+
summary: Edit username of user
441+
description: ""
442+
operationId: editProfileUsername
443+
security:
444+
- bearerAuth: []
445+
requestBody:
446+
description: Parameters to edit username
447+
required: true
448+
content:
449+
application/json:
450+
schema:
451+
type: object
452+
properties:
453+
username:
454+
type: string
455+
example: FooBar
456+
responses:
457+
"409":
458+
$ref: "#/components/responses/BadRequest"
459+
"200":
460+
description: Username edited successfully
461+
content:
462+
application/json:
463+
schema:
464+
type: object
465+
properties:
466+
success:
467+
type: boolean
468+
description: If the request is a success
469+
example: true
470+
code:
471+
type: integer
472+
description: The status code
473+
example: 200
474+
message:
475+
type: string
476+
example: Username successfully modified !
477+
/profile/edit/bio:
478+
patch:
356479
tags:
357480
- Profile
358-
summary: Edit user profile
481+
summary: Edit bio of user
359482
description: ""
360-
operationId: editProfile
483+
operationId: editProfileBio
361484
security:
362485
- bearerAuth: []
363486
requestBody:
364-
description: Parameters to edit profile
487+
description: Parameters to edit bio
365488
required: true
366489
content:
367490
application/json:
368491
schema:
369-
$ref: '#/components/schemas/EditProfile'
492+
type: object
493+
properties:
494+
bio:
495+
type: string
496+
example: Lorem ipsum...
370497
responses:
371498
"409":
372499
$ref: "#/components/responses/BadRequest"
373500
"200":
374-
description: Profile edited successfully
501+
description: Bio edited successfully
375502
content:
376503
application/json:
377504
schema:
@@ -387,7 +514,171 @@ paths:
387514
example: 200
388515
message:
389516
type: string
390-
example: User successfully modified !
517+
example: Bio successfully modified !
518+
/profile/edit/gender:
519+
patch:
520+
tags:
521+
- Profile
522+
summary: Edit gender of user
523+
description: ""
524+
operationId: editProfileGender
525+
security:
526+
- bearerAuth: []
527+
requestBody:
528+
description: Parameters to edit gender
529+
required: true
530+
content:
531+
application/json:
532+
schema:
533+
type: object
534+
properties:
535+
gender:
536+
type: string
537+
example: male
538+
description: One of male, female or other
539+
responses:
540+
"409":
541+
$ref: "#/components/responses/BadRequest"
542+
"200":
543+
description: Gender edited successfully
544+
content:
545+
application/json:
546+
schema:
547+
type: object
548+
properties:
549+
success:
550+
type: boolean
551+
description: If the request is a success
552+
example: true
553+
code:
554+
type: integer
555+
description: The status code
556+
example: 200
557+
message:
558+
type: string
559+
example: Gender successfully modified !
560+
/profile/edit/orientation:
561+
patch:
562+
tags:
563+
- Profile
564+
summary: Edit orientation of user
565+
description: ""
566+
operationId: editProfileOrientation
567+
security:
568+
- bearerAuth: []
569+
requestBody:
570+
description: Parameters to edit orientation
571+
required: true
572+
content:
573+
application/json:
574+
schema:
575+
type: object
576+
properties:
577+
orientation:
578+
type: string
579+
example: heterosexual
580+
description: One of heterosexual, homosexual, bisexual or other.
581+
responses:
582+
"409":
583+
$ref: "#/components/responses/BadRequest"
584+
"200":
585+
description: Orientation edited successfully
586+
content:
587+
application/json:
588+
schema:
589+
type: object
590+
properties:
591+
success:
592+
type: boolean
593+
description: If the request is a success
594+
example: true
595+
code:
596+
type: integer
597+
description: The status code
598+
example: 200
599+
message:
600+
type: string
601+
example: Orientation successfully modified !
602+
/profile/edit/birthdate:
603+
patch:
604+
tags:
605+
- Profile
606+
summary: Edit birthdate of user
607+
description: ""
608+
operationId: editProfileBirthdate
609+
security:
610+
- bearerAuth: []
611+
requestBody:
612+
description: Parameters to edit birthdate
613+
required: true
614+
content:
615+
application/json:
616+
schema:
617+
type: object
618+
properties:
619+
birthdate:
620+
type: string
621+
example: 06/04/1998
622+
description: Must be formatted as 'day/month/year'
623+
responses:
624+
"409":
625+
$ref: "#/components/responses/BadRequest"
626+
"200":
627+
description: Birthdate edited successfully
628+
content:
629+
application/json:
630+
schema:
631+
type: object
632+
properties:
633+
success:
634+
type: boolean
635+
description: If the request is a success
636+
example: true
637+
code:
638+
type: integer
639+
description: The status code
640+
example: 200
641+
message:
642+
type: string
643+
example: Birthdate successfully modified !
644+
/profile/edit/tags:
645+
patch:
646+
tags:
647+
- Profile
648+
summary: Edit tags of user
649+
description: ""
650+
operationId: editProfileTags
651+
security:
652+
- bearerAuth: []
653+
requestBody:
654+
description: Parameters to edit tags
655+
required: true
656+
content:
657+
application/json:
658+
schema:
659+
type: array
660+
example: ["food", "netflix"]
661+
responses:
662+
"409":
663+
$ref: "#/components/responses/BadRequest"
664+
"200":
665+
description: Tags edited successfully
666+
content:
667+
application/json:
668+
schema:
669+
type: object
670+
properties:
671+
success:
672+
type: boolean
673+
description: If the request is a success
674+
example: true
675+
code:
676+
type: integer
677+
description: The status code
678+
example: 200
679+
message:
680+
type: string
681+
example: Tags successfully modified !
391682
/profile/report/{uid}:
392683
post:
393684
summary: Report a profile
@@ -1425,36 +1716,6 @@ components:
14251716
tags:
14261717
type: array
14271718
example: ["food", "sex", "drugs"]
1428-
EditProfile:
1429-
type: object
1430-
properties:
1431-
first_name:
1432-
type: string
1433-
example: Foo
1434-
last_name:
1435-
type: string
1436-
example: Bar
1437-
username:
1438-
type: string
1439-
example: FooBar
1440-
gender:
1441-
type: string
1442-
enum: ["male", "female", "other"]
1443-
example: male
1444-
birthdate:
1445-
type: date
1446-
example: 06/04/1998
1447-
description: Formatted as DAY/MONTH/YEAR
1448-
orientation:
1449-
type: string
1450-
enum: ["heterosexual", "homosexual", "bisexual", "other"]
1451-
example: other
1452-
bio:
1453-
type: string
1454-
example: I like running around on horses
1455-
tags:
1456-
type: array
1457-
example: ["food", "sex", "drugs"]
14581719
ReportProfile:
14591720
type: object
14601721
properties:

0 commit comments

Comments
 (0)