Skip to content

Commit e382807

Browse files
committed
Added security + users routes
1 parent 1f22a08 commit e382807

File tree

1 file changed

+103
-2
lines changed

1 file changed

+103
-2
lines changed

backend/schemas/swagger.yaml

Lines changed: 103 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,8 @@ paths:
319319
post:
320320
summary: Report a profile
321321
operationId: reportProfile
322+
security:
323+
- bearerAuth: [ ]
322324
tags:
323325
- Profile
324326
parameters:
@@ -362,6 +364,8 @@ paths:
362364
get:
363365
summary: View a profile
364366
operationId: viewProfile
367+
security:
368+
- bearerAuth: [ ]
365369
tags:
366370
- Profile
367371
parameters:
@@ -395,6 +399,8 @@ paths:
395399
get:
396400
summary: Get your profile views
397401
operationId: getProfileViews
402+
security:
403+
- bearerAuth: [ ]
398404
tags:
399405
- Profile
400406
responses:
@@ -421,6 +427,8 @@ paths:
421427
post:
422428
summary: Like a user
423429
operationId: likeUser
430+
security:
431+
- bearerAuth: [ ]
424432
tags:
425433
- Like
426434
parameters:
@@ -447,6 +455,8 @@ paths:
447455
post:
448456
summary: Unike a user
449457
operationId: unlikeUser
458+
security:
459+
- bearerAuth: [ ]
450460
tags:
451461
- Like
452462
parameters:
@@ -483,6 +493,8 @@ paths:
483493
get:
484494
summary: Get your likes
485495
operationId: getLikes
496+
security:
497+
- bearerAuth: [ ]
486498
tags:
487499
- Like
488500
responses:
@@ -516,6 +528,8 @@ paths:
516528
get:
517529
summary: Get your matches
518530
operationId: getMatches
531+
security:
532+
- bearerAuth: [ ]
519533
tags:
520534
- Match
521535
responses:
@@ -542,6 +556,8 @@ paths:
542556
get:
543557
summary: Get your open conversations
544558
operationId: getConversations
559+
security:
560+
- bearerAuth: [ ]
545561
tags:
546562
- Messages
547563
responses:
@@ -568,6 +584,8 @@ paths:
568584
post:
569585
summary: Send a message
570586
operationId: sendMessage
587+
security:
588+
- bearerAuth: [ ]
571589
tags:
572590
- Messages
573591
responses:
@@ -597,6 +615,8 @@ paths:
597615
get:
598616
summary: Get the messages between you and another user
599617
operationId: conversationWithUID
618+
security:
619+
- bearerAuth: [ ]
600620
tags:
601621
- Messages
602622
parameters:
@@ -634,6 +654,8 @@ paths:
634654
post:
635655
summary: Mark as seen all the latest messages
636656
operationId: seeMessagesWithUID
657+
security:
658+
- bearerAuth: [ ]
637659
tags:
638660
- Messages
639661
parameters:
@@ -668,6 +690,8 @@ paths:
668690
post:
669691
summary: Like a message
670692
operationId: likeMessage
693+
security:
694+
- bearerAuth: [ ]
671695
tags:
672696
- Messages
673697
parameters:
@@ -704,6 +728,8 @@ paths:
704728
post:
705729
summary: Unlike a message
706730
operationId: unlikeMessage
731+
security:
732+
- bearerAuth: [ ]
707733
tags:
708734
- Messages
709735
parameters:
@@ -740,6 +766,8 @@ paths:
740766
get:
741767
summary: Returns all the unseen messages
742768
operationId: unseenMessages
769+
security:
770+
- bearerAuth: [ ]
743771
tags:
744772
- Messages
745773
responses:
@@ -765,7 +793,9 @@ paths:
765793
/recommendations:
766794
get:
767795
summary: Get user recommendations
768-
operationId: getRecommendations
796+
operationId: getOnlineUsers
797+
security:
798+
- bearerAuth: [ ]
769799
tags:
770800
- Recommendations
771801
responses:
@@ -790,6 +820,66 @@ paths:
790820
type: array
791821
items:
792822
$ref: '#/components/schemas/Recommendation'
823+
/users:
824+
get:
825+
summary: Get all users
826+
operationId: getAllUsers
827+
security:
828+
- bearerAuth: [ ]
829+
tags:
830+
- User
831+
responses:
832+
"200":
833+
description: Returned list of users
834+
content:
835+
application/json:
836+
schema:
837+
type: array
838+
items:
839+
$ref: '#/components/schemas/User'
840+
/users/{uid}:
841+
get:
842+
summary: Get one user info.
843+
description: Get one user info. DOESNT ADD A VIEW
844+
operationId: getUser
845+
security:
846+
- bearerAuth: [ ]
847+
tags:
848+
- User
849+
parameters:
850+
- name: uid
851+
in: path
852+
required: true
853+
description: The id of the user to get ingo. Either username, email or id
854+
schema:
855+
type: string
856+
responses:
857+
"404":
858+
$ref: '#/components/responses/NotFound'
859+
"200":
860+
description: Returned user to view
861+
content:
862+
application/json:
863+
schema:
864+
$ref: '#/components/schemas/User'
865+
/users/online:
866+
get:
867+
summary: Get all online users
868+
description: Returns list of ids of online users
869+
operationId: getAllOnlineUsers
870+
security:
871+
- bearerAuth: [ ]
872+
tags:
873+
- User
874+
responses:
875+
"200":
876+
description: Returned list of online users
877+
content:
878+
application/json:
879+
schema:
880+
type: array
881+
items:
882+
$ref: '#/components/schemas/OnlineUser'
793883

794884

795885
servers:
@@ -1432,4 +1522,15 @@ components:
14321522
type: array
14331523
items:
14341524
$ref: '#/components/schemas/Tag'
1435-
uniqueItems: true
1525+
uniqueItems: true
1526+
OnlineUser:
1527+
type: object
1528+
properties:
1529+
id:
1530+
type: integer
1531+
description: The user id
1532+
example: 1
1533+
date_lastseen:
1534+
type: timestamp
1535+
description: Timestamp of last time the user was online
1536+
example: 1600332058.537065,

0 commit comments

Comments
 (0)