[BUG][Warning] [Java] [WebClient] BodyInserters.fromObject is deprecated since Spring 5.2
Created by: kelianClerc
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
Have you tested with the latest master to confirm the issue still exists? -
Have you searched for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
Since Spring 5.2, BodyInserters.fromObject
method has been deprecated.
It is recommended to use BodyInserters.fromValue
instead : see ref
BodyInserters.fromObject is used in ApiClient's selectBody
method :
This leads to a warning during code generation :
[WARNING] COMPILATION WARNING : [INFO] ------------------------------------------------------------- [WARNING] .../src/gen/java/main/org/openapitools/client/ApiClient.java:[483,47] fromObject(T) in org.springframework.web.reactive.function.BodyInserters has been deprecated
openapi-generator version
5.0.0
OpenAPI declaration file content or url
Input file doesn't matter here
Generation Details
<configuration>
<generatorName>java</generatorName>
<configOptions>
<sourceFolder>src/gen/java/main</sourceFolder>
<java8>true</java8>
<dateLibrary>java8</dateLibrary>
<library>webclient</library>
<openApiNullable>false</openApiNullable>
</configOptions>
</configuration>
Steps to reproduce
run openapi-generator 5.0.0 with specified generation details
Related issues/PRs
none
Suggest a fix
Replacing :
return obj != null ? BodyInserters.fromObject(obj) : null;
by :
return obj != null ? BodyInserters.fromValue(obj) : null;