summaryrefslogtreecommitdiff
path: root/src/database/song.rs
diff options
context:
space:
mode:
authorniliara-edu <nil.jimeno@estudiant.fjaverianas.com>2025-01-26 19:11:24 +0100
committerniliara-edu <nil.jimeno@estudiant.fjaverianas.com>2025-01-26 19:11:24 +0100
commitc622eab39ac7dd9f794b5d60eb937e29c9b3bd6e (patch)
treea75067a661250a4ed74096929083948f65c01fdb /src/database/song.rs
parent5891af7e8c1411029fe1ad9c6d3182f88bcf3dfd (diff)
add api documentation
Diffstat (limited to 'src/database/song.rs')
-rw-r--r--src/database/song.rs18
1 files changed, 16 insertions, 2 deletions
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<String>,
+ #[schema(example = "1")]
id: Option<i32>,
+ #[schema(example = "song lyrics...")]
lyrics: Option<String>,
+ #[schema(example = "album name")]
album_name: Option<String>,
+ #[schema(example = "1")]
album_id: Option<i32>,
+ #[schema(example = "artist name")]
artist_name: Option<String>,
+ #[schema(example = "1")]
artist_id: Option<i32>,
}
-#[derive(Serialize, Deserialize)]
+#[derive(Serialize, Deserialize, ToSchema)]
pub struct SongPost {
+ #[schema(example = "song name")]
name: Option<String>,
+ #[schema(example = "song lyrics...")]
lyrics: Option<String>,
+ #[schema(example = "1")]
album_id: Option<String>,
}
-#[derive(Serialize, Deserialize)]
+#[derive(Serialize, Deserialize, ToSchema)]
pub struct SongPut {
+ #[schema(example = "1")]
id: Option<String>,
+ #[schema(example = "song name")]
name: Option<String>,
+ #[schema(example = "song lyrics...")]
lyrics: Option<String>,
+ #[schema(example = "1")]
album_id: Option<String>,
}