OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
22.01k stars 6.6k forks source link

[Java][webclient] javadoc warnings #8976

Open wing328 opened 3 years ago

wing328 commented 3 years ago
Description

To address the following javadoc warnings:

/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java:142: warning: no @param for mapper
    public static WebClient buildWebClient(ObjectMapper mapper) {
                            ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java:325: warning: no @param for str
    public Date parseDate(String str) {
                ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java:325: warning: no @return
    public Date parseDate(String str) {
                ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java:336: warning: no @param for date
    public String formatDate(Date date) {
                  ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java:336: warning: no @return
    public String formatDate(Date date) {
                  ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java:526: warning: no @param for cookieParams
    public <T> Mono<T> invokeAPI(String path, HttpMethod method, Map<String, Object> pathParams, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames, ParameterizedTypeReference<T> returnType) throws RestClientException {
                       ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java:548: warning: no @param for cookieParams
    public <T> Flux<T> invokeFluxAPI(String path, HttpMethod method, Map<String, Object> pathParams, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames, ParameterizedTypeReference<T> returnType) throws RestClientException {
                       ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java:63: warning: no @return
    public Mono<Void> createXmlItem(XmlItem xmlItem) throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java:216: warning: no @return
    public Mono<Void> testBodyWithFileSchema(FileSchemaTestClass body) throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java:250: warning: no @return
    public Mono<Void> testBodyWithQueryParams(String query, User body) throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java:339: warning: no @return
    public Mono<Void> testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java:421: warning: no @return
    public Mono<Void> testEnumParameters(List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List<String> enumFormStringArray, String enumFormString) throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java:469: warning: no @return
    public Mono<Void> testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java:517: warning: no @return
    public Mono<Void> testInlineAdditionalProperties(Map<String, String> param) throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java:551: warning: no @return
    public Mono<Void> testJsonFormData(String param, String param2) throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java:597: warning: no @return
    public Mono<Void> testQueryParameterCollectionFormat(List<String> pipe, List<String> ioutil, List<String> http, List<String> url, List<String> context) throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java:59: warning: no @return
    public Mono<Void> addPet(Pet body) throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java:94: warning: no @return
    public Mono<Void> deletePet(Long petId, String apiKey) throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java:244: warning: no @return
    public Mono<Void> updatePet(Pet body) throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java:279: warning: no @return
    public Mono<Void> updatePetWithForm(Long petId, String name, String status) throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/StoreApi.java:56: warning: no @return
    public Mono<Void> deleteOrder(String orderId) throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java:55: warning: no @return
    public Mono<Void> createUser(User body) throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java:86: warning: no @return
    public Mono<Void> createUsersWithArrayInput(List<User> body) throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java:117: warning: no @return
    public Mono<Void> createUsersWithListInput(List<User> body) throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java:149: warning: no @return
    public Mono<Void> deleteUser(String username) throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java:262: warning: no @return
    public Mono<Void> logoutUser() throws WebClientResponseException {
                      ^
/Users/williamcheng/Code/openapi-generator2/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java:291: warning: no @return
    public Mono<Void> updateUser(String username, User body) throws WebClientResponseException {
                      ^
27 warnings
openapi-generator version

latest master

OpenAPI declaration file content or url

petstore spec

Command line used for generation
Steps to reproduce

Run gradle build or mvn clen package in samples/client/petstore/java/webclient/

Related issues/PRs
Suggest a fix/enhancement

Fix the warnings by updating the docstrings in the templates.

pgrabowski commented 2 years ago

Needed this change to reproduce locally:

git diff
diff --git a/samples/client/petstore/java/webclient/pom.xml b/samples/client/petstore/java/webclient/pom.xml
index c020fc7f7e..0daa9d5d53 100644
--- a/samples/client/petstore/java/webclient/pom.xml
+++ b/samples/client/petstore/java/webclient/pom.xml
@@ -38,8 +38,8 @@
                 <artifactId>maven-compiler-plugin</artifactId>
                 <version>3.6.1</version>
                 <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
+                    <source>11</source>
+                    <target>11</target>
                 </configuration>
             </plugin>
             <plugin>