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.
const TAG: &str = "little-hesinde";
const TAG: &str = "html";
const OPDS_TAG: &str = "opds";
/// OpenAPI documentation configuration.
#[derive(OpenApi)]
@ -51,7 +52,8 @@ const TAG: &str = "little-hesinde";
)
),
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;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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