{
  "openapi": "3.0.2",
  "info": {
    "title": "Movary",
    "version": ""
  },
  "servers": [],
  "paths": {
    "\/users\/{username}\/history\/movies": {
      "get": {
        "tags": [
          "History"
        ],
        "summary": "Get played movies with watch dates of user",
        "description": "Get all played movies with watch dates set. Sorted by most recently watch dates on default.",
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "description": "Name of user",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "The search term",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Limit",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 24
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Sort order",
            "required": false,
            "schema": {
              "type": "string",
              "default": "asc",
              "enum": [
                "asc",
                "desc"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application\/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "watchlist": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "movie": {
                            "$ref": "#/components/schemas/movie"
                          },
                          "watchedAt": {
                            "$ref": "#/components/schemas/date"
                          }
                        }
                      }
                    },
                    "currentPage": {
                      "type": "integer",
                      "example": 1
                    },
                    "maxPage": {
                      "type": "integer",
                      "example": 10
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "movaryToken": []
          }
        ]
      },
      "post": {
        "tags": [
          "History"
        ],
        "summary": "Add movie play with watch date set to user",
        "description": "Create or update the provided watch dates for the specified movies. A date for plays is required.",
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "description": "Name of user",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application\/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "movaryId": {
                      "$ref": "#/components/schemas/id"
                    },
                    "watchedAt": {
                      "$ref": "#/components/schemas/date"
                    },
                    "plays": {
                      "$ref": "#/components/schemas/playsOptional"
                    },
                    "comment": {
                      "$ref": "#/components/schemas/commentOptional"
                    },
                    "position": {
                      "$ref": "#/components/schemas/positionOptional"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "$ref": "#/components/responses/204"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "movaryToken": []
          }
        ]
      },
      "put": {
        "tags": [
          "History"
        ],
        "summary": "Replace movie play with watch date set for user",
        "description": "Create or replace the provided watch dates for the specified movies. A date for plays is required.",
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "description": "Name of user",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application\/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "movaryId": {
                      "$ref": "#/components/schemas/id"
                    },
                    "watchedAt": {
                      "$ref": "#/components/schemas/date"
                    },
                    "plays": {
                      "$ref": "#/components/schemas/plays"
                    },
                    "comment": {
                      "$ref": "#/components/schemas/comment"
                    },
                    "position": {
                      "$ref": "#/components/schemas/position"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "$ref": "#/components/responses/204"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "movaryToken": []
          }
        ]
      },
      "delete": {
        "tags": [
          "History"
        ],
        "summary": "Delete movie watch dates from user history",
        "description": "Delete all watch dates of specified movies if no specific watch dates are provided. A date for plays is required.",
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "description": "Name of user",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application\/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "movaryId": {
                      "$ref": "#/components/schemas/id"
                    },
                    "watchedAt": {
                      "$ref": "#/components/schemas/date"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "$ref": "#/components/responses/204"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "movaryToken": []
          }
        ]
      }
    },
    "\/users\/{username}\/watchlist\/movies": {
      "get": {
        "tags": [
          "Watchlist"
        ],
        "summary": "Get movies in watchlist of user",
        "description": "Get all movies on the user watchlist. Sorted by most recently added on default.",
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "description": "Name of user",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "The search term",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Limit",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 24
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Sort by",
            "required": false,
            "schema": {
              "type": "string",
              "default": "addedAt",
              "enum": [
                "addedAt",
                "rating",
                "releaseDate",
                "runtime",
                "title"
              ]
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Sort order",
            "required": false,
            "schema": {
              "type": "string",
              "default": "desc",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "releaseYear",
            "in": "query",
            "description": "Release year",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application\/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "watchlist": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "movie": {
                            "$ref": "#/components/schemas/movie"
                          },
                          "addedAt": {
                            "$ref": "#/components/schemas/date"
                          }
                        }
                      }
                    },
                    "currentPage": {
                      "type": "integer",
                      "example": 1
                    },
                    "maxPage": {
                      "type": "integer",
                      "example": 10
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "movaryToken": []
          }
        ]
      },
      "post": {
        "tags": [
          "Watchlist"
        ],
        "summary": "Add movie to watchlist of user",
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "description": "Name of user",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application\/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "movaryId": {
                      "$ref": "#/components/schemas/id"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "$ref": "#/components/responses/204"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "movaryToken": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Watchlist"
        ],
        "summary": "Delete movie from watchlist of user",
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "description": "Name of user",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application\/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "movaryId": {
                      "$ref": "#/components/schemas/id"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "$ref": "#/components/responses/204"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "movaryToken": []
          }
        ]
      }
    },
    "\/users\/{username}\/played\/movies": {
      "get": {
        "tags": [
          "Played"
        ],
        "summary": "Get played movies of user",
        "description": "Get all played movies and their watch dates.",
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "description": "Name of user",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "The search term",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Limit",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 24
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "Sort by",
            "required": false,
            "schema": {
              "type": "string",
              "default": "title",
              "enum": [
                "addedAt",
                "rating",
                "releaseDate",
                "runtime",
                "title"
              ]
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "Sort order",
            "required": false,
            "schema": {
              "type": "string",
              "default": "asc",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "releaseYear",
            "in": "query",
            "description": "Release year",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application\/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "played": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "movie": {
                            "$ref": "#/components/schemas/movie"
                          },
                          "watchedDates": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "date": {
                                  "$ref": "#/components/schemas/dateNullable"
                                },
                                "plays": {
                                  "$ref": "#/components/schemas/plays"
                                },
                                "comment": {
                                  "$ref": "#/components/schemas/comment"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "currentPage": {
                      "type": "integer",
                      "example": 1
                    },
                    "maxPage": {
                      "type": "integer",
                      "example": 10
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "movaryToken": []
          }
        ]
      },
      "post": {
        "tags": [
          "Played"
        ],
        "summary": "Add movie plays to user",
        "description": "Create or update the provided watch dates for the specified movies.",
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "description": "Name of user",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application\/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "movaryId": {
                      "$ref": "#/components/schemas/id"
                    },
                    "watchDates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "watchedAt": {
                            "$ref": "#/components/schemas/dateNullable"
                          },
                          "plays": {
                            "$ref": "#/components/schemas/playsOptional"
                          },
                          "comment": {
                            "$ref": "#/components/schemas/commentOptional"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "$ref": "#/components/responses/204"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "movaryToken": []
          }
        ]
      },
      "put": {
        "tags": [
          "Played"
        ],
        "summary": "Replace movie plays for user",
        "description": "Create or replace the provided watch dates for the specified movies.",
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "description": "Name of user",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application\/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "movaryId": {
                      "$ref": "#/components/schemas/id"
                    },
                    "watchDates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "watchedAt": {
                            "$ref": "#/components/schemas/dateNullable"
                          },
                          "plays": {
                            "$ref": "#/components/schemas/plays"
                          },
                          "comment": {
                            "$ref": "#/components/schemas/comment"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "$ref": "#/components/responses/204"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "movaryToken": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Played"
        ],
        "summary": "Delete movie plays from user",
        "description": "Delete all watch dates of specified movies if no specific watch dates are provided.",
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "description": "Name of user",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application\/json": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "movaryId": {
                      "$ref": "#/components/schemas/id"
                    },
                    "watchDates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/dateNullable"
                      },
                      "required": false
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "$ref": "#/components/responses/204"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "movaryToken": []
          }
        ]
      }
    },
    "\/movies\/add": {
      "post": {
        "tags": [
          "Movies"
        ],
        "summary": "Add movie via external provider id",
        "description": "Adds a new movie via external data provider",
        "requestBody": {
          "content": {
            "application\/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tmdbId": {
                    "$ref": "#/components/schemas/id"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application\/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "movaryId": {
                      "$ref": "#/components/schemas/id"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "movaryToken": []
          }
        ]
      }
    },
    "\/movies\/search": {
      "get": {
        "tags": [
          "Movies"
        ],
        "summary": "Search for movies remotely",
        "description": "Search remotely on tmdb for the movie with the specified search filters. Movies already existing locally will have a Movary id set.",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "description": "The search term",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Search result page",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "releaseYear",
            "in": "query",
            "description": "Filter by release year",
            "required": false,
            "schema": {
              "type": "integer",
              "example": 2012
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application\/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "$ref": "#/components/schemas/title"
                          },
                          "originalTitle": {
                            "type": "string",
                            "example": "千と千尋の神隠し"
                          },
                          "releaseDate": {
                            "$ref": "#/components/schemas/releaseDateNullable"
                          },
                          "overview": {
                            "$ref": "#/components/schemas/overview"
                          },
                          "originalLanguage": {
                            "type": "string",
                            "example": "en"
                          },
                          "tmdbPosterPath": {
                            "type": "string",
                            "example": "/gb7C4oRzYWXWCuZMR1cwtHa53Pz.jpg"
                          },
                          "ids": {
                            "type": "object",
                            "properties": {
                              "movary": {
                                "$ref": "#/components/schemas/idNullable"
                              },
                              "tmdb": {
                                "$ref": "#/components/schemas/id"
                              }
                            }
                          },
                          "isWatched": {
                            "type": "boolean",
                            "description": "True if user has watched the movie, false if not.",
                            "example": false
                          },
                          "isOnWatchlist": {
                            "type": "boolean",
                            "description": "True if user has the movie on the watchlist, false if not.",
                            "example": false
                          }
                        }
                      }
                    },
                    "currentPage": {
                      "type": "integer",
                      "example": 1
                    },
                    "maxPage": {
                      "type": "integer",
                      "example": 10
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "movaryToken": []
          }
        ]
      }
    },
    "/webhook/plex/{uuid}": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "description": "Endpoint to scrobble your Plex watches to Movary.",
        "parameters": [
          {
            "name": "UUID",
            "in": "query",
            "description": "An UUID that is generated by the user in the Plex settings.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      }
    },
    "/webhook/jellyfin/{uuid}": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "description": "Endpoint to scrobble your Jellyfin watches to Movary.",
        "parameters": [
          {
            "name": "UUID",
            "in": "query",
            "description": "An UUID that is generated by the user in the Jellyfin settings.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      }
    },
    "/webhook/emby/{uuid}": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "description": "Endpoint to scrobble your Emby watches to Movary.",
        "parameters": [
          {
            "name": "UUID",
            "in": "query",
            "description": "An UUID that is generated by the user in the Emby settings.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      }
    },
    "/webhook/kodi/{uuid}": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "description": "Endpoint to scrobble your Kodi watches to Movary.",
        "parameters": [
          {
            "name": "UUID",
            "in": "query",
            "description": "An UUID that is generated by the user in the Kodi settings.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      }
    },
    "/authentication/token": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Get authentication data",
        "description": "Get information about the user authenticated by the supplied personal API token.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "description": "The name of the user"
                        },
                        "id": {
                          "type": "integer",
                          "description": "The id of the user"
                        },
                        "isAdmin": {
                          "type": "boolean",
                          "description": "True if user is an admin, false if not."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/401"
          }
        },
        "security": [
          {
            "bearerToken": []
          },
          {
            "movaryToken": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "movie": {
        "type": "object",
        "properties": {
          "title": {
            "$ref": "#/components/schemas/title"
          },
          "originalTitle": {
            "type": "string",
            "nullable": true,
            "example": "千と千尋の神隠し"
          },
          "releaseDate": {
            "$ref": "#/components/schemas/releaseDateNullable"
          },
          "tagline": {
            "type": "string",
            "nullable": true
          },
          "overview": {
            "$ref": "#/components/schemas/overview"
          },
          "originalLanguage": {
            "type": "string",
            "nullable": true
          },
          "runtime": {
            "type": "integer",
            "nullable": true
          },
          "posterPath": {
            "type": "string",
            "nullable": true
          },
          "ids": {
            "type": "object",
            "properties": {
              "movary": {
                "$ref": "#/components/schemas/id"
              },
              "tmdb": {
                "$ref": "#/components/schemas/idNullable"
              },
              "trakt": {
                "$ref": "#/components/schemas/idNullable"
              },
              "imdb": {
                "type": "string",
                "nullable": true
              },
              "letterboxd": {
                "type": "string",
                "nullable": true
              }
            }
          },
          "userRating": {
            "type": "integer",
            "nullable": true,
            "minimum": 1,
            "maximum": 10
          },
          "externalRatings": {
            "type": "object",
            "properties": {
              "tmdb": {
                "type": "object",
                "properties": {
                  "average": {
                    "type": "number"
                  },
                  "count": {
                    "type": "integer"
                  }
                }
              },
              "imdb": {
                "type": "object",
                "properties": {
                  "average": {
                    "type": "number"
                  },
                  "count": {
                    "type": "integer"
                  }
                }
              }
            }
          },
          "updatedAt": {
            "$ref": "#/components/schemas/dateNullable"
          },
          "createdAt": {
            "$ref": "#/components/schemas/date"
          }
        }
      },
      "id": {
        "type": "integer",
        "example": 42
      },
      "idNullable": {
        "type": "integer",
        "example": 42,
        "nullable": true
      },
      "plays": {
        "type": "integer",
        "example": 1
      },
      "playsOptional": {
        "type": "integer",
        "example": 1,
        "default": 1,
        "required": false
      },
      "title": {
        "type": "string",
        "example": "Matrix"
      },
      "releaseDateNullable": {
        "type": "string",
        "example": "2004-12-07",
        "nullable": true
      },
      "overview": {
        "type": "string",
        "example": "Lorem ipsum",
        "nullable": true
      },
      "comment": {
        "type": "string",
        "example": "This is a comment",
        "nullable": true
      },
      "commentOptional": {
        "type": "string",
        "example": "This is a comment",
        "nullable": true,
        "default": null,
        "required": false
      },
      "position": {
        "type": "number",
        "example": 1,
        "nullable": false
      },
      "positionOptional": {
        "type": "number",
        "example": 1,
        "nullable": true,
        "default": 1,
        "required": false
      },
      "date": {
        "type": "string",
        "example": "2023-07-02"
      },
      "dateNullable": {
        "type": "string",
        "nullable": true,
        "example": "2023-07-02"
      }
    },
    "responses": {
      "204": {
        "description": "Successful operation, response has no content"
      },
      "400": {
        "description": "The request payload or header are not correct",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string",
                  "description": "The error type",
                  "example": "ErrorType"
                },
                "message": {
                  "type": "string",
                  "description": "The error message",
                  "example": "This is the error message"
                }
              }
            }
          }
        }
      },
      "401": {
        "description": "A personal API credential is missing or invalid",
        "headers": {
          "WWW-Authenticate": {
            "schema": {
              "type": "string",
              "example": "Bearer"
            }
          }
        }
      },
      "403": {
        "description": "The authenticated user is not authorized to access the resource"
      },
      "404": {
        "description": "The resource was not found"
      }
    },
    "securitySchemes": {
      "bearerToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "Personal API token supplied as an Authorization Bearer credential."
      },
      "movaryToken": {
        "type": "apiKey",
        "name": "X-Movary-Token",
        "in": "header",
        "description": "Personal API token supplied in Movary's custom header. This remains supported for reverse proxies that use Authorization for Basic authentication."
      }
    }
  }
}
