{"openapi":"3.0.0","info":{"title":"APi Doc 1","description":"","version":"1.0.0"},"servers":[{"url":"","description":"The One API server"}],"paths":{"/register":{"post":{"summary":"Registers a new user","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSerializer"}}}},"responses":{"201":{"description":"User registered successfully","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/UserSerializer"},"token":{"type":"string"}}}}}},"400":{"description":"Invalid data provided","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}}}}}},"/login":{"post":{"summary":"Logs in a user","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"}},"required":["username","password"]}}}},"responses":{"200":{"description":"Returns the user data and token","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"token":{"type":"string"}}}}}},"404":{"description":"User not found","content":{"application/json":{"schema":{"type":"object","properties":{"detail":{"type":"string"}}}}}}}}},"/books":{"get":{"summary":"Get all books from the database","responses":{"200":{"description":"List of books","content":{"application/json":{"schema":{"type":"object","properties":{"books":{"type":"array","items":{"$ref":"#/components/schemas/Book"}}}}}}}}}},"/book/{book_id}":{"get":{"summary":"Get a book by ID","parameters":[{"name":"book_id","in":"path","description":"ID of the book to retrieve","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Book retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Book"}}}},"404":{"description":"The book does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}},"/chapters":{"get":{"summary":"Get a list of all chapters","security":[{"TokenAuthentication":[],"SessionAuthentication":[]}],"responses":{"200":{"description":"List of chapters","content":{"application/json":{"schema":{"type":"object","properties":{"chapters":{"type":"array","items":{"$ref":"#/components/schemas/Chapter"}}}}}}}}}},"/chapter/{chapter_id}":{"get":{"summary":"Get a chapter by ID","parameters":[{"name":"chapter_id","in":"path","description":"ID of the chapter to retrieve","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Chapter retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Chapter"}}}},"404":{"description":"The chapter does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}},"security":[{"TokenAuth":[],"SessionAuth":[]},{"IsAuthenticated":[]}]}},"/characters":{"get":{"summary":"Get a list of all characters","responses":{"200":{"description":"List of characters","content":{"application/json":{"schema":{"type":"object","properties":{"characters":{"type":"array","items":{"$ref":"#/components/schemas/Character"}}}}}}}},"security":[{"TokenAuthentication":[],"SessionAuthentication":[]}]}},"/character/{character_id}":{"get":{"summary":"Get a character by ID","parameters":[{"name":"character_id","in":"path","description":"ID of the character to retrieve","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Character retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Character"}}}},"404":{"description":"The character does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}},"security":[{"TokenAuth":[],"SessionAuth":[]},{"IsAuthenticated":[]}]}},"/movies":{"get":{"summary":"Get all movies from the database","security":[{"TokenAuthentication":[],"SessionAuthentication":[]}],"responses":{"200":{"description":"List of movies","content":{"application/json":{"schema":{"type":"object","properties":{"movies":{"type":"array","items":{"$ref":"#/components/schemas/Movie"}}}}}}}}}},"/movie/{movie_id}":{"get":{"summary":"Get a movie by ID","parameters":[{"name":"movie_id","in":"path","description":"ID of the movie to retrieve","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Movie retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Movie"}}}},"404":{"description":"The movie does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}},"security":[{"TokenAuth":[],"SessionAuth":[]},{"IsAuthenticated":[]}]}}},"components":{"schemas":{"UserSerializer":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"}}},"User":{"type":"object","properties":{"id":{"type":"integer"},"username":{"type":"string"},"email":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"}}},"Book":{"type":"object","properties":{"book_id":{"type":"string"},"book_name":{"type":"string"}}},"Chapter":{"type":"object","properties":{"chapter_id":{"type":"string"},"chapter_name":{"type":"string"},"book_id":{"type":"integer"}}},"Character":{"type":"object","properties":{"character_id":{"type":"string"},"character_name":{"type":"string"},"character_race":{"type":"string"},"character_gender":{"type":"string"},"character_birth":{"type":"string"},"character_death":{"type":"string"},"character_hair":{"type":"string"},"character_height":{"type":"string"},"character_relam":{"type":"string"},"character_spouse":{"type":"string"},"character_wikiurl":{"type":"string"}}},"Movie":{"type":"object","properties":{"movie_id":{"type":"string"},"movie_name":{"type":"string"},"movie_runtimeInMinutes":{"type":"integer"},"movie_budgetInMillions":{"type":"integer"},"movie_boxOfficeRevenueInMillions":{"type":"number"},"movie_academyAwardNominations":{"type":"integer"},"movie_academyAwardWins":{"type":"integer"},"movie_rottenTomatoesScore":{"type":"number"}}}},"securitySchemes":{"TokenAuthentication":{"type":"apiKey","name":"Authorization","in":"header"},"SessionAuthentication":{"type":"apiKey","name":"sessionid","in":"cookie"},"TokenAuth":{"type":"apiKey","name":"Authorization","in":"header"},"SessionAuth":{"type":"apiKey","name":"sessionid","in":"cookie"},"IsAuthenticated":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}}}