Skip to content

@BeanParam enum field losing type and enum when @Schema(defaultValue)…#2596

Open
Pepo48 wants to merge 1 commit into
smallrye:mainfrom
Pepo48:issue-2595
Open

@BeanParam enum field losing type and enum when @Schema(defaultValue)…#2596
Pepo48 wants to merge 1 commit into
smallrye:mainfrom
Pepo48:issue-2595

Conversation

@Pepo48

@Pepo48 Pepo48 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

… is set

  • merge type, enum and format from the Java field type into the existing partial schema when it has no type set

Closes: #2595

… is set

* merge type, enum and format from the Java field type into the existing partial schema when it has no type set

Closes: smallrye#2595

Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
76.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@MikeEdgar MikeEdgar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR @Pepo48 . I plan to review later today/tomorrow. I'm wondering if this issue affects schema handling generally and not just for parameters. E.g. does it happen for a property within another schema as well?

@Pepo48

Pepo48 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@MikeEdgar I also wondered about this earlier and at least based on what I see from my research is that it doesn't affect schema properties. The POJO property pipeline handles this correctly via TypeProcessor.processType(), which resolves enums before @Schema is read.

The bug is in mapParameterSchema() in AbstractParameterProcessor, which handles all parameter types, not just @BeanParam fields. Verified on @QueryParam and @HeaderParam, both as @BeanParam fields and direct method arguments. In all cases, parameterHasSchema() returns early when any schema object exists, skipping type resolution entirely.

But, please, recheck this thoroughly, just to be on the safe side. 😊

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.

@Schema(defaultValue) inside @Parameter on @BeanParam field loses type and enum

2 participants