openapi: 3.0.0 info: title: Anidex API description: We tried to make a RESTfull API for anidex backend. version: 1.0.0 servers: - url: "http://localhost:5000" description: hosted locally tags: - name: anime description: anime endpoints - name: episode description: episode related endpoints - name: user description: user endpoints - name: watchlist description: watchlist endpoints - name: review description: review and comment endpoints - name: animeRating description: anime rating by user endpoints - name: episodeRating description: episode rating by user - name: personnel description: personnel endpoints - name: character description: character endpoints - name: watchroom description: watchroom endpoints - name: genre description: genre endpoints #- name: reviewVote # description: a little weird way of commenting on a review - name: studio description: studio endpoints - name: search description: search endpoints - name: admin description: admin endpoints, mainly deletion - name: discussion description: discussion endpoints paths: "/anime": get: summary: returns all anime if successful tags: - anime responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean results: $ref: "#/components/schemas/AnimeAll" animegenres: type: array items: type: array items: type: object properties: animeid: type: integer genrename: type: string "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" post: summary: adds an anime tags: - anime security: - BearerAuth: [] requestBody: $ref: "#/components/requestBodies/AnimeInput" responses: "201": description: success content: application/json: schema: type: object properties: success: type: boolean animeid: type: integer "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/anime/{aid}": get: summary: returns the anime specified by the anime id if found tags: - anime parameters: - $ref: "#/components/parameters/aid" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean anime: $ref: "#/components/schemas/AnimeCommon" animegenres: type: array items: type: object properties: genrename: type: string animestudios: type: array items: type: object properties: studioname: type: string animepicture: type: array items: type: object properties: pictureid: type: string "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" delete: summary: delete an anime, only for admin tags: - admin parameters: - $ref: "#/components/parameters/aid" security: - BearerAuth: [] responses: "201": description: success content: application/json: schema: type: object properties: success: type: boolean message: type: string example: Deleted Anime successfully deletedAnime: $ref: "#/components/schemas/AnimeCommon" "403": $ref: "#/components/responses/403Forbidden" "401": $ref: "#/components/responses/401AuthFailure" "500": $ref: "#/components/responses/500ServerSideError" "/anime/pictures/{aid}": get: summary: get anime pictures tags: - anime parameters: - $ref: "#/components/parameters/aid" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean gallery: type: array $ref: "#/components/schemas/AnimeGallery" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" "/anime/items/{aid}": get: summary: get anime items ids tags: - anime parameters: - $ref: "#/components/parameters/aid" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean characters: type: array items: type: integer genre: type: array items: type: string personnel: type: array items: type: integer studios: type: array items: type: string watchrooms: type: array items: type: integer "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" "/users": get: summary: get all users tags: - user responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean results: $ref: "#/components/schemas/UserAllOutput" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" "/users/{uid}": get: summary: returns user specified by user id if found tags: - user parameters: - $ref: "#/components/parameters/uid" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean user: $ref: "#/components/schemas/UserSingleOutput" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" post: summary: edit a user tags: - user parameters: - $ref: "#/components/parameters/uid" security: - BearerAuth: [] requestBody: description: user data to sign in required: true content: multipart/form-data: schema: type: object properties: name: type: string description: old userid newUserid: type: string description: new userid password: type: string email: type: string format: email bio: type: string image: type: string format: binary required: - name - password - email - image - newUserid encoding: image: contentType: image/jpeg, image/jpg, image/png responses: "201": description: success content: application/json: schema: type: object properties: success: type: boolean userid: type: string user: $ref: "#/components/schemas/UserSingleOutput" "403": $ref: "#/components/responses/403Forbidden" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" delete: summary: delete a user tags: - user parameters: - $ref: "#/components/parameters/uid" security: - BearerAuth: [] responses: "201": description: success content: application/json: schema: type: object properties: success: type: boolean message: type: string example: Deleted User successfully deletedUser: $ref: "#/components/schemas/UserSingleOutput" "401": $ref: '#/components/responses/401AuthFailure' "403": $ref: "#/components/responses/403Forbidden" "500": $ref: "#/components/responses/500ServerSideError" "/users/signup": post: summary: signup a new user tags: - user requestBody: $ref: "#/components/requestBodies/UserSignInInput" responses: "201": description: success content: application/json: schema: $ref: "#/components/schemas/LoginSuccessOutput" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/users/login": post: summary: login a user tags: - user requestBody: description: login data required: true content: application/json: schema: $ref: "#/components/schemas/UserLogin" responses: "200": description: success content: application/json: schema: $ref: "#/components/schemas/LoginSuccessOutput" "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/watchlist/{uid}": get: summary: view user watchlist tags: - watchlist parameters: - $ref: "#/components/parameters/uid" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean watchlist_anime: $ref: "#/components/schemas/WatchlistWhole" watchlist_favourite: $ref: "#/components/schemas/WatchlistWhole" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" post: summary: add anime to user watchlist tags: - watchlist parameters: - $ref: "#/components/parameters/uid" security: - BearerAuth: [] requestBody: $ref: "#/components/requestBodies/watchlistInput" responses: "201": description: success content: application/json: schema: type: object properties: success: type: boolean rated: type: boolean WatchlistEntry: $ref: "#/components/schemas/WatchlistEntry" animeRating: $ref: "#/components/schemas/animeRatingSingle" "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" delete: summary: Deleting anime from user watchlist, also deletes rating if exists tags: - watchlist parameters: - $ref: "#/components/parameters/uid" security: - BearerAuth: [] requestBody: content: application/json: schema: type: object properties: animeid: type: integer minimum: 1 required: - animeid responses: "201": description: success content: application/json: schema: type: object properties: success: type: boolean deletedEntry: $ref: "#/components/schemas/WatchlistEntry" "401": $ref: "#/components/responses/401AuthFailure" "403": $ref: "#/components/responses/403Forbidden" "404": $ref: "#/components/responses/404NotFound" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/search/anime": post: summary: search an anime tags: - search requestBody: $ref: "#/components/requestBodies/searchItem" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean resultAnime: $ref: "#/components/schemas/AnimeAll" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" "/search/users": post: summary: search users tags: - search requestBody: $ref: "#/components/requestBodies/searchItem" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean resultUsers: $ref: "#/components/schemas/UserAllOutput" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" "/search/characters": post: summary: search characters tags: - search requestBody: $ref: "#/components/requestBodies/searchItem" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean resultUsers: $ref: "#/components/schemas/characterAll" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" "/search/personnel": post: summary: search personnel tags: - search requestBody: $ref: "#/components/requestBodies/searchItem" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean resultUsers: $ref: "#/components/schemas/PersonnelAll" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" "/search/episodes": post: summary: search episodes tags: - search requestBody: $ref: "#/components/requestBodies/searchItem" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean resultUsers: $ref: "#/components/schemas/episodesAll" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" "/search/studio": post: summary: search studio tags: - search requestBody: $ref: "#/components/requestBodies/searchItem" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean resultUsers: $ref: "#/components/schemas/studioAll" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" "/characters": get: summary: get all characters tags: - character responses: "200": description: successfully got all character content: application/json: schema: type: object properties: success: type: boolean results: type: array items: $ref: "#/components/schemas/characterSingle" allAnime: type: array items: type: array items: type: object properties: animeid: type: integer characterid: type: integer allVoiceActor: type: array items: type: array items: type: object properties: personnelid: type: integer characterid: type: integer "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" post: summary: add a new character tags: - character security: - BearerAuth: [] requestBody: $ref: "#/components/requestBodies/characterInput" responses: "201": description: successfully added a character content: application/json: schema: type: object properties: success: type: boolean characterid: description: newly created character id type: integer "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/characters/{cid}": get: summary: get a single character tags: - character parameters: - $ref: "#/components/parameters/cid" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean character: $ref: "#/components/schemas/characterSingle" anime: description: animeid of the anime type: array items: type: integer voiceActors: description: personnel id of the voice actor type: array items: type: integer "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" delete: summary: delete a character, only for admin tags: - admin parameters: - $ref: "#/components/parameters/cid" security: - BearerAuth: [] responses: "201": description: success content: application/json: schema: type: object properties: success: type: boolean message: type: string example: Deleted character successfully deletedCharacter: $ref: "#/components/schemas/characterSingle" "401": $ref: "#/components/responses/401AuthFailure" "403": $ref: "#/components/responses/403Forbidden" "500": $ref: "#/components/responses/500ServerSideError" "/genre": get: summary: get all genre tags: - genre responses: "200": description: successfully got all genre content: application/json: schema: type: object properties: success: type: boolean results: type: array items: type: string "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" post: summary: add a new genre tags: - genre security: - BearerAuth: [] requestBody: description: genre request body required: true content: application/json: schema: type: object properties: genre: type: string required: - genre responses: "201": description: successfully added a genre content: application/json: schema: type: object properties: success: type: boolean newGenreName: description: newly created genre type: string "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/genre/anime": post: summary: get ids of all anime of a single genre tags: - genre requestBody: description: the genre to list anime of required: true content: application/json: schema: type: object properties: searchedGenre: type: string required: - searchedGenre responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean animeOfGenre: type: array items: type: integer "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" "/personnel": get: summary: get all personnel data tags: - personnel responses: "200": description: successfully got all person content: application/json: schema: type: object properties: success: type: boolean personnels: type: array items: $ref: "#/components/schemas/personnel" allAnimeStaffWorks: type: array items: type: array items: $ref: "#/components/schemas/animeStaffData" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" post: summary: add a new person tags: - personnel security: - BearerAuth: [] requestBody: $ref: "#/components/requestBodies/PersonInput" responses: "201": description: successfully added a person content: application/json: schema: type: object properties: success: type: boolean personnelID: description: newly created personnel id type: integer "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/personnel/{pid}": get: summary: get a single person tags: - personnel parameters: - $ref: "#/components/parameters/pid" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean person: $ref: "#/components/schemas/personnel" workedOnAnime: $ref: "#/components/schemas/animeStaffData" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" delete: summary: delete a person, only for admin tags: - admin parameters: - $ref: "#/components/parameters/pid" security: - BearerAuth: [] responses: "201": description: success content: application/json: schema: type: object properties: success: type: boolean message: type: string example: Deleted person successfully deletedUser: $ref: "#/components/schemas/personnel" "401": $ref: "#/components/responses/401AuthFailure" "403": $ref: "#/components/responses/403Forbidden" "500": $ref: "#/components/responses/500ServerSideError" "/watchroom": get: summary: get all watchrooms data tags: - watchroom responses: "200": description: successfully got all watchroom content: application/json: schema: type: object properties: success: type: boolean results: $ref: "#/components/schemas/WatchroomAll" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" post: summary: add a new watchroom tags: - watchroom security: - BearerAuth: [] requestBody: $ref: "#/components/requestBodies/WatchroomInput" responses: "201": description: successfully added a watchroom content: application/json: schema: type: object properties: success: type: boolean watchroomid: description: newly created watchroom id type: integer "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/watchroom/{watchroomid}": get: summary: get a single watchroom tags: - watchroom parameters: - $ref: "#/components/parameters/watchroomid" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean watchroom: $ref: "#/components/schemas/WatchroomSingle" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" "/wachroom/participants/{watchroomid}": get: summary: get ids of all participants of a watchroom tags: - watchroom parameters: - $ref: "#/components/parameters/watchroomid" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean participants: type: array items: type: string "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" post: summary: add a new participant to a watchroom tags: - watchroom security: - BearerAuth: [] parameters: - $ref: "#/components/parameters/watchroomid" requestBody: $ref: "#/components/requestBodies/WatchroomParticipantInput" responses: "201": description: successfully added a participant to a watchroom content: application/json: schema: type: object properties: success: type: boolean participant: $ref: "#/components/schemas/WatchroomParticipants" "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/reviews/{aid}": get: summary: get all reviews of this anime tags: - review parameters: - $ref: "#/components/parameters/aid" responses: "200": description: successfully got all review of this anime content: application/json: schema: type: object properties: success: type: boolean reviews: $ref: "#/components/schemas/reviewAll" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" post: summary: add a new review to an anime tags: - review security: - BearerAuth: [] parameters: - $ref: "#/components/parameters/aid" requestBody: $ref: "#/components/requestBodies/ReviewInput" responses: "201": description: successfully added a review to this anime content: application/json: schema: type: object properties: success: type: boolean newReview: $ref: "#/components/schemas/reviewSingle" "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/reviews/single/{reviewid}": get: summary: get a single review tags: - review parameters: - $ref: "#/components/parameters/reviewid" responses: "200": description: successfully got this review content: application/json: schema: type: object properties: success: type: boolean review: $ref: "#/components/schemas/reviewSingle" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" "/episodes/{aid}": get: summary: get all episodes of the provided anime tags: - episode parameters: - $ref: "#/components/parameters/aid" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean episodes: $ref: "#/components/schemas/episodesAll" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" post: summary: add a new episode to an anime tags: - episode security: - BearerAuth: [] parameters: - $ref: "#/components/parameters/aid" requestBody: $ref: "#/components/requestBodies/EpisodeInput" responses: "201": description: successfully added an episode to this anime content: application/json: schema: type: object properties: success: type: boolean newEpisode: $ref: "#/components/schemas/episodeSingle" "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/episodes/single/{episodeid}": get: summary: get a single episode with provided id tags: - episode parameters: - $ref: "#/components/parameters/episodeid" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean episode: $ref: "#/components/schemas/episodeSingle" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" delete: summary: delete an episode, only for admin tags: - admin parameters: - $ref: "#/components/parameters/episodeid" security: - BearerAuth: [] responses: "201": description: success content: application/json: schema: type: object properties: success: type: boolean message: type: string example: Deleted episode successfully deletedUser: $ref: "#/components/schemas/episodeSingle" "403": $ref: "#/components/responses/403Forbidden" "401": $ref: "#/components/responses/401AuthFailure" "500": $ref: "#/components/responses/500ServerSideError" "/studios": get: summary: get all studios tags: - studio responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean results: $ref: "#/components/schemas/studioAll" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" post: summary: add a new studio tags: - studio security: - BearerAuth: [] requestBody: $ref: "#/components/requestBodies/StudioInput" responses: "201": description: successfully added a studio content: application/json: schema: type: object properties: success: type: boolean newStudio: $ref: "#/components/schemas/studioSingle" "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/studios/{studioname}": get: summary: get a single studio with provided id tags: - studio parameters: - $ref: "#/components/parameters/studioname" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean studio: $ref: "#/components/schemas/studioSingle" animebystudio: $ref: "#/components/schemas/AnimeAll" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" "/studios/anime/{studioname}": get: summary: get all anime of a single studio tags: - studio parameters: - $ref: "#/components/parameters/studioname" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean animeOfStudio: type: array items: type: integer "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" "/animerating/{aid}": get: summary: get all rating of a single anime tags: - animeRating parameters: - $ref: "#/components/parameters/aid" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean animeStars: $ref: "#/components/schemas/animeRatingAll" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" "/animerating/{uid}": post: summary: rate an anime by this user tags: - animeRating security: - BearerAuth: [] parameters: - $ref: "#/components/parameters/uid" requestBody: $ref: "#/components/requestBodies/AnimeRatingInput" responses: "201": description: successfully rated a new anime content: application/json: schema: type: object properties: success: type: boolean newRating: $ref: "#/components/schemas/animeRatingSingle" "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/animerating/user/{uid}": get: summary: get all rating by a single user tags: - animeRating parameters: - $ref: "#/components/parameters/uid" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean allStarsByThisUser: $ref: "#/components/schemas/animeRatingAll" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" "/animerating/anime/{uid}": post: summary: get single anime rating by a single user tags: - animeRating parameters: - $ref: "#/components/parameters/uid" requestBody: content: application/json: schema: type: object properties: animeid: type: integer responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean rating: type: integer minimum: 0 maximum: 10 "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/episoderating/{episodeid}": get: summary: get all rating of a single episode tags: - episodeRating parameters: - $ref: "#/components/parameters/episodeid" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean episodeRates: $ref: "#/components/schemas/episodeRatingAll" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" "/episoderating/{uid}": post: summary: rate an episode by this user tags: - episodeRating security: - BearerAuth: [] parameters: - $ref: "#/components/parameters/uid" requestBody: $ref: "#/components/requestBodies/EpisodeRatingInput" responses: "201": description: successfully rated an episode content: application/json: schema: type: object properties: success: type: boolean newRating: $ref: "#/components/schemas/episodeRatingSingle" "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/episoderating/user/{uid}": get: summary: get all rating by a single user tags: - episodeRating parameters: - $ref: "#/components/parameters/uid" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean allRatesByThisUser: $ref: "#/components/schemas/episodeRatingAll" "404": $ref: "#/components/responses/404NotFound" "500": $ref: "#/components/responses/500ServerSideError" "/episoderating/episode/{uid}": post: summary: get single episode rating by a single user tags: - episodeRating parameters: - $ref: "#/components/parameters/uid" requestBody: content: application/json: schema: type: object properties: episodeid: type: integer responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean rate: type: integer minimum: 0 maximum: 10 "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/discussion/anime/{aid}": get: summary: get all related discussions of an anime, use to show review and watchroom tags: - discussion parameters: - $ref: "#/components/parameters/aid" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean animeTagDiscussions: type: array items: $ref: "#/components/schemas/discussionHeadOutput" reviewTagDiscussions: type: array items: $ref: "#/components/schemas/discussionHeadOutput" watchroomTagDiscussions: type: array items: $ref: "#/components/schemas/discussionHeadOutput" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/discussion/tags": get: summary: get list of all tags with info tags: - discussion responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean tagData: type: array items: $ref: "#/components/schemas/tagData" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/discussion/tags/{tagid}": get: summary: get list of all discussions of tag, animeids are of review, anime and watchroom discussions in same serial tags: - discussion parameters: - $ref: "#/components/parameters/tagid" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean allDiscussionHeads: type: array items: $ref: "#/components/schemas/discussionHeadOutput" animeids: type: array items: type: object properties: discussionheadid: type: integer animeid: type: integer "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/discussion/discussionhead": post: summary: Start discussion, animeid optional, only for anime, review and watchroom tags tags: - discussion security: - BearerAuth: [] requestBody: $ref: "#/components/requestBodies/DiscussionHeadInputBody" responses: "201": description: success content: application/json: schema: type: object properties: success: type: boolean newDiscussionHead: $ref: "#/components/schemas/discussionHead" "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/discussion/discussionhead/{dhid}": get: summary: get the discussion head and all disscussion entries of it tags: - discussion parameters: - $ref: "#/components/parameters/dhid" responses: "200": description: success content: application/json: schema: type: object properties: success: type: boolean discussionhead: $ref: "#/components/schemas/discussionHeadOutput" discussionEntries: type: array items: $ref: "#/components/schemas/discussionEntryElaborate" "500": $ref: "#/components/responses/500ServerSideError" post: summary: add entry to a disscussion head tags: - discussion parameters: - $ref: "#/components/parameters/dhid" security: - BearerAuth: [] requestBody: $ref: "#/components/requestBodies/DiscussionEntryInputBody" responses: "201": description: success content: application/json: schema: type: object properties: success: type: boolean newDiscussionEntry: $ref: "#/components/schemas/discussionEntry" "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" patch: summary: vote a discussion head tags: - discussion security: - BearerAuth: [] parameters: - $ref: "#/components/parameters/dhid" requestBody: content: application/json: schema: type: object properties: vote: type: boolean required: - vote responses: "201": description: success content: application/json: schema: type: object properties: success: type: boolean votedEntry: $ref: "#/components/schemas/discussionHead" "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" delete: summary: delete a discussion head written by user tags: - discussion security: - BearerAuth: [] parameters: - $ref: "#/components/parameters/dhid" responses: "201": description: success content: application/json: schema: type: object properties: success: type: boolean deletedEntry: $ref: "#/components/schemas/discussionEntry" "403": $ref: "#/components/responses/403Forbidden" "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" "/discussion/discussionentry/{deid}": post: summary: vote a discussion entry tags: - discussion security: - BearerAuth: [] parameters: - $ref: "#/components/parameters/deid" requestBody: content: application/json: schema: type: object properties: vote: type: boolean required: - vote responses: "201": description: success content: application/json: schema: type: object properties: success: type: boolean votedEntry: $ref: "#/components/schemas/discussionEntry" "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" delete: summary: delete a discussion entry written by user tags: - discussion security: - BearerAuth: [] parameters: - $ref: "#/components/parameters/deid" responses: "201": description: success content: application/json: schema: type: object properties: success: type: boolean deletedEntry: $ref: "#/components/schemas/discussionEntry" "403": $ref: "#/components/responses/403Forbidden" "401": $ref: "#/components/responses/401AuthFailure" "422": $ref: "#/components/responses/422InvalidInput" "500": $ref: "#/components/responses/500ServerSideError" components: # Reusable schemas (data models) schemas: UserSignIn: type: object properties: name: type: string password: type: string email: type: string format: email bio: type: string image: type: string format: binary required: - name - password - email - image UserLogin: type: object properties: name: type: string email: type: string format: email password: type: string required: - name - password - email LoginSuccessOutput: type: object properties: success: type: boolean userid: type: string email: type: string format: email token: type: string format: jwt UserSingleOutput: type: object properties: userid: type: string email: type: string format: email bio: type: string pictureid: type: string admin: type: boolean UserAllOutput: type: array items: $ref: "#/components/schemas/UserSingleOutput" AnimeCommon: type: object properties: animeid: type: integer minimum: 1 title: type: string releaseseason: type: string enum: ["Spring", "Summer", "Winter", "Fall"] releasedate: type: string format: date averagerating: type: number animerank: type: integer synopsis: type: string AnimeAll: type: array items: $ref: "#/components/schemas/AnimeCommon" WatchlistEntry: type: object properties: animeid: type: integer userid: type: string favourite: type: boolean required: - animeid - userid - favourite WatchlistWhole: type: array items: $ref: "#/components/schemas/WatchlistEntry" AnimePicture: type: object properties: pictureid: type: string poster: type: boolean AnimeGallery: type: array items: $ref: "#/components/schemas/AnimePicture" characterSingle: type: object properties: characterid: type: integer firstname: type: string lastname: type: string genre: type: string age: type: string # dateofbirth: # type: integer # format: date role: type: string description: type: string pictureid: type: string characterAll: type: array items: $ref: "#/components/schemas/characterSingle" personnel: type: object properties: personnelid: type: integer firstname: type: string lastname: type: string genre: type: string age: type: string birthday: type: integer format: date address: type: integer website: type: string format: url pictureid: type: string PersonnelAll: type: array items: $ref: "#/components/schemas/personnel" episodeSingle: type: object properties: episodeid: type: integer episode: type: integer season: type: integer airingdate: type: integer format: date title: type: string runtme: type: integer format: time episoderating: type: number animeid: type: integer episodesAll: type: array items: $ref: "#/components/schemas/episodeSingle" episodeInput: type: object properties: episode: type: integer season: type: integer animeid: type: integer title: type: string airingdate: type: string format: date runtime: type: string format: time example: 00:22:06 required: - episode - season - animeid - title studioSingle: type: object properties: studioid: type: string foundingdate: type: integer format: date office_address: type: string website: type: string format: url studioAll: type: array items: $ref: "#/components/schemas/studioSingle" failedResponses: type: object properties: success: type: boolean example: false message: type: string watchlistInput: type: object properties: animeid: type: integer favourite: type: boolean required: - animeid - favourite AnimeInput: type: object properties: title: type: string releasedate: type: integer format: date synopsis: type: string releaseseason: type: string enum: ["Spring", "Summer", "Winter", "Fall"] required: - title - releasedate - synopsis - releaseseason PersonInput: type: object properties: lastname: type: string firstname: type: string gender: type: string birthday: type: string format: date address: type: string website: type: string format: url anime: type: array items: type: integer description: animeid of the anime example: - 127 - 128 role: type: array items: type: string description: role of person in the anime, same serial example: - Animator - Director image: type: string format: binary required: - lastname - firstname - gender - birthday - image WatchroomSingle: type: object properties: watchroomid: type: integer minimum: 1 watchroomname: type: string starttime: type: number format: timestamp endtime: type: number format: timestamp animeid: type: integer minimum: 1 description: type: string WatchroomAll: type: array items: $ref: "#/components/schemas/WatchroomSingle" WatchroomParticipants: type: object properties: userid: type: string watchroomid: type: integer reviewSingle: type: object properties: reviewid: type: integer minimum: 1 content: type: string votes: type: integer reviewtime: type: number format: timestamp animeid: type: integer minimum: 1 userid: type: string reviewAll: type: array items: $ref: "#/components/schemas/reviewSingle" reviewInput: type: object properties: content: type: string animeid: type: integer minimum: 1 userid: type: string required: - content - animeid - userid animeRatingSingle: type: object properties: userid: type: string animeid: type: integer minimum: 1 starcount: type: integer minimum: 0 maximum: 10 animeRatingAll: type: array items: $ref: "#/components/schemas/animeRatingSingle" episodeRatingSingle: type: object properties: userid: type: string episodeid: type: integer minimum: 1 rating: type: integer minimum: 0 maximum: 10 episodeRatingAll: type: array items: $ref: "#/components/schemas/episodeRatingSingle" animeStaffData: type: object properties: personnelid: type: integer minimum: 1 animeid: type: integer minimum: 1 role: type: string tagData: type: object properties: tagname: type: string description: type: string totaldiscussions: type: integer discussionHead: type: object properties: discussionheadid: type: integer contentofdiscussion: type: string votes: type: integer starttime: type: string format: date-time userid: type: string discussionHeadOutput: type: object properties: discussionheadid: type: integer contentofdiscussion: type: string votes: type: integer starttime: type: string format: date-time userid: type: string pictureid: type: string discussionEntryElaborate: type: object properties: discussionentryid: type: integer contentofdiscussion: type: string votes: type: integer starttime: type: integer userid: type: string pictureid: type: string discussionEntry: type: object properties: discussionentryid: type: integer discussionentry: type: string votes: type: integer starttime: type: integer userid: type: string discussionheadid: type: integer discussionHeadInput: type: object properties: content: type: string userid: type: string tags: type: array items: type: string animeid: type: integer required: - content - userid - tags discussionEntryInput: type: object properties: content: type: string userid: type: string requestBodies: searchItem: description: search string required: true content: application/json: schema: type: object properties: searchString: type: string required: - searchString UserSignInInput: description: user data to sign in required: true content: multipart/form-data: schema: $ref: "#/components/schemas/UserSignIn" encoding: image: contentType: image/jpeg, image/jpg, image/png AnimeInput: description: anime data to add required: true content: multipart/form-data: schema: type: object properties: title: type: string releasedate: type: string format: date synopsis: type: string releaseseason: type: string enum: ["Spring", "Summer", "Winter", "Fall"] genres: type: array description: string array of genreNames items: type: string example: ["Action", "Adventure"] studios: type: array description: string array of studioNames items: type: string example: ["Mappa", "Sunrise"] image: type: string format: binary required: - title - releasedate - synopsis - releaseseason - image encoding: image: contentType: image/png, image/jpeg, image/jpg watchlistInput: description: watchlist entry to add required: true content: application/json: schema: type: object properties: animeid: type: integer favourite: type: boolean rating: type: integer minimum: 0 maximum: 10 required: - animeid - favourite characterInput: description: new character to entry required: true content: multipart/form-data: schema: type: object properties: lastname: type: string firstname: type: string gender: type: string role: type: string age: type: integer description: type: string voiceActors: type: array description: personnelids of the character voice actors items: type: integer example: ["127","23"] anime: type: array description: animeids of the anime items: type: integer example: ["127", "23"] image: type: string format: binary required: - lastname - firstname - gender - role - age - description - image encoding: image: contentType: image/jpeg, image/jpg, image/png PersonInput: description: request body for personnel required: true content: multipart/form-data: schema: type: object properties: lastname: type: string firstname: type: string gender: type: string birthday: type: string format: date address: type: string website: type: string format: url anime: type: array description: animeids of the anime items: type: integer example: ["127", "23"] role: type: array description: roles of persons in the anime, same serial as up items: type: string example: ["Voice Actor", "Director"] image: type: string format: binary required: - lastname - firstname - gender - birthday - image encoding: image: contentType: image/jpeg, image/jpg, image/png WatchroomInput: description: new watchroom to create required: true content: application/json: schema: type: object properties: watchroomname: type: string animeid: type: integer minimum: 1 description: type: string duration: type: integer required: - watchroomname - animeid - description WatchroomParticipantInput: description: the participant to add to watchroom required: true content: application/json: schema: type: object properties: userid: type: string required: - userid ReviewInput: description: new review data required: true content: application/json: schema: $ref: "#/components/schemas/reviewInput" EpisodeInput: description: new episode data required: true content: application/json: schema: $ref: "#/components/schemas/episodeInput" StudioInput: description: new studio data required: true content: application/json: schema: type: object properties: studioname: type: string office_address: type: string website: type: string format: url foundingdate: type: string format: date required: - studioname - office_address - website AnimeRatingInput: description: data for a new anime rating required: true content: application/json: schema: type: object properties: animeid: type: integer minimum: 1 starcount: type: integer minimum: 0 maximum: 10 required: - animeid - starcount EpisodeRatingInput: description: data for a new episode rating required: true content: application/json: schema: type: object properties: episodeid: type: integer minimum: 1 rating: type: integer minimum: 0 maximum: 10 required: - episodeid - rating DiscussionHeadInputBody: description: data for a new discussionhead required: true content: application/json: schema: $ref: "#/components/schemas/discussionHeadInput" DiscussionEntryInputBody: description: data for a new discussionentry required: true content: application/json: schema: $ref: "#/components/schemas/discussionEntryInput" required: - content - userid DiscussionEntryVoteBody: description: data for a new discussionentry vote required: true content: application/json: schema: type: object properties: vote: type: boolean required: - vote DiscussionHeadVoteBody: description: data for a new discussionhead vote required: true content: application/json: schema: type: object properties: vote: type: boolean required: - vote # Reusable path, query, header and cookie parameters parameters: uid: in: path name: uid required: true schema: type: string description: userID of user aid: in: path name: aid required: true schema: type: integer minimum: 1 description: animeid of the anime cid: in: path name: cid required: true schema: type: integer minimum: 1 description: character id of the character pid: in: path name: pid required: true schema: type: integer minimum: 1 description: personnel id of the person watchroomid: in: path name: watchroomid required: true schema: type: integer minimum: 1 description: id of the watchroom reviewid: in: path name: reviewid required: true schema: type: integer minimum: 1 description: id of the review episodeid: in: path name: episodeid required: true schema: type: integer minimum: 1 description: id of the episode studioname: in: path name: studioname required: true schema: type: string description: id of the studio, may contain spaces and hiphens tagid: in: path name: tagid required: true schema: type: string description: name of the tag of discussion dhid: in: path name: dhid required: true schema: type: integer description: id of the discussionhead deid: in: path name: deid required: true schema: type: integer description: id of the discussionentry securitySchemes: BearerAuth: type: http scheme: bearer bearerFormat: jwt # Reusable responses, such as 401 Unauthorized or 400 Bad Request responses: 400badrequest: description: Please use the status code to check for failure, not success field. Failure in forming a proper API call content: application/json: schema: $ref: "#/components/schemas/failedResponses" 404NotFound: description: Please use the status code to check for failure, not success field. Requested resource was not found. content: application/json: schema: $ref: "#/components/schemas/failedResponses" 500ServerSideError: description: Please use the status code to check for failure, not success field. Unknown server side error occurred, please try again later. content: application/json: schema: $ref: "#/components/schemas/failedResponses" 422InvalidInput: description: Please use the status code to check for failure, not success field. Provided inputs are not valid, please check them. content: application/json: schema: $ref: "#/components/schemas/failedResponses" 403Forbidden: description: Please use the status code to check for failure, not success field. User trying to access or modify forbidden resource content: application/json: schema: $ref: "#/components/schemas/failedResponses" 401AuthFailure: description: Please use the status code to check for failure, not success field. Failure in authenticating this API call by JWT content: application/json: schema: $ref: "#/components/schemas/failedResponses"