Skip to content

fix: prevent leaking container validation annotations - #3322

Open
Mattias-Sehlstedt wants to merge 1 commit into
springdoc:mainfrom
Mattias-Sehlstedt:leaking-container-validations
Open

fix: prevent leaking container validation annotations#3322
Mattias-Sehlstedt wants to merge 1 commit into
springdoc:mainfrom
Mattias-Sehlstedt:leaking-container-validations

Conversation

@Mattias-Sehlstedt

Copy link
Copy Markdown
Contributor

Adds so that the method parameter annotations are read with methodParameter.getParameter().getAnnotatedType() so that it is considered when handling the schema at the resolver.

The issue before was that the annotation was entirely missing in the resolving stage, which lead to schema being cached with the annotation present (which is an issue since the key calculation does not consider any annotations). This in turn lead to the schema being re-resolved with constraints already present, which then meant that they would all share the constraint that was last applied to the object.

The new behavior matches how the constraint annotation application done in applyBeanValidatorAnnotations finds the annotations that it should apply to the schema.

Fixes: #3318

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.

@Pattern on @RequestParam List<@Pattern String> leaks to sibling array parameters (incomplete fix from #3259)

1 participant