summaryrefslogtreecommitdiff
path: root/src/database/artist.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/artist.rs
parent5891af7e8c1411029fe1ad9c6d3182f88bcf3dfd (diff)
add api documentation
Diffstat (limited to 'src/database/artist.rs')
-rw-r--r--src/database/artist.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/database/artist.rs b/src/database/artist.rs
index 1d4e1cd..0bdc7c1 100644
--- a/src/database/artist.rs
+++ b/src/database/artist.rs
@@ -5,20 +5,23 @@ use utoipa::ToSchema;
#[derive(Serialize, ToSchema)]
pub struct Artist {
- #[schema(example = "Attempt", required = true)]
+ #[schema(example = "artist name")]
name: Option<String>,
- #[schema(example = 3, required = true)]
+ #[schema(example = "1")]
id: Option<i32>,
}
-#[derive(Serialize, Deserialize)]
+#[derive(Serialize, Deserialize, ToSchema)]
pub struct ArtistPost {
+ #[schema(example = "artist name", required = true)]
name: Option<String>,
}
-#[derive(Serialize, Deserialize)]
+#[derive(Serialize, Deserialize, ToSchema)]
pub struct ArtistPut {
+ #[schema(example = "1", required = true)]
id: Option<String>,
+ #[schema(example = "new name", required = true)]
name: Option<String>,
}