poem icon indicating copy to clipboard operation
poem copied to clipboard

Support more basic types, even customized structs in oai parameter

Open RWDai opened this issue 1 year ago • 2 comments

Description of the feature

https://docs.rs/poem-openapi/latest/poem_openapi/derive.Object.html oai parameter default is only support bool,string. Can we support more basic types, even customized structs?

Code example (if possible)

/// example
#[derive(Object)]
struct example {
    
    id: String,

    #[oai(default=3306)]
    mysql_port: u32,
}

RWDai avatar Mar 07 '23 06:03 RWDai

Maybe looks like https://github.com/serde-rs/serde/issues/368 ?

attila-lin avatar Mar 11 '23 04:03 attila-lin

Maybe looks like https://github.com/serde-rs/serde/issues/368 ?

yes,is it feasible?

RWDai avatar Mar 11 '23 04:03 RWDai