utoipa icon indicating copy to clipboard operation
utoipa copied to clipboard

[Feature Request] Custom Args and More

Open i007c opened this issue 1 year ago • 0 comments

this is a very nice crate. however it lacks some feature such as adding custom variables to the schema and using them to add or remove items from the schema during the modify step. for example i put all of the user api in a file like api/user.rs. and every path in this file will be under the /user path. so its kind of wired to add context_url for all the paths. its way nicer to just use a modifier.

im currently using the first servers values as my context url

#[derive(OpenApi)]
#[openapi(
    tags((name = "api::user")),
    paths(login, user_get), 
    components(schemas(User)),
    servers((url = "/user")),
    modifiers(&UpdatePaths)
)]
pub struct ApiUserDoc;

and i also add the ApiUserDoc tags to all the paths under it.

some custom arguments would be very use full for automaticly adding or removing thigs from each path or the hole schmea

i007c avatar Mar 10 '24 10:03 i007c