Open jctaveras opened 3 months ago
First of all, thank you for this awesome crate. With that being said, I was wondering how do I get nested objects when retrieving query parameters with Query based on the Parameter Serialization standard?
Query
Let's say we have the following:
use poem::web::Query; use poem_openapi::OpenApi; #[derive(Deserialize, Object)] pub struct Search { #[oai(rename = "search[term]")] pub term: String, #[oai(rename = "search[columns]")] pub columns: Vec<String> } #[derive(Deserialize)] pub struct Params { pub limit: Option<i64>, pub search: Option<Search> } pub struct API; #[OpenApi] impl API { #[oai(path = "/", method = "get")] fn async fn with_search(&self, Query(params): Query<Params>) { // curl http://localhost:PORT/?search[term]=foo&search[columns]=bar,baz println!("{:?}", params.search) // None } }
Is this supported?
First of all, thank you for this awesome crate. With that being said, I was wondering how do I get nested objects when retrieving query parameters with
Query
based on the Parameter Serialization standard?Let's say we have the following:
Is this supported?