-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.json
More file actions
1 lines (1 loc) · 22 KB
/
Copy pathopenapi.json
File metadata and controls
1 lines (1 loc) · 22 KB
1
{"openapi":"3.1.0","info":{"title":"Heredita API","version":"0.1.0"},"paths":{"/auth/token":{"post":{"tags":["auth"],"summary":"Login For Access Token","operationId":"login_for_access_token_auth_token_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/OAuth2PasswordRequestForm"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"403":{"description":"Forbidden"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/users/new":{"post":{"tags":["auth"],"summary":"Create New User","operationId":"create_new_user_auth_users_new_post","parameters":[{"name":"username","in":"query","required":true,"schema":{"type":"string","title":"Username"}},{"name":"password","in":"query","required":true,"schema":{"type":"string","title":"Password"}},{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"integer","title":"Response Create New User Auth Users New Post"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"403":{"description":"Forbidden"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/filter/":{"get":{"tags":["filter"],"summary":"Return Filter Set","description":"Returns the current filter set.","operationId":"return_filter_set_filter__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilterSet"}}}}}}},"/gallery/new":{"post":{"tags":["gallery"],"summary":"Upload Gallery Image","operationId":"upload_gallery_image_gallery_new_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/GalleryImageUpload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/gallery/":{"get":{"tags":["gallery"],"summary":"Get Gallery","operationId":"get_gallery_gallery__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Gallery"},"type":"array","title":"Response Get Gallery Gallery Get"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"}}}},"/gallery/{gallery_id}":{"get":{"tags":["gallery"],"summary":"Get Gallery Data","operationId":"get_gallery_data_gallery__gallery_id__get","parameters":[{"name":"gallery_id","in":"path","required":true,"schema":{"type":"string","title":"Gallery Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Gallery"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gallery/{gallery_id}/image.png":{"get":{"tags":["gallery"],"summary":"Get Gallery Image","operationId":"get_gallery_image_gallery__gallery_id__image_png_get","parameters":[{"name":"gallery_id","in":"path","required":true,"schema":{"type":"string","title":"Gallery Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gallery/{gallery_id}/thumbnail.png":{"get":{"tags":["gallery"],"summary":"Get Gallery Thumbnail","operationId":"get_gallery_thumbnail_gallery__gallery_id__thumbnail_png_get","parameters":[{"name":"gallery_id","in":"path","required":true,"schema":{"type":"string","title":"Gallery Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/me":{"get":{"tags":["users"],"summary":"Read Own User","operationId":"Read_own_user_users_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserModel"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"}},"security":[{"OAuth2PasswordBearer":[]}]}},"/users/{id}":{"get":{"tags":["users"],"summary":"Read User","operationId":"read_user_users__id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/UserModel"},{"$ref":"#/components/schemas/UserPartial"}],"title":"Response Read User Users Id Get"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/{id}/rank":{"post":{"tags":["users"],"summary":"Set Rank Of User","description":"Set the user's rank, if you can do so.","operationId":"Set_rank_of_user_users__id__rank_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","title":"Id"}},{"name":"rank","in":"query","required":true,"schema":{"$ref":"#/components/schemas/UserRank"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/verify":{"get":{"tags":["users"],"summary":"Verify","description":"Verifies the username matches the token. Returns the ID of the user if valid otherwise -1.","operationId":"verify_users_verify_get","parameters":[{"name":"username","in":"query","required":true,"schema":{"type":"string","title":"Username"}},{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"integer","title":"Response Verify Users Verify Get"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/verify/id":{"get":{"tags":["users"],"summary":"Get Id","description":"Verifies the token is valid and returns the id.","operationId":"get_id_users_verify_id_get","parameters":[{"name":"username","in":"query","required":true,"schema":{"type":"string","title":"Username"}},{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"integer","title":"Response Get Id Users Verify Id Get"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/friends/":{"get":{"tags":["users"],"summary":"Get Friends List","description":"Get a list of friends.","operationId":"Get_friends_list_users_friends__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FriendList"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"}},"security":[{"OAuth2PasswordBearer":[]}]}},"/users/friends/{requestee_username}":{"post":{"tags":["users"],"summary":"Send Friend Request","description":"Send a friend request to another user.","operationId":"Send_friend_request_users_friends__requestee_username__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"requestee_username","in":"path","required":true,"schema":{"type":"string","title":"Requestee Username"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/friends/{friend_username}":{"delete":{"tags":["users"],"summary":"Remove Friend","description":"Remove a friend.","operationId":"Remove_friend_users_friends__friend_username__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"friend_username","in":"path","required":true,"schema":{"type":"string","title":"Friend Username"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/friends/requests/{requester_username}":{"post":{"tags":["users"],"summary":"Accept Friend Request","description":"Accept a friend request from another user.","operationId":"Accept_friend_request_users_friends_requests__requester_username__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"requester_username","in":"path","required":true,"schema":{"type":"string","title":"Requester Username"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["users"],"summary":"Decline Friend Request","description":"Decline a friend request from another user.","operationId":"Decline_friend_request_users_friends_requests__requester_username__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"requester_username","in":"path","required":true,"schema":{"type":"string","title":"Requester Username"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rooms/":{"get":{"tags":["rooms"],"summary":"Get Rooms","description":"Returns the current list of rooms.","operationId":"get_rooms_rooms__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/forum/":{"get":{"tags":["forum"],"summary":"Get Forum Posts","description":"Note that the maximum you can request at once is 25.","operationId":"Get_forum_posts_forum__get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ForumPost"},"title":"Response Get Forum Posts Forum Get"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"},"413":{"description":"Too many posts requested"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/forum/{post_id}":{"get":{"tags":["forum"],"summary":"Get A Single Forum Post","operationId":"Get_a_single_forum_post_forum__post_id__get","parameters":[{"name":"post_id","in":"path","required":true,"schema":{"type":"integer","title":"Post Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForumPostDetail"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["forum"],"summary":"Delete Forum Post Content","operationId":"Delete_forum_post_content_forum__post_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"post_id","in":"path","required":true,"schema":{"type":"integer","title":"Post Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/forum/new":{"post":{"tags":["forum"],"summary":"Create A New Forum Post","operationId":"Create_a_new_forum_post_forum_new_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"integer","title":"Response Create A New Forum Post Forum New Post"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/forum/{post_id}/reply":{"post":{"tags":["forum"],"summary":"Reply To A Forum Post","operationId":"Reply_to_a_forum_post_forum__post_id__reply_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"post_id","in":"path","required":true,"schema":{"type":"integer","title":"Post Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplyCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"integer","title":"Response Reply To A Forum Post Forum Post Id Reply Post"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/forum/replies/{reply_id}":{"delete":{"tags":["forum"],"summary":"Delete Forum Reply Content","operationId":"Delete_forum_reply_content_forum_replies__reply_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"reply_id","in":"path","required":true,"schema":{"type":"integer","title":"Reply Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"429":{"description":"Ratelimited"},"404":{"description":"Not found"},"401":{"description":"Not authorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/version":{"get":{"summary":"Version","operationId":"version_version_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersioningInfo"}}}},"429":{"description":"Ratelimited"}}}}},"components":{"schemas":{"FilterSet":{"properties":{"offensive":{"items":{"type":"string"},"type":"array","title":"Offensive"},"other":{"items":{"type":"string"},"type":"array","title":"Other"}},"type":"object","required":["offensive","other"],"title":"FilterSet"},"ForumPost":{"properties":{"id":{"type":"integer","title":"Id"},"author":{"$ref":"#/components/schemas/UserPartial"},"title":{"type":"string","title":"Title"},"content":{"type":"string","title":"Content"},"reply_count":{"type":"integer","title":"Reply Count"}},"type":"object","required":["id","author","title","content","reply_count"],"title":"ForumPost"},"ForumPostDetail":{"properties":{"id":{"type":"integer","title":"Id"},"author":{"$ref":"#/components/schemas/UserPartial"},"title":{"type":"string","title":"Title"},"content":{"type":"string","title":"Content"},"reply_count":{"type":"integer","title":"Reply Count"},"replies":{"items":{"$ref":"#/components/schemas/ForumReply"},"type":"array","title":"Replies"}},"type":"object","required":["id","author","title","content","reply_count","replies"],"title":"ForumPostDetail"},"ForumReply":{"properties":{"id":{"type":"integer","title":"Id"},"author":{"$ref":"#/components/schemas/UserPartial"},"content":{"type":"string","title":"Content"}},"type":"object","required":["id","author","content"],"title":"ForumReply"},"FriendList":{"properties":{"friends":{"items":{"$ref":"#/components/schemas/UserPartial"},"type":"array","title":"Friends"}},"type":"object","required":["friends"],"title":"FriendList"},"Gallery":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"attribution":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"title":"Attribution"}},"type":"object","required":["id","name"],"title":"Gallery"},"GalleryImageUpload":{"properties":{"model":{"$ref":"#/components/schemas/GalleryMetadata"},"data":{"type":"string","format":"binary","title":"Data"}},"type":"object","required":["model","data"],"title":"GalleryImageUpload"},"GalleryMetadata":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"GalleryMetadata"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Message":{"properties":{"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"Message"},"OAuth2PasswordRequestForm":{"properties":{"grant_type":{"anyOf":[{"type":"string","pattern":"^password$"},{"type":"null"}],"title":"Grant Type"},"username":{"type":"string","title":"Username"},"password":{"type":"string","format":"password","title":"Password"},"scope":{"type":"string","title":"Scope","default":""},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"format":"password","title":"Client Secret"}},"type":"object","required":["username","password"],"title":"OAuth2PasswordRequestForm"},"PostCreate":{"properties":{"title":{"type":"string","title":"Title"},"content":{"type":"string","title":"Content"}},"type":"object","required":["title","content"],"title":"PostCreate"},"ReplyCreate":{"properties":{"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"ReplyCreate"},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type"}},"type":"object","required":["access_token","token_type"],"title":"Token"},"UserModel":{"properties":{"id":{"type":"integer","title":"Id"},"username":{"type":"string","title":"Username"},"rank":{"$ref":"#/components/schemas/UserRank"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"friends":{"items":{"$ref":"#/components/schemas/UserPartial"},"type":"array","title":"Friends","default":[]},"sent_friend_requests":{"items":{"$ref":"#/components/schemas/UserPartial"},"type":"array","title":"Sent Friend Requests","default":[]},"received_friend_requests":{"items":{"$ref":"#/components/schemas/UserPartial"},"type":"array","title":"Received Friend Requests","default":[]}},"type":"object","required":["id","username","rank"],"title":"UserModel"},"UserPartial":{"properties":{"id":{"type":"integer","title":"Id"},"username":{"type":"string","title":"Username"},"rank":{"$ref":"#/components/schemas/UserRank"}},"type":"object","required":["id","username","rank"],"title":"UserPartial"},"UserRank":{"type":"string","enum":["player","moderator","administrator","developer"],"title":"UserRank"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VersioningInfo":{"properties":{"main":{"type":"integer","title":"Main"},"auth":{"type":"integer","title":"Auth"},"gallery":{"type":"integer","title":"Gallery"},"users":{"type":"integer","title":"Users"},"forum":{"type":"integer","title":"Forum"}},"type":"object","required":["main","auth","gallery","users","forum"],"title":"VersioningInfo"}},"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"auth/token"}}}}}}