Skip to content

fix: do not merge type annotations that are also parameter annotations - #3394

Open
jochenberger wants to merge 1 commit into
springdoc:mainfrom
jochenberger:fix-3393
Open

jochenberger wants to merge 1 commit into
springdoc:mainfrom
jochenberger:fix-3393

Conversation

@jochenberger

Copy link
Copy Markdown
Contributor

Since #3377, an annotation applicable to both declarations and types, such as @Valid or @NotNull, is forwarded twice to swagger-core. The duplicate changes the cache key of the resolved schema, so a subtype of a polymorphic parent can be resolved again after its parent and lose its allOf reference.

Fixes #3393

Since springdoc#3377, an annotation applicable to both declarations and types,
such as @Valid or @NotNull, is forwarded twice to swagger-core. The
duplicate changes the cache key of the resolved schema, so a subtype of a
polymorphic parent can be resolved again after its parent and lose its
allOf reference.

Fixes springdoc#3393
* A subtype loses its allOf reference to the polymorphic parent when a controller method
* repeats the @Valid of the interface method it implements.
*/
public class SpringDocApp283Test extends AbstractCommonTest {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The api tests are mainly designed as blackbox tests that verify that the produced specification aligns with the expected one (name derived from test name).

Could we also consider adding a test to v30 so that we ensure that the test numbers align between the two?

This branch has not been deployed

No deployments
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.

Subtype loses allOf reference to its polymorphic parent since 3.2.0 when a controller repeats the interface's @Valid on a @RequestBody

2 participants