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
(cherry picked from commit d53358a)
  • Loading branch information
geoand authored and gsmet committed Jan 9, 2024
1 parent d8bc51a commit f2f4762
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,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 f2f4762

Please sign in to comment.