Код: Выделить всё
private Mono doBody(
WebClient.RequestHeadersSpec client, Method method, String methodName,
Object[] arguments) {
if (client instanceof WebClient.RequestBodySpec bodySpec) {
String contentType = metadata.getContentTypes().get(methodName);
for (ApiBodyResolver bodyResolver : bodyResolvers) {
if (bodyResolver.canResolve(contentType)) {
return bodyResolver.resolve(method, arguments)
.map(bodySpec::body).switchIfEmpty((Mono.just(client));
}
}
}
return Mono.just(client);
}
Код: Выделить всё
Inconvertible types; cannot cast 'reactor. core. publisher. Mono
Подробнее здесь: [url]https://stackoverflow.com/questions/79118981/intellij-idea-show-inconvertible-types-on-webflux-switchifempty[/url]
Мобильная версия