openapi docs

This commit is contained in:
Sebastian Hugentobler 2025-07-02 22:06:16 +02:00
parent 41206abac1
commit 9cf671ac94
Signed by: shu
SSH key fingerprint: SHA256:ppcx6MlixdNZd5EUM1nkHOKoyQYoJwzuQKXM6J/t66M
8 changed files with 15 additions and 0 deletions

View file

@ -36,6 +36,7 @@ impl HttpStatus for RetrieveError {
}
http_error!(RetrieveError);
/// Get the first page of all authors.
#[utoipa::path(
get,
path = "/authors",
@ -51,6 +52,7 @@ pub async fn handler_init(State(state): State<Arc<AppState>>) -> Result<Response
.context(AuthorsSnafu)
}
/// Get a paginated list of all authors.
#[utoipa::path(
get,
path = "/authors/{cursor}/{sort_order}",
@ -113,6 +115,7 @@ impl HttpStatus for SingleError {
}
http_error!(SingleError);
/// Get a single author and all their books.
#[utoipa::path(
get,
path = "/authors/{id}",

View file

@ -38,6 +38,7 @@ impl HttpStatus for RetrieveError {
}
http_error!(RetrieveError);
/// Get the first page of all books.
#[utoipa::path(
get,
path = "/books",
@ -53,6 +54,7 @@ pub async fn handler_init(State(state): State<Arc<AppState>>) -> Result<Response
.context(BooksSnafu)
}
/// Get a paginated list of all books.
#[utoipa::path(
get,
path = "/books/{cursor}/{sort_order}",
@ -134,6 +136,7 @@ impl HttpStatus for DownloadError {
}
http_error!(DownloadError);
/// Download a book file in the specified format.
#[utoipa::path(
get,
path = "/book/{id}/{format}",

View file

@ -41,6 +41,7 @@ impl HttpStatus for RetrieveError {
}
http_error!(RetrieveError);
/// Get the thumbnail for a book cover.
#[utoipa::path(
get,
path = "/cover/{id}/thumbnail",
@ -67,6 +68,7 @@ pub async fn thumbnail(
.context(CoverSnafu)
}
/// Get the full-size cover for a book.
#[utoipa::path(
get,
path = "/cover/{id}",

View file

@ -44,6 +44,7 @@ pub struct Params {
/// Query for a search request.
query: String,
}
/// Search for books based on a query.
#[utoipa::path(
get,
path = "/search",

View file

@ -36,6 +36,7 @@ impl HttpStatus for RetrieveError {
}
http_error!(RetrieveError);
/// Get the first page of all series.
#[utoipa::path(
get,
path = "/series",
@ -51,6 +52,7 @@ pub async fn handler_init(State(state): State<Arc<AppState>>) -> Result<Response
.context(SeriesSnafu)
}
/// Get a paginated list of all series.
#[utoipa::path(
get,
path = "/series/{cursor}/{sort_order}",
@ -113,6 +115,7 @@ impl HttpStatus for SingleError {
}
http_error!(SingleError);
/// Get a single series and all its books.
#[utoipa::path(
get,
path = "/series/{id}",

View file

@ -43,6 +43,7 @@ impl HttpStatus for RecentError {
}
http_error!(RecentError);
/// Get recently added books as an OPDS feed.
#[utoipa::path(
get,
path = "/recent",

View file

@ -50,6 +50,7 @@ pub struct Params {
/// Query for a search request.
query: String,
}
/// Search for books and return results as an OPDS feed.
#[utoipa::path(
get,
path = "/search",

View file

@ -10,6 +10,7 @@ use rust_embed::RustEmbed;
pub struct Files;
/// Get static file from the 'static' folder.
/// Serve a static file.
#[utoipa::path(
get,
path = "/static/{*file}",