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/artist.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/database/artist.rs') 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, - #[schema(example = 3, required = true)] + #[schema(example = "1")] id: Option, } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, ToSchema)] pub struct ArtistPost { + #[schema(example = "artist name", required = true)] name: Option, } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, ToSchema)] pub struct ArtistPut { + #[schema(example = "1", required = true)] id: Option, + #[schema(example = "new name", required = true)] name: Option, } -- cgit v1.2.3