poem-web / poem

A full-featured and easy-to-use web framework with the Rust programming language.
Apache License 2.0
3.62k stars 295 forks source link

[poem-openapi] Allow for custom openapi extensions #908

Open Zstorm999 opened 2 weeks ago

Zstorm999 commented 2 weeks ago

Description of the feature

There are several points in the openapi specifications where extensions can be specified, in the form of x-extname: https://spec.openapis.org/oas/v3.1.0#specification-extensions

Currently poem-openapi does not allow generating such extensions, it would be nice if it was available.

Code example (if possible)

Example on a route below, it could work the same on data definitions :

#[oai(custom_attr = "x-value = 16")]
fn my_route() -> ... {
    todo!()
}