Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle @APIResponseSchema without generated content #1054

Merged

Conversation

MikeEdgar
Copy link
Member

Fixes #1026

@MikeEdgar MikeEdgar added this to the 2.1.18 milestone Feb 15, 2022
Comment on lines +194 to +196

if (CurrentScannerInfo.getCurrentProduces() != null && !TypeUtil.isVoid(responseType)) {
// Only generate the content if the endpoint declares an @Produces media type
Copy link
Member Author

Choose a reason for hiding this comment

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

Checking void doesn't really enable anything that couldn't be done with @APIResponse, but reduces surprises if void.class is given as the value for @APIResponseSchema and there is @Produces annotation.

@MikeEdgar MikeEdgar force-pushed the 1026_npe_when_produces_missing branch from 37cd19b to 14bee58 Compare February 15, 2022 21:21
Copy link
Member

@phillip-kruger phillip-kruger left a comment

Choose a reason for hiding this comment

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

LGTM

@phillip-kruger phillip-kruger merged commit 7bec9a8 into smallrye:main Feb 16, 2022
@MikeEdgar MikeEdgar deleted the 1026_npe_when_produces_missing branch February 16, 2022 10: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.

NPE when @Produces is missing
2 participants