salvo-rs/salvo

`required` attribute for salvo_oapi endpoint macro

YorKnEz opened this issue · 2 comments

According to docs of params_attributes, there is no way of setting the required flag of a query param off. I would like an attribute that does that.

For example, I want to be able to say:

#[endpoint(parameters(("test" = String, Query, required = false)))]

Use Option<String>.

#[endpoint(parameters(("test" = Option<String>, Query, )))]

How did I not think of that.. thank you very much