Skip to content

Commit

Permalink
Merge pull request #38049 from geoand/#38044
Browse files Browse the repository at this point in the history
Don't warn about missing JSON when returning String
  • Loading branch information
gsmet authored Jan 5, 2024
2 parents e87a492 + d53358a commit 09e2518
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1630,6 +1630,9 @@ protected void warnAboutMissingJsonProviderIfNeeded(ResourceMethod method, Metho
DefaultProducesHandler jsonDefaultProducersHandler,
DefaultProducesHandler.Context context) {
if (hasJson(method) || (hasNoTypesDefined(method) && isDefaultJson(jsonDefaultProducersHandler, context))) {
if (STRING.toString().equals(method.getSimpleReturnType())) { // when returning string, we assume that the method implementation is actually handling to conversion
return;
}
boolean appProvidedJsonReaderExists = appProvidedJsonProviderExists(getSerializerScanningResult().getReaders());
boolean appProvidedJsonWriterExists = appProvidedJsonProviderExists(getSerializerScanningResult().getWriters());
if (!appProvidedJsonReaderExists || !appProvidedJsonWriterExists) {
Expand Down

0 comments on commit 09e2518

Please sign in to comment.