openapi: 3.0.0 info: title: "ANI-F0RUN REST API" description: "An API about anime and anime-related topics" version: "1.0.0" servers: - url: "/api" components: # Schemas used in the API schemas: User: # User schema that represents a user type: "object" required: - username - password - location - anime_watched - anime_watched_score - topics_subscribed - messages_sent - karma - achievements properties: username: type: "string" password: type: "string" location: type: "string" anime_watched: type: "array" items: type: "string" anime_watched_score: type: "array" items: type: "integer" topics_subscribed: type: "array" items: type: "string" karma: type: "integer" achievements: type: "array" items: $ref: "#/components/schemas/Achievement" Message: # Message schema that represents a message type: "object" required: - username - content properties: username: type: "string" content: type: "string" Anime: #Anime schema that represents an anime type: "object" required: - name - genres - episodes - score - aired - synopsis properties: name: type: "string" genres: type: "array" items: type: "string" episodes: type: "integer" score: type: "number" aired: type: "string" synopsis: type: "string" Topic: # Topic schema that represents a Topic type: "object" required: - name - subscribers - publications properties: name: type: "string" subscribers: type: "array" items: type: "string" publications: type: "array" items: $ref: "#/components/schemas/Publication" Publication: # Publication schema that represents a Publication type: "object" required: - name - topic_name properties: name: type: "string" topic_name: type: "string" message: $ref: "#/components/schemas/Message" images: type: "array" items: $ref: "#/components/schemas/Image" Image: # Image schema that represents a Image type: "object" required: - name properties: name: type: "string" Notification: # Notification schema that represents a Notification type: "object" required: - message properties: message: type: "string" Achievement: # Achievement schema that represents a Achievement type: "object" required: - name - description - date - rarity properties: name: type: "string" description: type: "string" date: type: "string" rarity: type: "string" enum: [common, rare, epic, legendary, mythic] # Parameters for paths parameters: anime_name: name: "anime_name" description: "Name of the anime in question" in: path required: True schema: type: "string" user_name: name: "user_name" description: "Name of the user in question" in: path required: True schema: type: "string" topic_name: name: "topic_name" description: "Name of the topic" in: path required: True schema: type: "string" label: name: "label" description: "Label of the image" in: path required: True schema: type: "string" anime_genre: name: "anime_genre" description: "Genre of the anime" in: path required: True schema: type: "string" achievement_name: name: "achievement_name" description: "Name of the achievement" in: path required: True schema: type: "string" paths: # ===================================================== # ======================= Topic ======================= # ===================================================== /topics: get: operationId: "topics.all_topics" tags: - Topic summary: "Show a partial part of the topcis list" responses: "200": description: "Successfully show partial topics list" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/Topic" post: operationId: "topics.create" tags: - Topic summary: "Create a new topic" requestBody: description: "Topic to create" required: True content: application/json: schema: $ref: "#/components/schemas/Topic" responses: "201": description: "Successfully created a topic" /topics/{topic_name}: parameters: - name: "topic_name" in: path required: true description: "Name of the topic" schema: type: "string" get: operationId: "topics.get_topic" tags: - Topic summary: "Show a specific topic if it exists" responses: "200": description: "Successfully show the topic" content: application/json: schema: $ref: "#/components/schemas/Topic" "404": description: "Topic not found" post: operationId: "topics.publish" tags: - Topic summary: "Create a publication in the topic" requestBody: description: "Publition to publish" required: True content: application/json: schema: $ref: "#/components/schemas/Publication" responses: "201": description: "Successfully submitted a publication" /topics/{user_name}: parameters: - name: "user_name" in: path required: true description: "Name of a user" schema: type: "string" get: operationId: "topics.get_user_personalized" tags: - Topic summary: "Get a personalized topic list for the user" responses: "200": description: "Successfully show the topic list" content: application/json: schema: $ref: "#/components/schemas/Topic" "404": description: "User not found" /topics/{user_name}/feed: parameters: - name: "user_name" in: path required: true description: "Name of a user" schema: type: "string" get: operationId: "topics.get_user_personalized_feed" tags: - Topic summary: "Get a personalized publication list for the user" responses: "200": description: "Successfully show the publication list" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/Publication" "404": description: "User not found" # ===================================================== # ======================= Image ======================= # ===================================================== /image: post: operationId: "images.label_generate" tags: - Images summary: "Generates labels for the sent image" requestBody: description: "Image to extract labels" required: True content: application/json: schema: $ref: "#/components/schemas/Image" responses: "201": description: "Successfully submitted a publication" /image/{label}: parameters: - name: "label" in: path required: true description: "Label name" schema: type: "string" get: operationId: "images.get_image" tags: - Images summary: "Search for images based on the label parameter" responses: "200": description: "Successfully show one or more images" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/Image" "404": description: "No image with that label found" # ==================================================== # ====================== Lookup ====================== # ==================================================== /lookup: get: operationId: "server.lookup" tags: - Server summary: "Search for available server addresses" responses: "200": description: "Successfully show one or more addresses" "404": description: "No address available found" # ===================================================== # ======================= Anime ======================= # ===================================================== /anime: get: operationId: "anime.all_anime" tags: - Anime summary: "Show the anime list" responses: "200": description: "Successfully show anime list" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/Anime" /anime/anime_name/{anime_name}: parameters: - name: "anime_name" in: path required: true description: "Name of the anime" schema: type: "string" get: operationId: "anime.get_anime" tags: - Anime summary: "Show a specific anime if it exists" responses: "200": description: "Successfully show the anime" content: application/json: schema: $ref: "#/components/schemas/Anime" "404": description: "Anime not found" /anime/anime_genre/{anime_genre}: parameters: - name: "anime_genre" in: path required: true description: "Genre of the anime" schema: type: "string" get: operationId: "anime.get_anime_by_genre" tags: - Anime summary: "Show a partial part of the anime list by genre" responses: "200": description: "Successfully show the anime" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/Anime" "404": description: "Anime not found" /anime/anime_name/{anime_name}/related: parameters: - name: "anime_name" in: path required: true description: "Name of the anime" schema: type: "string" get: operationId: "anime.get_related" tags: - Anime summary: "Show related anime to the specific anime" responses: "200": description: "Successfully show related anime" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/Anime" "404": description: "Anime not found" # ============================================================ # ======================= Notification ======================= # ============================================================ /notification/{user_name}: parameters: - name: "user_name" in: path required: true description: "Name of the user" schema: type: "string" get: operationId: "notification.get_notifications" tags: - Notification summary: "Show the notifications list" responses: "200": description: "Successfully show notifications list" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/Notification" # ==================================================== # ======================= User ======================= # ==================================================== /user: post: operationId: "user.create" tags: - User summary: "Create a new user" requestBody: description: "User to create" required: True content: application/json: schema: $ref: "#/components/schemas/User" responses: "201": description: "Successfully created a user" /user/{user_name}/related_by_anime: parameters: - name: "user_name" in: path required: true description: "Name of the user" schema: type: "string" get: operationId: "user.get_related_by_anime" tags: - User summary: "Show related users to the specific user based on anime watched" responses: "200": description: "Successfully show related users" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/User" "404": description: "User not found" /user/{user_name}/related_by_message: parameters: - name: "user_name" in: path required: true description: "Name of the user" schema: type: "string" get: operationId: "user.get_related_by_message" tags: - User summary: "Show related users to the specific user based on messages sent" responses: "200": description: "Successfully show related users" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/User" "404": description: "User not found" /user/{user_name}/achievements: parameters: - name: "user_name" in: path required: true description: "Name of the user" schema: type: "string" get: operationId: "user.get_achievements" tags: - User summary: "Show user achievements" responses: "200": description: "Successfully show user achievements" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/User" "404": description: "User not found" /user/{user_name}/{achievement_name}: parameters: - name: "user_name" in: path required: true description: "Name of the user" schema: type: "string" - name: "achievement_name" in: path required: true description: "Name of the achievement" schema: type: "string" post: operationId: "user.add_achievement" tags: - User summary: "Add an achievement to a user" requestBody: description: "User and achievement to add" required: True content: application/json: schema: $ref: "#/components/schemas/User" responses: "201": description: "Successfully added achievement" /user/{user_name}/karma: parameters: - name: "user_name" in: path required: true description: "Name of the user" schema: type: "string" get: operationId: "user.get_karma" tags: - User summary: "Show user karma" responses: "200": description: "Successfully show user karma" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/User" "404": description: "User not found" /user/{user_name}/track_records: parameters: - name: "user_name" in: path required: true description: "Name of the user" schema: type: "string" get: operationId: "user.get_track_records" tags: - User summary: "Show user track records" responses: "200": description: "Successfully show user track records" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/User" "404": description: "User not found" /user/{user_name}/messages: parameters: - name: "user_name" in: path required: true description: "Name of the user" schema: type: "string" get: operationId: "user.get_messages" tags: - User summary: "Show user messages" responses: "200": description: "Successfully show user messages" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/User" "404": description: "User not found" /user/{user_name}/recomended_animeList: parameters: - name: "user_name" in: path required: true description: "Name of the user" schema: type: "string" get: operationId: "user.get_recomended_animeList" tags: - User summary: "Show recomended anime list for the user" responses: "200": description: "Successfully show recomended anime list" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/Anime" "404": description: "User not found" # ===================================================== # =================== Achievements ==================== # ===================================================== /achievements/{user_name}: parameters: - name: "user_name" in: path required: true description: "Name of the user" schema: type: "string" get: operationId: "achievements.all_achievements" tags: - Achievement summary: "Show the achievements list" responses: "200": description: "Successfully show achievements list" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/Achievement" /achievements/{user_name}/{achievement_name}: parameters: - name: "user_name" in: path required: true description: "Name of the user" schema: type: "string" - name: "achievement_name" in: path required: true description: "Name of the achievement" schema: type: "string" get: operationId: "achievements.get_achievement" tags: - Achievement summary: "Show a specific achievement if it exists" responses: "200": description: "Successfully show the achievement" content: application/json: schema: type: "object" items: $ref: "#/components/schemas/Achievement" "404": description: "Achievement not found"