Skip to content

Commit

Permalink
Utoipa polish
Browse files Browse the repository at this point in the history
  • Loading branch information
agersant committed Jan 16, 2025
1 parent 96fbde1 commit f5cb3cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/server/axum/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ async fn get_playlists(
("auth_token" = []),
("auth_query_param" = []),
),
params(("name",)),
params(("name", example = "Chill Jazz")),
request_body = dto::SavePlaylistInput,
)]
async fn put_playlist(
Expand Down Expand Up @@ -1057,7 +1057,7 @@ async fn put_playlist(
),
params(
("Accept-Version" = Option<i32>, Header, minimum = 7, maximum = 8),
("name",),
("name", example = "Chill Jazz"),
),
responses(
(status = 200, body = dto::Playlist),
Expand Down Expand Up @@ -1097,7 +1097,7 @@ async fn get_playlist(
("auth_token" = []),
("auth_query_param" = []),
),
params(("name",)),
params(("name", example = "Chill Jazz")),
)]
async fn delete_playlist(
auth: Auth,
Expand Down
3 changes: 2 additions & 1 deletion src/server/dto/v8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ pub struct AuthQueryParameters {

#[derive(Serialize, Deserialize, IntoParams, ToSchema)]
pub struct ThumbnailOptions {
#[schema(examples("tiny", "small", "large", "native"))]
pub size: Option<ThumbnailSize>,
#[schema(examples(true, false))]
pub pad: Option<bool>,
Expand All @@ -65,6 +64,7 @@ impl From<ThumbnailOptions> for thumbnail::Options {

#[derive(Clone, Copy, Serialize, Deserialize, ToSchema)]
#[serde(rename_all = "snake_case")]
#[schema(example = "small")]
pub enum ThumbnailSize {
Tiny,
Small,
Expand Down Expand Up @@ -321,6 +321,7 @@ impl From<index::Song> for Song {
pub struct SongList {
#[schema(value_type = Vec<String>, examples(json!(["my_music/destiny.mp3", "my_music/sos.mp3"])))]
pub paths: Vec<PathBuf>,
/// Detailed metadata about the first few hundred songs listed in `.paths`
pub first_songs: Vec<Song>,
}

Expand Down

0 comments on commit f5cb3cd

Please sign in to comment.