Skip to content

Allow duplicate query parameters #2380

Answered by jplatte
LuckyTurtleDev asked this question in Q&A
Discussion options

You must be logged in to vote

You can use axum_extra::extract::Query (not the same as axum::extract::Query) if you change your QueryData definition to

#[derive(Deserialize)]
pub struct QueryData {
    #[serde(default)]
    theme: Vec<Theme>,
    id: u64
}

It's also possible to write a custom deserialization function that only extracts the first item from a sequence, but that's not as simple.

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@anarchodin
Comment options

Comment options

You must be logged in to vote
4 replies
@LuckyTurtleDev
Comment options

@jplatte
Comment options

@LuckyTurtleDev
Comment options

@jplatte
Comment options

Answer selected by LuckyTurtleDev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants