utoipa icon indicating copy to clipboard operation
utoipa copied to clipboard

Params Vec<String> are not passed to swaggerUI correctly

Open DerZwergGimli opened this issue 7 months ago • 2 comments

    #[derive(Debug, Deserialize, IntoParams)]
    pub struct VecTEST {
        mint_assets: Vec<std::string::String>,
    }

  #[utoipa::path(
    get,
    path = "/vec_test",
    params(VecTEST),
    responses(
    (status = 200, description = "List todos successfully")
    )
    )]
    pub async fn vec_test(query: VecTEST) -> Result<impl Reply, Infallible> {
        Ok(warp::reply::json(&json!(query.mint_assets)))
    }
utoipa = { version = "4.1.0", features = ["chrono"] }
utoipa-swagger-ui = "4.0.0"

results in this swagger-ui:

image

DerZwergGimli avatar Nov 24 '23 18:11 DerZwergGimli

Does the Warp work with arrays in the query parameters correctly?

Most frameworks without crutches do not work with arrays in the query parameters and offer to work with POST for pass arrays

dayvejones avatar Nov 28 '23 21:11 dayvejones

Ok then i will try to change that from a GET to a POST and come back if there are still issues

DerZwergGimli avatar Dec 04 '23 12:12 DerZwergGimli