Skip to content

Remove support for expression ignore in ToSchema and IntoParams - #1619

Merged
juhaku merged 1 commit into
masterfrom
chore-remove-expression-ignore-support
Sep 22, 2026
Merged

juhaku merged 1 commit into
masterfrom
chore-remove-expression-ignore-support

Conversation

@juhaku

@juhaku juhaku commented Sep 22, 2026

Copy link
Copy Markdown
Owner

This commit removes support for expression style ignore attribute from ToSchema and IntoParams macro. This is to fix issue where ignore sometimes did not ignore values, because it was evaluated in runtime and function reference ignore can be evaluated only during runtime but we need to evaluate this at build time thus removing the possibility to define function reference as ignore attribute value.

Breaking

Following syntax demonstrates what was allowed before, but will be not available in new version 6.

// before allowed

fn ignore_always() -> bool {
  true
}

#[derive(ToSchema)]
struct Value {
  #[schema(ignore = ignore_always)]
  field: String
}

@juhaku
juhaku force-pushed the chore-remove-expression-ignore-support branch 2 times, most recently from 76cfd85 to 381c24a Compare September 22, 2026 22:13
Base automatically changed from chore-update-next-versions to master September 22, 2026 22:13
@juhaku
juhaku force-pushed the chore-remove-expression-ignore-support branch from 381c24a to 65fbe82 Compare September 22, 2026 22:14
@juhaku
juhaku merged commit baa4d04 into master Sep 22, 2026
24 checks passed
@juhaku
juhaku deleted the chore-remove-expression-ignore-support branch September 22, 2026 22:24
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