Skip to content

Commit

Permalink
Don't want about missing JSON when returning String
Browse files Browse the repository at this point in the history
Closes: #38044
  • Loading branch information
geoand committed Jan 5, 2024
1 parent e87a492 commit d53358a
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 d53358a

Please sign in to comment.