From 9f2f36c4fb6c73aa912b3c5f833c61b7866582b1 Mon Sep 17 00:00:00 2001 From: Oleh Kurpiak Date: Sat, 23 Jul 2022 05:20:06 +0300 Subject: [PATCH] [Java][WebClient] return ResponseSpec to manually control response handling (#12843) --- .../Java/libraries/webclient/api.mustache | 29 ++ .../openapitools/client/api/DefaultApi.java | 18 + .../client/api/AnotherFakeApi.java | 20 + .../openapitools/client/api/DefaultApi.java | 18 + .../org/openapitools/client/api/FakeApi.java | 404 ++++++++++++++++++ .../client/api/FakeClassnameTags123Api.java | 20 + .../org/openapitools/client/api/PetApi.java | 210 +++++++++ .../org/openapitools/client/api/StoreApi.java | 85 ++++ .../org/openapitools/client/api/UserApi.java | 166 +++++++ 9 files changed, 970 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache index 7b0922700e4..974f306340c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache @@ -152,10 +152,39 @@ public class {{classname}} { {{^returnType}}{{^vendorExtensions.x-webclient-blocking}}return {{/vendorExtensions.x-webclient-blocking}}{{/returnType}}{{#returnType}}return {{/returnType}}{{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).{{#isArray}}bodyToFlux{{/isArray}}{{^isArray}}bodyToMono{{/isArray}}(localVarReturnType){{#vendorExtensions.x-webclient-blocking}}{{#isArray}}{{#uniqueItems}}.collect(Collectors.toSet()){{/uniqueItems}}{{^uniqueItems}}.collectList(){{/uniqueItems}}{{/isArray}}.block(){{/vendorExtensions.x-webclient-blocking}}; } + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}}{{#returnType}} * @return ResponseEntity<{{.}}> +{{/returnType}} * @throws WebClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ public {{#vendorExtensions.x-webclient-blocking}}{{#returnType}}{{#isArray}}ResponseEntity>{{/isArray}}{{^isArray}}ResponseEntity<{{{returnType}}}>{{/isArray}}{{/returnType}}{{^returnType}}ResponseEntity{{/returnType}} {{/vendorExtensions.x-webclient-blocking}}{{^vendorExtensions.x-webclient-blocking}}{{#returnType}}{{#isArray}}Mono>>{{/isArray}}{{^isArray}}Mono>{{/isArray}}{{/returnType}}{{^returnType}}Mono>{{/returnType}} {{/vendorExtensions.x-webclient-blocking}}{{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { {{#returnType}}ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}> localVarReturnType = new ParameterizedTypeReference<{{#isArray}}{{{returnBaseType}}}{{/isArray}}{{^isArray}}{{{returnType}}}{{/isArray}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {};{{/returnType}} return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).{{#isArray}}toEntityList{{/isArray}}{{^isArray}}toEntity{{/isArray}}(localVarReturnType){{#vendorExtensions.x-webclient-blocking}}.block(){{/vendorExtensions.x-webclient-blocking}}; } + + /** + * {{summary}} + * {{notes}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} +{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} +{{/allParams}} + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API +{{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation +{{/externalDocs}} + */ + public ResponseSpec {{operationId}}WithResponseSpec({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws WebClientResponseException { + return {{operationId}}RequestCreation({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + } {{/operation}} } {{/operations}} diff --git a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/api/DefaultApi.java index 27aa8f5a510..09542762c93 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/webclient-nulable-arrays/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -88,8 +88,26 @@ public class DefaultApi { return nullableArrayTestGetRequestCreation().bodyToFlux(localVarReturnType); } + /** + * + * + *

200 - + * @return ResponseEntity<List<ByteArrayObject>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono>> nullableArrayTestGetWithHttpInfo() throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return nullableArrayTestGetRequestCreation().toEntityList(localVarReturnType); } + + /** + * + * + *

200 - + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec nullableArrayTestGetWithResponseSpec() throws WebClientResponseException { + return nullableArrayTestGetRequestCreation(); + } } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 3974c464928..f68bd753576 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -96,8 +96,28 @@ public class AnotherFakeApi { return call123testSpecialTagsRequestCreation(client).bodyToMono(localVarReturnType); } + /** + * To test special tags + * To test special tags and operation ID starting with number + *

200 - successful operation + * @param client client model + * @return ResponseEntity<Client> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> call123testSpecialTagsWithHttpInfo(Client client) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return call123testSpecialTagsRequestCreation(client).toEntity(localVarReturnType); } + + /** + * To test special tags + * To test special tags and operation ID starting with number + *

200 - successful operation + * @param client client model + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec call123testSpecialTagsWithResponseSpec(Client client) throws WebClientResponseException { + return call123testSpecialTagsRequestCreation(client); + } } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/DefaultApi.java index 4579b415e47..70fbac8ecdc 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -88,8 +88,26 @@ public class DefaultApi { return fooGetRequestCreation().bodyToMono(localVarReturnType); } + /** + * + * + *

0 - response + * @return ResponseEntity<FooGetDefaultResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> fooGetWithHttpInfo() throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return fooGetRequestCreation().toEntity(localVarReturnType); } + + /** + * + * + *

0 - response + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fooGetWithResponseSpec() throws WebClientResponseException { + return fooGetRequestCreation(); + } } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java index cae69eb0451..8287c063534 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -99,10 +99,28 @@ public class FakeApi { return fakeHealthGetRequestCreation().bodyToMono(localVarReturnType); } + /** + * Health check endpoint + * + *

200 - The instance started successfully + * @return ResponseEntity<HealthCheckResult> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> fakeHealthGetWithHttpInfo() throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return fakeHealthGetRequestCreation().toEntity(localVarReturnType); } + + /** + * Health check endpoint + * + *

200 - The instance started successfully + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeHealthGetWithResponseSpec() throws WebClientResponseException { + return fakeHealthGetRequestCreation(); + } /** * test http signature authentication * @@ -157,10 +175,33 @@ public class FakeApi { return fakeHttpSignatureTestRequestCreation(pet, query1, header1).bodyToMono(localVarReturnType); } + /** + * test http signature authentication + * + *

200 - The instance started successfully + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter + * @param header1 header parameter + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> fakeHttpSignatureTestWithHttpInfo(Pet pet, String query1, String header1) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return fakeHttpSignatureTestRequestCreation(pet, query1, header1).toEntity(localVarReturnType); } + + /** + * test http signature authentication + * + *

200 - The instance started successfully + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter + * @param header1 header parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeHttpSignatureTestWithResponseSpec(Pet pet, String query1, String header1) throws WebClientResponseException { + return fakeHttpSignatureTestRequestCreation(pet, query1, header1); + } /** * * Test serialization of outer boolean types @@ -207,10 +248,30 @@ public class FakeApi { return fakeOuterBooleanSerializeRequestCreation(body).bodyToMono(localVarReturnType); } + /** + * + * Test serialization of outer boolean types + *

200 - Output boolean + * @param body Input boolean as post body + * @return ResponseEntity<Boolean> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return fakeOuterBooleanSerializeRequestCreation(body).toEntity(localVarReturnType); } + + /** + * + * Test serialization of outer boolean types + *

200 - Output boolean + * @param body Input boolean as post body + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeOuterBooleanSerializeWithResponseSpec(Boolean body) throws WebClientResponseException { + return fakeOuterBooleanSerializeRequestCreation(body); + } /** * * Test serialization of object with outer number type @@ -257,10 +318,30 @@ public class FakeApi { return fakeOuterCompositeSerializeRequestCreation(outerComposite).bodyToMono(localVarReturnType); } + /** + * + * Test serialization of object with outer number type + *

200 - Output composite + * @param outerComposite Input composite as post body + * @return ResponseEntity<OuterComposite> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> fakeOuterCompositeSerializeWithHttpInfo(OuterComposite outerComposite) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return fakeOuterCompositeSerializeRequestCreation(outerComposite).toEntity(localVarReturnType); } + + /** + * + * Test serialization of object with outer number type + *

200 - Output composite + * @param outerComposite Input composite as post body + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeOuterCompositeSerializeWithResponseSpec(OuterComposite outerComposite) throws WebClientResponseException { + return fakeOuterCompositeSerializeRequestCreation(outerComposite); + } /** * * Test serialization of outer number types @@ -307,10 +388,30 @@ public class FakeApi { return fakeOuterNumberSerializeRequestCreation(body).bodyToMono(localVarReturnType); } + /** + * + * Test serialization of outer number types + *

200 - Output number + * @param body Input number as post body + * @return ResponseEntity<BigDecimal> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return fakeOuterNumberSerializeRequestCreation(body).toEntity(localVarReturnType); } + + /** + * + * Test serialization of outer number types + *

200 - Output number + * @param body Input number as post body + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeOuterNumberSerializeWithResponseSpec(BigDecimal body) throws WebClientResponseException { + return fakeOuterNumberSerializeRequestCreation(body); + } /** * * Test serialization of outer string types @@ -357,10 +458,30 @@ public class FakeApi { return fakeOuterStringSerializeRequestCreation(body).bodyToMono(localVarReturnType); } + /** + * + * Test serialization of outer string types + *

200 - Output string + * @param body Input string as post body + * @return ResponseEntity<String> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> fakeOuterStringSerializeWithHttpInfo(String body) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return fakeOuterStringSerializeRequestCreation(body).toEntity(localVarReturnType); } + + /** + * + * Test serialization of outer string types + *

200 - Output string + * @param body Input string as post body + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakeOuterStringSerializeWithResponseSpec(String body) throws WebClientResponseException { + return fakeOuterStringSerializeRequestCreation(body); + } /** * * Test serialization of enum (int) properties with examples @@ -411,10 +532,30 @@ public class FakeApi { return fakePropertyEnumIntegerSerializeRequestCreation(outerObjectWithEnumProperty).bodyToMono(localVarReturnType); } + /** + * + * Test serialization of enum (int) properties with examples + *

200 - Output enum (int) + * @param outerObjectWithEnumProperty Input enum (int) as post body + * @return ResponseEntity<OuterObjectWithEnumProperty> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> fakePropertyEnumIntegerSerializeWithHttpInfo(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return fakePropertyEnumIntegerSerializeRequestCreation(outerObjectWithEnumProperty).toEntity(localVarReturnType); } + + /** + * + * Test serialization of enum (int) properties with examples + *

200 - Output enum (int) + * @param outerObjectWithEnumProperty Input enum (int) as post body + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec fakePropertyEnumIntegerSerializeWithResponseSpec(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws WebClientResponseException { + return fakePropertyEnumIntegerSerializeRequestCreation(outerObjectWithEnumProperty); + } /** * * For this test, the body has to be a binary file. @@ -461,10 +602,29 @@ public class FakeApi { return testBodyWithBinaryRequestCreation(body).bodyToMono(localVarReturnType); } + /** + * + * For this test, the body has to be a binary file. + *

200 - Success + * @param body image to upload + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> testBodyWithBinaryWithHttpInfo(File body) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return testBodyWithBinaryRequestCreation(body).toEntity(localVarReturnType); } + + /** + * + * For this test, the body has to be a binary file. + *

200 - Success + * @param body image to upload + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testBodyWithBinaryWithResponseSpec(File body) throws WebClientResponseException { + return testBodyWithBinaryRequestCreation(body); + } /** * * For this test, the body for this request must reference a schema named `File`. @@ -511,10 +671,29 @@ public class FakeApi { return testBodyWithFileSchemaRequestCreation(fileSchemaTestClass).bodyToMono(localVarReturnType); } + /** + * + * For this test, the body for this request must reference a schema named `File`. + *

200 - Success + * @param fileSchemaTestClass The fileSchemaTestClass parameter + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return testBodyWithFileSchemaRequestCreation(fileSchemaTestClass).toEntity(localVarReturnType); } + + /** + * + * For this test, the body for this request must reference a schema named `File`. + *

200 - Success + * @param fileSchemaTestClass The fileSchemaTestClass parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testBodyWithFileSchemaWithResponseSpec(FileSchemaTestClass fileSchemaTestClass) throws WebClientResponseException { + return testBodyWithFileSchemaRequestCreation(fileSchemaTestClass); + } /** * * @@ -569,10 +748,31 @@ public class FakeApi { return testBodyWithQueryParamsRequestCreation(query, user).bodyToMono(localVarReturnType); } + /** + * + * + *

200 - Success + * @param query The query parameter + * @param user The user parameter + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> testBodyWithQueryParamsWithHttpInfo(String query, User user) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return testBodyWithQueryParamsRequestCreation(query, user).toEntity(localVarReturnType); } + + /** + * + * + *

200 - Success + * @param query The query parameter + * @param user The user parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testBodyWithQueryParamsWithResponseSpec(String query, User user) throws WebClientResponseException { + return testBodyWithQueryParamsRequestCreation(query, user); + } /** * To test \"client\" model * To test \"client\" model @@ -623,10 +823,30 @@ public class FakeApi { return testClientModelRequestCreation(client).bodyToMono(localVarReturnType); } + /** + * To test \"client\" model + * To test \"client\" model + *

200 - successful operation + * @param client client model + * @return ResponseEntity<Client> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> testClientModelWithHttpInfo(Client client) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return testClientModelRequestCreation(client).toEntity(localVarReturnType); } + + /** + * To test \"client\" model + * To test \"client\" model + *

200 - successful operation + * @param client client model + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testClientModelWithResponseSpec(Client client) throws WebClientResponseException { + return testClientModelRequestCreation(client); + } /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -742,10 +962,57 @@ public class FakeApi { return testEndpointParametersRequestCreation(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback).bodyToMono(localVarReturnType); } + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + *

400 - Invalid username supplied + *

404 - User not found + * @param number None + * @param _double None + * @param patternWithoutDelimiter None + * @param _byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param _float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param paramCallback None + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> testEndpointParametersWithHttpInfo(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 { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return testEndpointParametersRequestCreation(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback).toEntity(localVarReturnType); } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + *

400 - Invalid username supplied + *

404 - User not found + * @param number None + * @param _double None + * @param patternWithoutDelimiter None + * @param _byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param _float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param paramCallback None + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testEndpointParametersWithResponseSpec(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 { + return testEndpointParametersRequestCreation(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } /** * To test enum parameters * To test enum parameters @@ -821,10 +1088,47 @@ public class FakeApi { return testEnumParametersRequestCreation(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString).bodyToMono(localVarReturnType); } + /** + * To test enum parameters + * To test enum parameters + *

400 - Invalid request + *

404 - Not found + * @param enumHeaderStringArray Header parameter enum test (string array) + * @param enumHeaderString Header parameter enum test (string) + * @param enumQueryStringArray Query parameter enum test (string array) + * @param enumQueryString Query parameter enum test (string) + * @param enumQueryInteger Query parameter enum test (double) + * @param enumQueryDouble Query parameter enum test (double) + * @param enumQueryModelArray The enumQueryModelArray parameter + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return testEnumParametersRequestCreation(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString).toEntity(localVarReturnType); } + + /** + * To test enum parameters + * To test enum parameters + *

400 - Invalid request + *

404 - Not found + * @param enumHeaderStringArray Header parameter enum test (string array) + * @param enumHeaderString Header parameter enum test (string) + * @param enumQueryStringArray Query parameter enum test (string array) + * @param enumQueryString Query parameter enum test (string) + * @param enumQueryInteger Query parameter enum test (double) + * @param enumQueryDouble Query parameter enum test (double) + * @param enumQueryModelArray The enumQueryModelArray parameter + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testEnumParametersWithResponseSpec(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString) throws WebClientResponseException { + return testEnumParametersRequestCreation(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + } /** * Fake endpoint to test group parameters (optional) * Fake endpoint to test group parameters (optional) @@ -896,10 +1200,39 @@ public class FakeApi { return testGroupParametersRequestCreation(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group).bodyToMono(localVarReturnType); } + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + *

400 - Someting wrong + * @param requiredStringGroup Required String in group parameters + * @param requiredBooleanGroup Required Boolean in group parameters + * @param requiredInt64Group Required Integer in group parameters + * @param stringGroup String in group parameters + * @param booleanGroup Boolean in group parameters + * @param int64Group Integer in group parameters + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return testGroupParametersRequestCreation(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group).toEntity(localVarReturnType); } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + *

400 - Someting wrong + * @param requiredStringGroup Required String in group parameters + * @param requiredBooleanGroup Required Boolean in group parameters + * @param requiredInt64Group Required Integer in group parameters + * @param stringGroup String in group parameters + * @param booleanGroup Boolean in group parameters + * @param int64Group Integer in group parameters + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testGroupParametersWithResponseSpec(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws WebClientResponseException { + return testGroupParametersRequestCreation(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } /** * test inline additionalProperties * @@ -946,10 +1279,29 @@ public class FakeApi { return testInlineAdditionalPropertiesRequestCreation(requestBody).bodyToMono(localVarReturnType); } + /** + * test inline additionalProperties + * + *

200 - successful operation + * @param requestBody request body + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> testInlineAdditionalPropertiesWithHttpInfo(Map requestBody) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return testInlineAdditionalPropertiesRequestCreation(requestBody).toEntity(localVarReturnType); } + + /** + * test inline additionalProperties + * + *

200 - successful operation + * @param requestBody request body + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testInlineAdditionalPropertiesWithResponseSpec(Map requestBody) throws WebClientResponseException { + return testInlineAdditionalPropertiesRequestCreation(requestBody); + } /** * test json serialization of form data * @@ -1007,10 +1359,31 @@ public class FakeApi { return testJsonFormDataRequestCreation(param, param2).bodyToMono(localVarReturnType); } + /** + * test json serialization of form data + * + *

200 - successful operation + * @param param field1 + * @param param2 field2 + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> testJsonFormDataWithHttpInfo(String param, String param2) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return testJsonFormDataRequestCreation(param, param2).toEntity(localVarReturnType); } + + /** + * test json serialization of form data + * + *

200 - successful operation + * @param param field1 + * @param param2 field2 + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testJsonFormDataWithResponseSpec(String param, String param2) throws WebClientResponseException { + return testJsonFormDataRequestCreation(param, param2); + } /** * * To test the collection format in query parameters @@ -1095,8 +1468,39 @@ public class FakeApi { return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, allowEmpty, language).bodyToMono(localVarReturnType); } + /** + * + * To test the collection format in query parameters + *

200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @param allowEmpty The allowEmpty parameter + * @param language The language parameter + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, allowEmpty, language).toEntity(localVarReturnType); } + + /** + * + * To test the collection format in query parameters + *

200 - Success + * @param pipe The pipe parameter + * @param ioutil The ioutil parameter + * @param http The http parameter + * @param url The url parameter + * @param context The context parameter + * @param allowEmpty The allowEmpty parameter + * @param language The language parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testQueryParameterCollectionFormatWithResponseSpec(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) throws WebClientResponseException { + return testQueryParameterCollectionFormatRequestCreation(pipe, ioutil, http, url, context, allowEmpty, language); + } } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 0ce3faa72fa..106994a4649 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -96,8 +96,28 @@ public class FakeClassnameTags123Api { return testClassnameRequestCreation(client).bodyToMono(localVarReturnType); } + /** + * To test class name in snake case + * To test class name in snake case + *

200 - successful operation + * @param client client model + * @return ResponseEntity<Client> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> testClassnameWithHttpInfo(Client client) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return testClassnameRequestCreation(client).toEntity(localVarReturnType); } + + /** + * To test class name in snake case + * To test class name in snake case + *

200 - successful operation + * @param client client model + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec testClassnameWithResponseSpec(Client client) throws WebClientResponseException { + return testClassnameRequestCreation(client); + } } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java index 2d690b40b8b..c5588dff970 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java @@ -97,10 +97,31 @@ public class PetApi { return addPetRequestCreation(pet).bodyToMono(localVarReturnType); } + /** + * Add a new pet to the store + * + *

200 - Successful operation + *

405 - Invalid input + * @param pet Pet object that needs to be added to the store + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> addPetWithHttpInfo(Pet pet) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return addPetRequestCreation(pet).toEntity(localVarReturnType); } + + /** + * Add a new pet to the store + * + *

200 - Successful operation + *

405 - Invalid input + * @param pet Pet object that needs to be added to the store + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec addPetWithResponseSpec(Pet pet) throws WebClientResponseException { + return addPetRequestCreation(pet); + } /** * Deletes a pet * @@ -153,10 +174,33 @@ public class PetApi { return deletePetRequestCreation(petId, apiKey).bodyToMono(localVarReturnType); } + /** + * Deletes a pet + * + *

200 - Successful operation + *

400 - Invalid pet value + * @param petId Pet id to delete + * @param apiKey The apiKey parameter + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> deletePetWithHttpInfo(Long petId, String apiKey) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return deletePetRequestCreation(petId, apiKey).toEntity(localVarReturnType); } + + /** + * Deletes a pet + * + *

200 - Successful operation + *

400 - Invalid pet value + * @param petId Pet id to delete + * @param apiKey The apiKey parameter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deletePetWithResponseSpec(Long petId, String apiKey) throws WebClientResponseException { + return deletePetRequestCreation(petId, apiKey); + } /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -209,10 +253,32 @@ public class PetApi { return findPetsByStatusRequestCreation(status).bodyToFlux(localVarReturnType).collectList().block(); } + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + *

200 - successful operation + *

400 - Invalid status value + * @param status Status values that need to be considered for filter + * @return ResponseEntity<List<Pet>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public ResponseEntity> findPetsByStatusWithHttpInfo(List status) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return findPetsByStatusRequestCreation(status).toEntityList(localVarReturnType).block(); } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + *

200 - successful operation + *

400 - Invalid status value + * @param status Status values that need to be considered for filter + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec findPetsByStatusWithResponseSpec(List status) throws WebClientResponseException { + return findPetsByStatusRequestCreation(status); + } /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -267,10 +333,32 @@ public class PetApi { return findPetsByTagsRequestCreation(tags).bodyToFlux(localVarReturnType).collect(Collectors.toSet()).block(); } + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + *

200 - successful operation + *

400 - Invalid tag value + * @param tags Tags to filter by + * @return ResponseEntity<Set<Pet>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public ResponseEntity> findPetsByTagsWithHttpInfo(Set tags) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return findPetsByTagsRequestCreation(tags).toEntityList(localVarReturnType).block(); } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + *

200 - successful operation + *

400 - Invalid tag value + * @param tags Tags to filter by + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec findPetsByTagsWithResponseSpec(Set tags) throws WebClientResponseException { + return findPetsByTagsRequestCreation(tags); + } /** * Find pet by ID * Returns a single pet @@ -325,10 +413,34 @@ public class PetApi { return getPetByIdRequestCreation(petId).bodyToMono(localVarReturnType).block(); } + /** + * Find pet by ID + * Returns a single pet + *

200 - successful operation + *

400 - Invalid ID supplied + *

404 - Pet not found + * @param petId ID of pet to return + * @return ResponseEntity<Pet> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public ResponseEntity getPetByIdWithHttpInfo(Long petId) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return getPetByIdRequestCreation(petId).toEntity(localVarReturnType).block(); } + + /** + * Find pet by ID + * Returns a single pet + *

200 - successful operation + *

400 - Invalid ID supplied + *

404 - Pet not found + * @param petId ID of pet to return + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getPetByIdWithResponseSpec(Long petId) throws WebClientResponseException { + return getPetByIdRequestCreation(petId); + } /** * Update an existing pet * @@ -381,10 +493,35 @@ public class PetApi { updatePetRequestCreation(pet).bodyToMono(localVarReturnType).block(); } + /** + * Update an existing pet + * + *

200 - Successful operation + *

400 - Invalid ID supplied + *

404 - Pet not found + *

405 - Validation exception + * @param pet Pet object that needs to be added to the store + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public ResponseEntity updatePetWithHttpInfo(Pet pet) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return updatePetRequestCreation(pet).toEntity(localVarReturnType).block(); } + + /** + * Update an existing pet + * + *

200 - Successful operation + *

400 - Invalid ID supplied + *

404 - Pet not found + *

405 - Validation exception + * @param pet Pet object that needs to be added to the store + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updatePetWithResponseSpec(Pet pet) throws WebClientResponseException { + return updatePetRequestCreation(pet); + } /** * Updates a pet in the store with form data * @@ -444,10 +581,35 @@ public class PetApi { return updatePetWithFormRequestCreation(petId, name, status).bodyToMono(localVarReturnType); } + /** + * Updates a pet in the store with form data + * + *

200 - Successful operation + *

405 - Invalid input + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return updatePetWithFormRequestCreation(petId, name, status).toEntity(localVarReturnType); } + + /** + * Updates a pet in the store with form data + * + *

200 - Successful operation + *

405 - Invalid input + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updatePetWithFormWithResponseSpec(Long petId, String name, String status) throws WebClientResponseException { + return updatePetWithFormRequestCreation(petId, name, status); + } /** * uploads an image * @@ -509,10 +671,34 @@ public class PetApi { return uploadFileRequestCreation(petId, additionalMetadata, _file).bodyToMono(localVarReturnType); } + /** + * uploads an image + * + *

200 - successful operation + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param _file file to upload + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return uploadFileRequestCreation(petId, additionalMetadata, _file).toEntity(localVarReturnType); } + + /** + * uploads an image + * + *

200 - successful operation + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param _file file to upload + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec uploadFileWithResponseSpec(Long petId, String additionalMetadata, File _file) throws WebClientResponseException { + return uploadFileRequestCreation(petId, additionalMetadata, _file); + } /** * uploads an image (required) * @@ -578,8 +764,32 @@ public class PetApi { return uploadFileWithRequiredFileRequestCreation(petId, requiredFile, additionalMetadata).bodyToMono(localVarReturnType); } + /** + * uploads an image (required) + * + *

200 - successful operation + * @param petId ID of pet to update + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + * @return ResponseEntity<ModelApiResponse> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return uploadFileWithRequiredFileRequestCreation(petId, requiredFile, additionalMetadata).toEntity(localVarReturnType); } + + /** + * uploads an image (required) + * + *

200 - successful operation + * @param petId ID of pet to update + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec uploadFileWithRequiredFileWithResponseSpec(Long petId, File requiredFile, String additionalMetadata) throws WebClientResponseException { + return uploadFileWithRequiredFileRequestCreation(petId, requiredFile, additionalMetadata); + } } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/StoreApi.java index 96a429311f9..27426959355 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/StoreApi.java @@ -94,10 +94,31 @@ public class StoreApi { return deleteOrderRequestCreation(orderId).bodyToMono(localVarReturnType); } + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + *

400 - Invalid ID supplied + *

404 - Order not found + * @param orderId ID of the order that needs to be deleted + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> deleteOrderWithHttpInfo(String orderId) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return deleteOrderRequestCreation(orderId).toEntity(localVarReturnType); } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + *

400 - Invalid ID supplied + *

404 - Order not found + * @param orderId ID of the order that needs to be deleted + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteOrderWithResponseSpec(String orderId) throws WebClientResponseException { + return deleteOrderRequestCreation(orderId); + } /** * Returns pet inventories by status * Returns a map of status codes to quantities @@ -140,10 +161,28 @@ public class StoreApi { return getInventoryRequestCreation().bodyToMono(localVarReturnType); } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + *

200 - successful operation + * @return ResponseEntity<Map<String, Integer>> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono>> getInventoryWithHttpInfo() throws WebClientResponseException { ParameterizedTypeReference> localVarReturnType = new ParameterizedTypeReference>() {}; return getInventoryRequestCreation().toEntity(localVarReturnType); } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + *

200 - successful operation + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getInventoryWithResponseSpec() throws WebClientResponseException { + return getInventoryRequestCreation(); + } /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -198,10 +237,34 @@ public class StoreApi { return getOrderByIdRequestCreation(orderId).bodyToMono(localVarReturnType); } + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + *

200 - successful operation + *

400 - Invalid ID supplied + *

404 - Order not found + * @param orderId ID of pet that needs to be fetched + * @return ResponseEntity<Order> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> getOrderByIdWithHttpInfo(Long orderId) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return getOrderByIdRequestCreation(orderId).toEntity(localVarReturnType); } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + *

200 - successful operation + *

400 - Invalid ID supplied + *

404 - Order not found + * @param orderId ID of pet that needs to be fetched + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getOrderByIdWithResponseSpec(Long orderId) throws WebClientResponseException { + return getOrderByIdRequestCreation(orderId); + } /** * Place an order for a pet * @@ -254,8 +317,30 @@ public class StoreApi { return placeOrderRequestCreation(order).bodyToMono(localVarReturnType); } + /** + * Place an order for a pet + * + *

200 - successful operation + *

400 - Invalid Order + * @param order order placed for purchasing the pet + * @return ResponseEntity<Order> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> placeOrderWithHttpInfo(Order order) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return placeOrderRequestCreation(order).toEntity(localVarReturnType); } + + /** + * Place an order for a pet + * + *

200 - successful operation + *

400 - Invalid Order + * @param order order placed for purchasing the pet + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec placeOrderWithResponseSpec(Order order) throws WebClientResponseException { + return placeOrderRequestCreation(order); + } } diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java index 70fd7a644cd..ad76ef2ea73 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java @@ -93,10 +93,29 @@ public class UserApi { return createUserRequestCreation(user).bodyToMono(localVarReturnType); } + /** + * Create user + * This can only be done by the logged in user. + *

0 - successful operation + * @param user Created user object + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> createUserWithHttpInfo(User user) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return createUserRequestCreation(user).toEntity(localVarReturnType); } + + /** + * Create user + * This can only be done by the logged in user. + *

0 - successful operation + * @param user Created user object + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec createUserWithResponseSpec(User user) throws WebClientResponseException { + return createUserRequestCreation(user); + } /** * Creates list of users with given input array * @@ -143,10 +162,29 @@ public class UserApi { return createUsersWithArrayInputRequestCreation(user).bodyToMono(localVarReturnType); } + /** + * Creates list of users with given input array + * + *

0 - successful operation + * @param user List of user object + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> createUsersWithArrayInputWithHttpInfo(List user) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return createUsersWithArrayInputRequestCreation(user).toEntity(localVarReturnType); } + + /** + * Creates list of users with given input array + * + *

0 - successful operation + * @param user List of user object + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec createUsersWithArrayInputWithResponseSpec(List user) throws WebClientResponseException { + return createUsersWithArrayInputRequestCreation(user); + } /** * Creates list of users with given input array * @@ -193,10 +231,29 @@ public class UserApi { return createUsersWithListInputRequestCreation(user).bodyToMono(localVarReturnType); } + /** + * Creates list of users with given input array + * + *

0 - successful operation + * @param user List of user object + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> createUsersWithListInputWithHttpInfo(List user) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return createUsersWithListInputRequestCreation(user).toEntity(localVarReturnType); } + + /** + * Creates list of users with given input array + * + *

0 - successful operation + * @param user List of user object + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec createUsersWithListInputWithResponseSpec(List user) throws WebClientResponseException { + return createUsersWithListInputRequestCreation(user); + } /** * Delete user * This can only be done by the logged in user. @@ -245,10 +302,31 @@ public class UserApi { return deleteUserRequestCreation(username).bodyToMono(localVarReturnType); } + /** + * Delete user + * This can only be done by the logged in user. + *

400 - Invalid username supplied + *

404 - User not found + * @param username The name that needs to be deleted + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> deleteUserWithHttpInfo(String username) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return deleteUserRequestCreation(username).toEntity(localVarReturnType); } + + /** + * Delete user + * This can only be done by the logged in user. + *

400 - Invalid username supplied + *

404 - User not found + * @param username The name that needs to be deleted + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec deleteUserWithResponseSpec(String username) throws WebClientResponseException { + return deleteUserRequestCreation(username); + } /** * Get user by user name * @@ -303,10 +381,34 @@ public class UserApi { return getUserByNameRequestCreation(username).bodyToMono(localVarReturnType); } + /** + * Get user by user name + * + *

200 - successful operation + *

400 - Invalid username supplied + *

404 - User not found + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ResponseEntity<User> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> getUserByNameWithHttpInfo(String username) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return getUserByNameRequestCreation(username).toEntity(localVarReturnType); } + + /** + * Get user by user name + * + *

200 - successful operation + *

400 - Invalid username supplied + *

404 - User not found + * @param username The name that needs to be fetched. Use user1 for testing. + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec getUserByNameWithResponseSpec(String username) throws WebClientResponseException { + return getUserByNameRequestCreation(username); + } /** * Logs user into the system * @@ -366,10 +468,34 @@ public class UserApi { return loginUserRequestCreation(username, password).bodyToMono(localVarReturnType); } + /** + * Logs user into the system + * + *

200 - successful operation + *

400 - Invalid username/password supplied + * @param username The user name for login + * @param password The password for login in clear text + * @return ResponseEntity<String> + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> loginUserWithHttpInfo(String username, String password) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return loginUserRequestCreation(username, password).toEntity(localVarReturnType); } + + /** + * Logs user into the system + * + *

200 - successful operation + *

400 - Invalid username/password supplied + * @param username The user name for login + * @param password The password for login in clear text + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec loginUserWithResponseSpec(String username, String password) throws WebClientResponseException { + return loginUserRequestCreation(username, password); + } /** * Logs out current logged in user session * @@ -408,10 +534,27 @@ public class UserApi { return logoutUserRequestCreation().bodyToMono(localVarReturnType); } + /** + * Logs out current logged in user session + * + *

0 - successful operation + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> logoutUserWithHttpInfo() throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return logoutUserRequestCreation().toEntity(localVarReturnType); } + + /** + * Logs out current logged in user session + * + *

0 - successful operation + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec logoutUserWithResponseSpec() throws WebClientResponseException { + return logoutUserRequestCreation(); + } /** * Updated user * This can only be done by the logged in user. @@ -468,8 +611,31 @@ public class UserApi { return updateUserRequestCreation(username, user).bodyToMono(localVarReturnType); } + /** + * Updated user + * This can only be done by the logged in user. + *

400 - Invalid user supplied + *

404 - User not found + * @param username name that need to be deleted + * @param user Updated user object + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ public Mono> updateUserWithHttpInfo(String username, User user) throws WebClientResponseException { ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference() {}; return updateUserRequestCreation(username, user).toEntity(localVarReturnType); } + + /** + * Updated user + * This can only be done by the logged in user. + *

400 - Invalid user supplied + *

404 - User not found + * @param username name that need to be deleted + * @param user Updated user object + * @return ResponseSpec + * @throws WebClientResponseException if an error occurs while attempting to invoke the API + */ + public ResponseSpec updateUserWithResponseSpec(String username, User user) throws WebClientResponseException { + return updateUserRequestCreation(username, user); + } }