From 24f27e4f080a79fa686df39fce0e05f5fe85da83 Mon Sep 17 00:00:00 2001 From: Antoine Gersant <antoine.gersant@lesforges.org> Date: Wed, 15 Jan 2025 21:35:42 -0800 Subject: [PATCH] Utoipa tag descriptions --- src/server/doc.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/server/doc.rs b/src/server/doc.rs index add86b0..de3c518 100644 --- a/src/server/doc.rs +++ b/src/server/doc.rs @@ -1,5 +1,6 @@ use utoipa::openapi::{ security::{ApiKey, ApiKeyValue, HttpAuthScheme, HttpBuilder, SecurityScheme}, + tag::TagBuilder, ComponentsBuilder, ContactBuilder, InfoBuilder, License, OpenApi, OpenApiBuilder, }; @@ -17,6 +18,32 @@ pub fn open_api() -> OpenApi { )) .build(), ) + .tags(Some([ + TagBuilder::new() + .name("Collection") + .description(Some("These endpoints provide information about the available songs, albums, artists and genres.")) + .build(), + TagBuilder::new() + .name("Media") + .description(Some("These endpoints serve song audio and album covers.")) + .build(), + TagBuilder::new() + .name("User Management") + .description(Some("These endpoints can be used to manage or sign in users of this Polaris server.")) + .build(), + TagBuilder::new() + .name("File Browser") + .description(Some("These endpoints allow the music collection to be browsed according to its file hierarchy.")) + .build(), + TagBuilder::new() + .name("Configuration") + .description(Some("These endpoints allow administrators to manage the server's configuration.")) + .build(), + TagBuilder::new() + .name("Playlists") + .description(Some("These endpoints allow users to create, retrieve, update or delete playlists.")) + .build(), + ])) .components(Some( ComponentsBuilder::new() .security_scheme(