{"swagger":"3.0","info":{"title":"5 bestu","version":"Fimmbestu","description":"Social Media for the smart ones","contact":{"email":"thoratli86@hotmail.com","name":"Atli Þór Sigurðsson"}},"tags":[{"name":"Users","description":"Everything releated to users"},{"name":"Articles","description":"Operations related to articles"},{"name":"Tags","description":"Operations related to tags"}],"paths":{"/auth/login":{"post":{"tags":["Users"],"summary":"Authenticate a user","operationId":"login","responses":{"201":{"description":"User has been authenticated"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalError"}}},"options":{"tags":["Users"],"summary":"Get options about path","responses":{"default":{"description":"Options"}}}},"/users":{"get":{"tags":["Users"],"summary":"Retrieve users","operationId":"getUsers","security":[{"bearer-token":[]},{"api-key":[]},{"cookie-fingerprint":[]}],"responses":{"200":{"$ref":"#/components/responses/Users"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Users"],"summary":"Create a new user","operationId":"createUser","security":[{"bearer-token":[]},{"api-key":[]},{"cookie-fingerprint":[]}],"responses":{"201":{"$ref":"#/components/responses/User"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalError"}}},"options":{"tags":["Users"],"summary":"Get options about path","responses":{"default":{"description":"Options"}}}},"/users/{id}":{"get":{"tags":["Users"],"summary":"Retrieve specified user","operationId":"getUserById","security":[{"bearer-token":[]},{"api-key":[]},{"cookie-fingerprint":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"200":{"$ref":"#/components/responses/User"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Users"],"summary":"Update specified user","operationId":"updateUserById","security":[{"bearer-token":[]},{"api-key":[]},{"cookie-fingerprint":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"200":{"$ref":"#/components/responses/User"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Users"],"summary":"Delete specified user","operationId":"deleteUserById","security":[{"bearer-token":[]},{"api-key":[]},{"cookie-fingerprint":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"200":{"$ref":"#/components/responses/Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"options":{"tags":["Users"],"summary":"Get options about path","parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"default":{"description":"Options"}}}},"/user/{id}/image":{"post":{"tags":["Users"],"summary":"Upload profile image for user","operationId":"uploadUserImage","security":[{"bearer-token":[]},{"api-key":[]},{"cookie-fingerprint":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"200":{"$ref":"#/components/responses/UserImage"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"options":{"tags":["Users"],"summary":"Get options about path","parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"default":{"description":"Options"}}}},"/user/{id}/followers":{"get":{"tags":["Users"],"summary":"Get all followers for a specific user","operationId":"followingUser","security":[{"bearer-token":[]},{"api-key":[]},{"cookie-fingerprint":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"200":{"$ref":"#/components/responses/UserImage"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Users"],"summary":"A user is following another user","operationId":"followUser","security":[{"bearer-token":[]},{"api-key":[]},{"cookie-fingerprint":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"200":{"$ref":"#/components/responses/UserImage"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Users"],"summary":"User unfollows a user","operationId":"unFollow","security":[{"bearer-token":[]},{"api-key":[]},{"cookie-fingerprint":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"200":{"$ref":"#/components/responses/UserImage"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"options":{"tags":["Users"],"summary":"Get options about path","parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"default":{"description":"Options"}}}},"/articles":{"get":{"tags":["Articles"],"summary":"Retrieve all articles","operationId":"getArticles","security":[{"bearer-token":[]},{"api-key":[]},{"cookie-fingerprint":[]}],"parameters":[{"$ref":"#/components/parameters/UserId"}],"responses":{"200":{"$ref":"#/components/responses/Articles"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"tags":["Articles"],"summary":"Create a new article","operationId":"createArticle","security":[{"bearer-token":[]},{"api-key":[]},{"cookie-fingerprint":[]}],"responses":{"201":{"$ref":"#/components/responses/Article"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"options":{"tags":["Articles"],"summary":"Get options about path","responses":{"default":{"description":"Options"}}}},"/articles/{id}":{"get":{"tags":["Articles"],"summary":"Retrieve specific article information","operationId":"getArticleById","security":[{"bearer-token":[]},{"api-key":[]},{"cookie-fingerprint":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"200":{"$ref":"#/components/responses/Article"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"put":{"tags":["Articles"],"summary":"Update an article","operationId":"updateRestaurantById","security":[{"bearer-token":[]},{"api-key":[]},{"cookie-fingerprint":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"200":{"$ref":"#/components/responses/Article"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"delete":{"tags":["Articles"],"summary":"Delete an article","operationId":"DeleteArticleById","security":[{"bearer-token":[]},{"api-key":[]},{"cookie-fingerprint":[]}],"parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"200":{"$ref":"#/components/responses/Article"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"options":{"tags":["Articles"],"summary":"Get options about path","parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"default":{"description":"Options"}}}},"/tags":{"get":{"tags":["Tags"],"summary":"Get all tags","operationId":"getTags","security":[{"bearer-token":[]},{"api-key":[]},{"cookie-fingerprint":[]}],"responses":{"200":{"$ref":"#/components/responses/Tags"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/tags/{count}":{"get":{"tags":["Tags"],"summary":"Get a specific number of tags","operationId":"getTagsCount","security":[{"bearer-token":[]},{"api-key":[]},{"cookie-fingerprint":[]}],"parameters":[{"$ref":"#/components/parameters/Count"}],"responses":{"200":{"$ref":"#/components/responses/Tags"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}}},"components":{"securitySchemes":{"bearer-token":{"type":"http","scheme":"bearer","description":"Bearer tokens"},"api-key":{"type":"http","scheme":"apiKey","description":"API keys"},"cookie-fingerprint":{"type":"apiKey","in":"cookie","name":"userFingerprint"}},"requestBodies":{"UserBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"John Smith"},"username:":null,"type":"string","example":"Johnny67","password":{"type":"string","example":"Password"},"email":{"type":"string","format":"email"},"bio":{"type":"string","example":"Sometimes I'm a part of an example"},"role":{"type":"string","example":"user"},"image":{"type":"string","example":"https://i.pinimg.com/474x/58/63/60/586360a4ef713e0af6f1c76c2ce11cd4.jpg"},"language":{"type":"string","enum":["is","en"]},"active":{"type":"boolean","example":true},"created_at":{"type":"string","format":"date"},"updated_at":{"type":"string","format":"date"}},"required":["username","ssn","email","language"]}}}},"ArticleBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"author_id":{"type":"string","format":"uuid"},"intro":{"type":"string","example":"Árið 2020 var ansi skrýtið en þetta eru fyndnustu myndirnar"},"quantity":{"type":"number","example":5},"keyword":{"type":"string","example":"fyndnustu"},"title":{"type":"string","example":"Kvikmyndirnar árið 2020"},"slug":{"type":"string","example":"01012021-5-fyndnustu-kvikmyndirnar-árið-2020"},"thumb":{"type":"string","format":"uuid"},"thumb_source":{"type":"string","example":"www.visir.is"},"reversed_ranks":{"type":"boolean","format":"Bool"},"published":{"type":"boolean","format":"Bool"},"publish_date":{"type":"string","format":"date-time"},"pinned":{"type":"boolean","format":"Bool"},"sent_from_user":{"type":"boolean","format":"Bool"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["name"]}}}}},"parameters":{"Count":{"in":"path","name":"count","required":true,"description":"An integer","schema":{"type":"number","format":"number"}},"ResourceId":{"in":"path","name":"id","required":true,"description":"UUID of resource","schema":{"type":"string","format":"uuid"}},"ArticleId":{"in":"query","name":"article_id","required":true,"description":"UUID of article","schema":{"type":"string","format":"uuid"}},"OptionalArticleId":{"in":"query","name":"restaurant_id","required":false,"description":"UUID of article","schema":{"type":"string","format":"uuid"}},"UserId":{"in":"query","name":"user_id","required":false,"description":"Query for resources related to user","schema":{"type":"string","format":"uuid"}},"RequriedUserId":{"in":"query","name":"user_id","required":true,"description":"Query for resources related to user","schema":{"type":"string","format":"uuid"}},"TagId":{"in":"query","name":"tag_id","required":false,"description":"UUID of tag","schema":{"type":"string","format":"uuid"}},"TadIds":{"in":"query","name":"tag_ids","required":false,"description":"UUIDs of tags","schema":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/Tag"}]}}},"Year":{"in":"query","name":"year","required":false,"description":"Filter data by year","schema":{"type":"string","example":"2020"}},"Month":{"in":"query","name":"month","required":false,"description":"Filter data by month","schema":{"type":"string","example":"12"}}},"schemas":{"Tag":{"title":"Tag","type":"object","properties":{"name":{"type":"string","example":"sports"},"icon":{"type":"string","example":"restaurant"},"title":{"type":"string","example":"sport"}}},"User":{"title":"User","type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","example":"John Smith"},"username":{"type":"string","example":"Johnny66"},"password":{"type":"string","example":"blabla"},"email":{"type":"string","format":"email"},"bio":{"type":"string","example":"example from scheme"},"role":{"type":"string","enum":["admin","company","hero"]},"image":{"type":"string","example":"https://i.pinimg.com/474x/58/63/60/586360a4ef713e0af6f1c76c2ce11cd4.jpg"},"language":{"type":"string","enum":["is","en"]},"active":{"type":"boolean","example":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","email"]},"Article":{"title":"Articles","type":"object","properties":{"id":{"type":"string","format":"uuid"},"author_id":{"type":"string","format":"uuid"},"language":{"type":"string","enum":["en","is"]},"intro":{"type":"string","example":"Árið 2020 var ansi skrýtið en þetta eru fyndnustu myndirnar"},"quantity":{"type":"number","example":5},"keyword":{"type":"string","example":"fyndnustu"},"title":{"type":"string","example":"Kvikmyndirnar árið 2020"},"slug":{"type":"string","example":"01012021-5-fyndnustu-kvikmyndirnar-árið-2020"},"thumb":{"type":"string","format":"uuid"},"thumb_source":{"type":"string","example":"www.visir.is"},"reversed_ranks":{"type":"boolean","format":"Bool"},"published":{"type":"boolean","format":"Bool"},"publish_date":{"type":"string","format":"date-time"},"pinned":{"type":"boolean","format":"Bool"},"sent_from_user":{"type":"boolean","format":"Bool"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name"]},"Error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}},"required":["code","message"]}},"responses":{"BadRequest":{"description":"Generic input error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":400,"message":"Bad Request"}}}},"Unauthorized":{"description":"Need to authenticate to access resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":401,"message":"Unauthorized"}}}},"Forbidden":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":403,"message":"Forbidden"}}}},"NotFound":{"description":"Requested resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":404,"message":"Not Found"}}}},"InternalError":{"description":"Unknown internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":500,"message":"Internal Error"}}}},"Success":{"description":"Operation was successful","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true}},"required":["success"]}}}},"Tags":{"description":"Tag object","content":{"application/json":{"schema":{"type":"array","description":"OK","items":{"$ref":"#/components/schemas/Tag"}}}}},"User":{"description":"User object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"Users":{"description":"List of users","content":{"application/json":{"schema":{"type":"array","description":"OK","items":{"$ref":"#/components/schemas/User"}}}}},"Article":{"description":"Article object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Article"}}}},"Articles":{"description":"List of articles","content":{"application/json":{"schema":{"type":"array","description":"OK","items":{"$ref":"#/components/schemas/Article"}}}}},"UserArticles":{"description":"List of articles per user","content":{"application/json":{"schema":{"type":"array","description":"OK","items":{"$ref":"#/components/schemas/Article"}}}}},"UserImage":{"description":"Profile image has been uploaded","content":{"application/json":{"schema":{"type":"object","properties":{"image":{"type":"string","example":"https://i.pinimg.com/474x/58/63/60/586360a4ef713e0af6f1c76c2ce11cd4.jpg"}},"required":["image"]}}}}}},"host":"virtserver.swaggerhub.com","basePath":"/5bestu/5best/Fimmbestu","schemes":["https"]}