Skip to content

Support extensions in utoipa::IntoParams attribute macros#1474

Open
aybeshlikyan wants to merge 3 commits intojuhaku:masterfrom
aybeshlikyan:add-extensions-to-into-params
Open

Support extensions in utoipa::IntoParams attribute macros#1474
aybeshlikyan wants to merge 3 commits intojuhaku:masterfrom
aybeshlikyan:add-extensions-to-into-params

Conversation

@aybeshlikyan
Copy link

Hello! This is my PR addressing the feature I proposed in Issue #1473, adding support to specifying OpenAPI extensions on parameters using the #[into_params] and #[param] attribute macros for structs that derive utoipa::IntoParams.
The implementation follows the form proposed in the issue:

#[derive(Debug, Clone, utoipa::IntoParams)]
#[into_params(parameter_in = Query, extensions(("x-on-all-params" = json!(true))))]
pub struct ParamStruct {
    /// A param.
    pub param_1: i32,

    /// Another param.
    #[param(extensions(("x-on-one-param" = json!({ "key": "value" }))))]
    pub param_2: String,
}

I updated the macro documentation, added unit tests for the various flavors, and updated the example introduced with the feature in #1292, simple-x-extensions.

I couldn't find any special docs about contribution guidelines, please let me know if I'm missing anything!

Closes issue #1473

@aybeshlikyan aybeshlikyan force-pushed the add-extensions-to-into-params branch from e689109 to ce35c52 Compare January 22, 2026 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant