@@ -416,6 +416,101 @@ paths:
416416 type : array
417417 items :
418418 $ref : ' #/components/schemas/View'
419+ /like/{uid} :
420+ post :
421+ summary : Like a user
422+ operationId : likeUser
423+ tags :
424+ - Like
425+ parameters :
426+ - name : uid
427+ in : path
428+ required : true
429+ description : The id of the user to like. Either username, email or id
430+ schema :
431+ type : string
432+ responses :
433+ " 400 " :
434+ $ref : ' #/components/responses/BadRequest'
435+ " 404 " :
436+ $ref : ' #/components/responses/NotFound'
437+ " 200 " :
438+ description : Like user successfully
439+ content :
440+ application/json :
441+ schema :
442+ oneOf :
443+ - $ref : ' #/components/schemas/LikedUser'
444+ - $ref : ' #/components/schemas/MatchedUser'
445+ /unlike/{uid} :
446+ post :
447+ summary : Unike a user
448+ operationId : unlikeUser
449+ tags :
450+ - Like
451+ parameters :
452+ - name : uid
453+ in : path
454+ required : true
455+ description : The id of the user to unlike. Either username, email or id
456+ schema :
457+ type : string
458+ responses :
459+ " 400 " :
460+ $ref : ' #/components/responses/BadRequest'
461+ " 404 " :
462+ $ref : ' #/components/responses/NotFound'
463+ " 200 " :
464+ description : Unlike successfull
465+ content :
466+ application/json :
467+ schema :
468+ type : object
469+ properties :
470+ success :
471+ type : boolean
472+ description : If the request is a success
473+ example : true
474+ code :
475+ type : integer
476+ description : The status code
477+ example : 200
478+ message :
479+ type : string
480+ example : Unliked user X.
481+ /likes :
482+ get :
483+ summary : Get your likes
484+ operationId : getLikes
485+ tags :
486+ - Like
487+ responses :
488+ " 200 " :
489+ description : Returned list of likes
490+ content :
491+ application/json :
492+ schema :
493+ type : object
494+ properties :
495+ success :
496+ type : boolean
497+ description : If the request is a success
498+ example : true
499+ code :
500+ type : integer
501+ description : The status code
502+ example : 200
503+ likes :
504+ type : object
505+ properties :
506+ sent :
507+ type : array
508+ items :
509+ $ref : ' #/components/schemas/Like'
510+ received :
511+ type : array
512+ items :
513+ $ref : ' #/components/schemas/Like'
419514
420515servers :
421516 - url : https://api.matcha.com
@@ -822,4 +917,32 @@ components:
822917 viewer_id :
823918 type : string
824919 example : 3
825- description : The user id to who viewed the profile
920+ description : The user id to who viewed the profile
921+ LikedUser :
922+ type : object
923+ properties :
924+ success :
925+ type : boolean
926+ description : If the request is a success
927+ example : true
928+ code :
929+ type : integer
930+ description : The status code
931+ example : 200
932+ message :
933+ type : string
934+ example : Liked user.
935+ MatchedUser :
936+ type : object
937+ properties :
938+ success :
939+ type : boolean
940+ description : If the request is a success
941+ example : true
942+ code :
943+ type : integer
944+ description : The status code
945+ example : 200
946+ message :
947+ type : string
948+ example : It's a match !
0 commit comments