separate tag for odps routes
Some checks failed
Build Multiarch Container Image / call-reusable-workflow (push) Has been cancelled

This commit is contained in:
Sebastian Hugentobler 2025-07-02 22:12:42 +02:00
parent 9cf671ac94
commit 57c0fe706e
Signed by: shu
SSH key fingerprint: SHA256:ppcx6MlixdNZd5EUM1nkHOKoyQYoJwzuQKXM6J/t66M
7 changed files with 23 additions and 15 deletions

View file

@ -40,7 +40,8 @@ impl From<SortOrder> for calibre_db::data::pagination::SortOrder {
} }
/// OpenAPI tag for all endpoints. /// OpenAPI tag for all endpoints.
const TAG: &str = "little-hesinde"; const TAG: &str = "html";
const OPDS_TAG: &str = "opds";
/// OpenAPI documentation configuration. /// OpenAPI documentation configuration.
#[derive(OpenApi)] #[derive(OpenApi)]
@ -51,7 +52,8 @@ const TAG: &str = "little-hesinde";
) )
), ),
tags( tags(
(name = TAG, description = "Browser and OPDS access to a calibre library.") (name = TAG, description = "Browser access to a calibre library."),
(name = OPDS_TAG, description = "OPDS access to a calibre library.")
) )
)] )]
struct ApiDoc; struct ApiDoc;

View file

