Skip to content

Support extensions in utoipa::ToSchema named structs - #1593

Open
TilBlechschmidt wants to merge 1 commit into
juhaku:masterfrom
TilBlechschmidt:feature/toschema-extensions
Open

Support extensions in utoipa::ToSchema named structs#1593
TilBlechschmidt wants to merge 1 commit into
juhaku:masterfrom
TilBlechschmidt:feature/toschema-extensions

Conversation

@TilBlechschmidt

Copy link
Copy Markdown

Hi! 👋

With this PR I would like to add the support for OpenAPI extensions to the ToSchema macro. The functionality is limited to named structs as I was unsure about the implications of enabling it for the other kinds as well.

#[derive(ToSchema)]
struct HelloWorld {
    #[schema(extensions(
        ("x-terraform-requires-replace" = json!(true))
    ))]
    id: u32
}

Due to the prior work, the change is rather minimal and simply ties in the existing attribute parser into the schema macro.


Prior work:

@TilBlechschmidt
TilBlechschmidt force-pushed the feature/toschema-extensions branch from bc8903c to 21d1bbf Compare August 17, 2026 09:27
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