From c622eab39ac7dd9f794b5d60eb937e29c9b3bd6e Mon Sep 17 00:00:00 2001 From: niliara-edu Date: Sun, 26 Jan 2025 19:11:24 +0100 Subject: add api documentation --- src/database/song.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/database/song.rs') diff --git a/src/database/song.rs b/src/database/song.rs index 95b05ba..a4c860c 100644 --- a/src/database/song.rs +++ b/src/database/song.rs @@ -5,27 +5,41 @@ use utoipa::ToSchema; #[derive(Serialize, ToSchema)] pub struct Song { + #[schema(example = "song name")] name: Option, + #[schema(example = "1")] id: Option, + #[schema(example = "song lyrics...")] lyrics: Option, + #[schema(example = "album name")] album_name: Option, + #[schema(example = "1")] album_id: Option, + #[schema(example = "artist name")] artist_name: Option, + #[schema(example = "1")] artist_id: Option, } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, ToSchema)] pub struct SongPost { + #[schema(example = "song name")] name: Option, + #[schema(example = "song lyrics...")] lyrics: Option, + #[schema(example = "1")] album_id: Option, } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, ToSchema)] pub struct SongPut { + #[schema(example = "1")] id: Option, + #[schema(example = "song name")] name: Option, + #[schema(example = "song lyrics...")] lyrics: Option, + #[schema(example = "1")] album_id: Option, } -- cgit v1.2.3