@ -12,9 +12,10 @@ use time::OffsetDateTime;
use crate::{ use crate::{
APP_NAME, APP_NAME,
api::{ api::{
SortOrder, TAG, SortOrder,
authors::{self, SingleAuthorError}, authors::{self, SingleAuthorError},
error::{ErrorResponse, HttpStatus}, error::{ErrorResponse, HttpStatus},
OPDS_TAG,
}, },
app_state::AppState, app_state::AppState,
http_error, http_error,
@ -48,7 +49,7 @@ http_error!(AuthorsError);
#[utoipa::path( #[utoipa::path(
get, get,
path = "/authors", path = "/authors",
tag = TAG, tag = OPDS_TAG,
responses( responses(
(status = OK, content_type = "application/atom+xml"), (status = OK, content_type = "application/atom+xml"),
(status = 500, description = "Server failure.", body = ErrorResponse) (status = 500, description = "Server failure.", body = ErrorResponse)
@ -107,7 +108,7 @@ http_error!(SingleError);
#[utoipa::path( #[utoipa::path(
get, get,
path = "/authors/{id}", path = "/authors/{id}",
tag = TAG, tag = OPDS_TAG,
responses( responses(
(status = OK, content_type = "application/atom+xml"), (status = OK, content_type = "application/atom+xml"),
(status = 500, description = "Server failure.", body = ErrorResponse) (status = 500, description = "Server failure.", body = ErrorResponse)

View file

@ -12,8 +12,9 @@ use time::OffsetDateTime;
use crate::{ use crate::{
APP_NAME, APP_NAME,
api::{ api::{
SortOrder, TAG, SortOrder,
error::{ErrorResponse, HttpStatus}, error::{ErrorResponse, HttpStatus},
OPDS_TAG,
}, },
app_state::AppState, app_state::AppState,
data::book::Book, data::book::Book,
@ -48,7 +49,7 @@ http_error!(OdpsBooksError);
#[utoipa::path( #[utoipa::path(
get, get,
path = "/books", path = "/books",
tag = TAG, tag = OPDS_TAG,
responses( responses(
(status = OK, content_type = "application/atom+xml"), (status = OK, content_type = "application/atom+xml"),
(status = 500, description = "Server failure.", body = ErrorResponse) (status = 500, description = "Server failure.", body = ErrorResponse)

View file

@ -11,9 +11,9 @@ use time::OffsetDateTime;
use crate::{ use crate::{
APP_NAME, APP_NAME,
api::{ api::{
TAG,
books::{self, RecentBooksError}, books::{self, RecentBooksError},
error::{ErrorResponse, HttpStatus}, error::{ErrorResponse, HttpStatus},
OPDS_TAG,
}, },
app_state::AppState, app_state::AppState,
http_error, http_error,
@ -47,7 +47,7 @@ http_error!(RecentError);
#[utoipa::path( #[utoipa::path(
get, get,
path = "/recent", path = "/recent",
tag = TAG, tag = OPDS_TAG,
responses( responses(
(status = OK, content_type = "application/atom+xml"), (status = OK, content_type = "application/atom+xml"),
(status = 500, description = "Server failure.", body = ErrorResponse) (status = 500, description = "Server failure.", body = ErrorResponse)

View file

@ -12,9 +12,9 @@ use super::books::{RenderError, render_books};
use crate::{ use crate::{
APP_NAME, APP_NAME,
api::{ api::{
TAG,
error::{ErrorResponse, HttpStatus}, error::{ErrorResponse, HttpStatus},
search::{self, SearchQueryError}, search::{self, SearchQueryError},
OPDS_TAG,
}, },
app_state::AppState, app_state::AppState,
http_error, http_error,
@ -54,7 +54,7 @@ pub struct Params {
#[utoipa::path( #[utoipa::path(
get, get,
path = "/search", path = "/search",
tag = TAG, tag = OPDS_TAG,
responses( responses(
(status = 200, content_type = "application/atom+xml"), (status = 200, content_type = "application/atom+xml"),
(status = 500, description = "Error retrieving books from database", body = ErrorResponse) (status = 500, description = "Error retrieving books from database", body = ErrorResponse)
@ -92,7 +92,7 @@ http_error!(InfoError);
#[utoipa::path( #[utoipa::path(
get, get,
path = "/search/info", path = "/search/info",
tag = TAG, tag = OPDS_TAG,
responses( responses(
(status = 200, content_type = "application/atom+xml"), (status = 200, content_type = "application/atom+xml"),
(status = 500, description = "Internal error", body = ErrorResponse) (status = 500, description = "Internal error", body = ErrorResponse)

View file

@ -12,9 +12,10 @@ use time::OffsetDateTime;
use crate::{ use crate::{
APP_NAME, APP_NAME,
api::{ api::{
SortOrder, TAG, SortOrder,
error::{ErrorResponse, HttpStatus}, error::{ErrorResponse, HttpStatus},
series::{self, SingleSeriesError}, series::{self, SingleSeriesError},
OPDS_TAG,
}, },
app_state::AppState, app_state::AppState,
http_error, http_error,
@ -48,7 +49,7 @@ http_error!(SeriesError);
#[utoipa::path( #[utoipa::path(
get, get,
path = "/series", path = "/series",
tag = TAG, tag = OPDS_TAG,
responses( responses(
(status = OK, content_type = "application/atom+xml"), (status = OK, content_type = "application/atom+xml"),
(status = 500, description = "Server failure.", body = ErrorResponse) (status = 500, description = "Server failure.", body = ErrorResponse)
@ -107,7 +108,7 @@ http_error!(SingleError);
#[utoipa::path( #[utoipa::path(
get, get,
path = "/series/{id}", path = "/series/{id}",
tag = TAG, tag = OPDS_TAG,
responses( responses(
(status = OK, content_type = "application/atom+xml"), (status = OK, content_type = "application/atom+xml"),
(status = 500, description = "Server failure.", body = ErrorResponse) (status = 500, description = "Server failure.", body = ErrorResponse)

View file

@ -4,6 +4,8 @@ use axum::{
}; };
use rust_embed::RustEmbed; use rust_embed::RustEmbed;
use super::TAG;
/// Embedd static files. /// Embedd static files.
#[derive(RustEmbed)] #[derive(RustEmbed)]
#[folder = "static"] #[folder = "static"]
@ -14,6 +16,7 @@ pub struct Files;
#[utoipa::path( #[utoipa::path(
get, get,
path = "/static/{*file}", path = "/static/{*file}",
tag = TAG,
responses( responses(
(status = 200, description = "Static file"), (status = 200, description = "Static file"),
(status = 404, description = "No such file within 'static'", body = String) (status = 404, description = "No such file within 'static'", body = String)