Skip to content

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

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