Use webclient exceptions in java webclient client (#6304)

This commit is contained in:
Diogo Nunes 2020-05-20 17:46:34 +01:00 committed by GitHub
parent 2ec0754596
commit dec1365619
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 128 additions and 135 deletions

View File

@ -15,10 +15,9 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
@ -56,19 +55,19 @@ public class {{classname}} {
{{#responses}} * <p><b>{{code}}</b>{{#message}} - {{message}}{{/message}}
{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}}
{{/allParams}}{{#returnType}} * @return {{returnType}}
{{/returnType}} * @throws RestClientException if an error occurs while attempting to invoke the API
{{/returnType}} * @throws WebClientResponseException if an error occurs while attempting to invoke the API
{{#externalDocs}}
* {{description}}
* @see <a href="{{url}}">{{summary}} Documentation</a>
{{/externalDocs}}
*/
public {{#returnType}}{{#isListContainer}}Flux<{{{returnBaseType}}}>{{/isListContainer}}{{^isListContainer}}Mono<{{{returnType}}}>{{/isListContainer}} {{/returnType}}{{^returnType}}Mono<Void> {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws RestClientException {
public {{#returnType}}{{#isListContainer}}Flux<{{{returnBaseType}}}>{{/isListContainer}}{{^isListContainer}}Mono<{{{returnType}}}>{{/isListContainer}} {{/returnType}}{{^returnType}}Mono<Void> {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws WebClientResponseException {
Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
{{#allParams}}
{{#required}}
// verify the required parameter '{{paramName}}' is set
if ({{paramName}} == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '{{paramName}}' when calling {{operationId}}");
throw new WebClientResponseException("Missing the required parameter '{{paramName}}' when calling {{operationId}}", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
{{/required}}
{{/allParams}}

View File

@ -12,10 +12,9 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
@ -51,13 +50,13 @@ public class AnotherFakeApi {
* <p><b>200</b> - successful operation
* @param body client model
* @return Client
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Client> call123testSpecialTags(Client body) throws RestClientException {
public Mono<Client> call123testSpecialTags(Client body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling call123testSpecialTags");
throw new WebClientResponseException("Missing the required parameter 'body' when calling call123testSpecialTags", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();

View File

@ -20,10 +20,9 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
@ -58,13 +57,13 @@ public class FakeApi {
* this route creates an XmlItem
* <p><b>200</b> - successful operation
* @param xmlItem XmlItem Body
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> createXmlItem(XmlItem xmlItem) throws RestClientException {
public Mono<Void> createXmlItem(XmlItem xmlItem) throws WebClientResponseException {
Object postBody = xmlItem;
// verify the required parameter 'xmlItem' is set
if (xmlItem == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'xmlItem' when calling createXmlItem");
throw new WebClientResponseException("Missing the required parameter 'xmlItem' when calling createXmlItem", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -92,9 +91,9 @@ public class FakeApi {
* <p><b>200</b> - Output boolean
* @param body Input boolean as post body
* @return Boolean
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Boolean> fakeOuterBooleanSerialize(Boolean body) throws RestClientException {
public Mono<Boolean> fakeOuterBooleanSerialize(Boolean body) throws WebClientResponseException {
Object postBody = body;
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -122,9 +121,9 @@ public class FakeApi {
* <p><b>200</b> - Output composite
* @param body Input composite as post body
* @return OuterComposite
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<OuterComposite> fakeOuterCompositeSerialize(OuterComposite body) throws RestClientException {
public Mono<OuterComposite> fakeOuterCompositeSerialize(OuterComposite body) throws WebClientResponseException {
Object postBody = body;
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -152,9 +151,9 @@ public class FakeApi {
* <p><b>200</b> - Output number
* @param body Input number as post body
* @return BigDecimal
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<BigDecimal> fakeOuterNumberSerialize(BigDecimal body) throws RestClientException {
public Mono<BigDecimal> fakeOuterNumberSerialize(BigDecimal body) throws WebClientResponseException {
Object postBody = body;
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -182,9 +181,9 @@ public class FakeApi {
* <p><b>200</b> - Output string
* @param body Input string as post body
* @return String
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<String> fakeOuterStringSerialize(String body) throws RestClientException {
public Mono<String> fakeOuterStringSerialize(String body) throws WebClientResponseException {
Object postBody = body;
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -211,13 +210,13 @@ public class FakeApi {
* For this test, the body for this request much reference a schema named &#x60;File&#x60;.
* <p><b>200</b> - Success
* @param body The body parameter
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testBodyWithFileSchema(FileSchemaTestClass body) throws RestClientException {
public Mono<Void> testBodyWithFileSchema(FileSchemaTestClass body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testBodyWithFileSchema");
throw new WebClientResponseException("Missing the required parameter 'body' when calling testBodyWithFileSchema", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -245,17 +244,17 @@ public class FakeApi {
* <p><b>200</b> - Success
* @param query The query parameter
* @param body The body parameter
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testBodyWithQueryParams(String query, User body) throws RestClientException {
public Mono<Void> testBodyWithQueryParams(String query, User body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'query' is set
if (query == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'query' when calling testBodyWithQueryParams");
throw new WebClientResponseException("Missing the required parameter 'query' when calling testBodyWithQueryParams", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testBodyWithQueryParams");
throw new WebClientResponseException("Missing the required parameter 'body' when calling testBodyWithQueryParams", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -285,13 +284,13 @@ public class FakeApi {
* <p><b>200</b> - successful operation
* @param body client model
* @return Client
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Client> testClientModel(Client body) throws RestClientException {
public Mono<Client> testClientModel(Client body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClientModel");
throw new WebClientResponseException("Missing the required parameter 'body' when calling testClientModel", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -334,25 +333,25 @@ public class FakeApi {
* @param dateTime None
* @param password None
* @param paramCallback None
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
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 RestClientException {
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 {
Object postBody = null;
// verify the required parameter 'number' is set
if (number == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'number' when calling testEndpointParameters");
throw new WebClientResponseException("Missing the required parameter 'number' when calling testEndpointParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter '_double' is set
if (_double == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '_double' when calling testEndpointParameters");
throw new WebClientResponseException("Missing the required parameter '_double' when calling testEndpointParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'patternWithoutDelimiter' is set
if (patternWithoutDelimiter == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters");
throw new WebClientResponseException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter '_byte' is set
if (_byte == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '_byte' when calling testEndpointParameters");
throw new WebClientResponseException("Missing the required parameter '_byte' when calling testEndpointParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -416,9 +415,9 @@ public class FakeApi {
* @param enumQueryDouble Query parameter enum test (double)
* @param enumFormStringArray Form parameter enum test (string array)
* @param enumFormString Form parameter enum test (string)
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testEnumParameters(List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List<String> enumFormStringArray, String enumFormString) throws RestClientException {
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 {
Object postBody = null;
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -464,21 +463,21 @@ public class FakeApi {
* @param stringGroup String in group parameters
* @param booleanGroup Boolean in group parameters
* @param int64Group Integer in group parameters
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws RestClientException {
public Mono<Void> testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'requiredStringGroup' is set
if (requiredStringGroup == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters");
throw new WebClientResponseException("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'requiredBooleanGroup' is set
if (requiredBooleanGroup == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters");
throw new WebClientResponseException("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'requiredInt64Group' is set
if (requiredInt64Group == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters");
throw new WebClientResponseException("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -512,13 +511,13 @@ public class FakeApi {
*
* <p><b>200</b> - successful operation
* @param param request body
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testInlineAdditionalProperties(Map<String, String> param) throws RestClientException {
public Mono<Void> testInlineAdditionalProperties(Map<String, String> param) throws WebClientResponseException {
Object postBody = param;
// verify the required parameter 'param' is set
if (param == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param' when calling testInlineAdditionalProperties");
throw new WebClientResponseException("Missing the required parameter 'param' when calling testInlineAdditionalProperties", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -546,17 +545,17 @@ public class FakeApi {
* <p><b>200</b> - successful operation
* @param param field1
* @param param2 field2
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testJsonFormData(String param, String param2) throws RestClientException {
public Mono<Void> testJsonFormData(String param, String param2) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'param' is set
if (param == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param' when calling testJsonFormData");
throw new WebClientResponseException("Missing the required parameter 'param' when calling testJsonFormData", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'param2' is set
if (param2 == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param2' when calling testJsonFormData");
throw new WebClientResponseException("Missing the required parameter 'param2' when calling testJsonFormData", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -592,29 +591,29 @@ public class FakeApi {
* @param http The http parameter
* @param url The url parameter
* @param context The context parameter
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> testQueryParameterCollectionFormat(List<String> pipe, List<String> ioutil, List<String> http, List<String> url, List<String> context) throws RestClientException {
public Mono<Void> testQueryParameterCollectionFormat(List<String> pipe, List<String> ioutil, List<String> http, List<String> url, List<String> context) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'pipe' is set
if (pipe == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat");
throw new WebClientResponseException("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'ioutil' is set
if (ioutil == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat");
throw new WebClientResponseException("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'http' is set
if (http == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat");
throw new WebClientResponseException("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'url' is set
if (url == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat");
throw new WebClientResponseException("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'context' is set
if (context == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat");
throw new WebClientResponseException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();

View File

@ -12,10 +12,9 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
@ -51,13 +50,13 @@ public class FakeClassnameTags123Api {
* <p><b>200</b> - successful operation
* @param body client model
* @return Client
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Client> testClassname(Client body) throws RestClientException {
public Mono<Client> testClassname(Client body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClassname");
throw new WebClientResponseException("Missing the required parameter 'body' when calling testClassname", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();

View File

@ -14,10 +14,9 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
@ -53,13 +52,13 @@ public class PetApi {
* <p><b>200</b> - successful operation
* <p><b>405</b> - Invalid input
* @param body Pet object that needs to be added to the store
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> addPet(Pet body) throws RestClientException {
public Mono<Void> addPet(Pet body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling addPet");
throw new WebClientResponseException("Missing the required parameter 'body' when calling addPet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -88,13 +87,13 @@ public class PetApi {
* <p><b>400</b> - Invalid pet value
* @param petId Pet id to delete
* @param apiKey The apiKey parameter
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> deletePet(Long petId, String apiKey) throws RestClientException {
public Mono<Void> deletePet(Long petId, String apiKey) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling deletePet");
throw new WebClientResponseException("Missing the required parameter 'petId' when calling deletePet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -125,13 +124,13 @@ public class PetApi {
* <p><b>400</b> - Invalid status value
* @param status Status values that need to be considered for filter
* @return List&lt;Pet&gt;
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Flux<Pet> findPetsByStatus(List<String> status) throws RestClientException {
public Flux<Pet> findPetsByStatus(List<String> status) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'status' is set
if (status == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'status' when calling findPetsByStatus");
throw new WebClientResponseException("Missing the required parameter 'status' when calling findPetsByStatus", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -162,13 +161,13 @@ public class PetApi {
* <p><b>400</b> - Invalid tag value
* @param tags Tags to filter by
* @return List&lt;Pet&gt;
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Flux<Pet> findPetsByTags(List<String> tags) throws RestClientException {
public Flux<Pet> findPetsByTags(List<String> tags) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'tags' is set
if (tags == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'tags' when calling findPetsByTags");
throw new WebClientResponseException("Missing the required parameter 'tags' when calling findPetsByTags", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -200,13 +199,13 @@ public class PetApi {
* <p><b>404</b> - Pet not found
* @param petId ID of pet to return
* @return Pet
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Pet> getPetById(Long petId) throws RestClientException {
public Mono<Pet> getPetById(Long petId) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling getPetById");
throw new WebClientResponseException("Missing the required parameter 'petId' when calling getPetById", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -238,13 +237,13 @@ public class PetApi {
* <p><b>404</b> - Pet not found
* <p><b>405</b> - Validation exception
* @param body Pet object that needs to be added to the store
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> updatePet(Pet body) throws RestClientException {
public Mono<Void> updatePet(Pet body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updatePet");
throw new WebClientResponseException("Missing the required parameter 'body' when calling updatePet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -273,13 +272,13 @@ public class PetApi {
* @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 RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> updatePetWithForm(Long petId, String name, String status) throws RestClientException {
public Mono<Void> updatePetWithForm(Long petId, String name, String status) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling updatePetWithForm");
throw new WebClientResponseException("Missing the required parameter 'petId' when calling updatePetWithForm", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -316,13 +315,13 @@ public class PetApi {
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
* @return ModelApiResponse
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<ModelApiResponse> uploadFile(Long petId, String additionalMetadata, File file) throws RestClientException {
public Mono<ModelApiResponse> uploadFile(Long petId, String additionalMetadata, File file) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling uploadFile");
throw new WebClientResponseException("Missing the required parameter 'petId' when calling uploadFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -361,17 +360,17 @@ public class PetApi {
* @param requiredFile file to upload
* @param additionalMetadata Additional data to pass to server
* @return ModelApiResponse
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<ModelApiResponse> uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws RestClientException {
public Mono<ModelApiResponse> uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'petId' is set
if (petId == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile");
throw new WebClientResponseException("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'requiredFile' is set
if (requiredFile == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile");
throw new WebClientResponseException("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();

View File

@ -12,10 +12,9 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
@ -51,13 +50,13 @@ public class StoreApi {
* <p><b>400</b> - Invalid ID supplied
* <p><b>404</b> - Order not found
* @param orderId ID of the order that needs to be deleted
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> deleteOrder(String orderId) throws RestClientException {
public Mono<Void> deleteOrder(String orderId) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'orderId' when calling deleteOrder");
throw new WebClientResponseException("Missing the required parameter 'orderId' when calling deleteOrder", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -84,9 +83,9 @@ public class StoreApi {
* Returns a map of status codes to quantities
* <p><b>200</b> - successful operation
* @return Map&lt;String, Integer&gt;
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Map<String, Integer>> getInventory() throws RestClientException {
public Mono<Map<String, Integer>> getInventory() throws WebClientResponseException {
Object postBody = null;
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -116,13 +115,13 @@ public class StoreApi {
* <p><b>404</b> - Order not found
* @param orderId ID of pet that needs to be fetched
* @return Order
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Order> getOrderById(Long orderId) throws RestClientException {
public Mono<Order> getOrderById(Long orderId) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'orderId' when calling getOrderById");
throw new WebClientResponseException("Missing the required parameter 'orderId' when calling getOrderById", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -153,13 +152,13 @@ public class StoreApi {
* <p><b>400</b> - Invalid Order
* @param body order placed for purchasing the pet
* @return Order
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Order> placeOrder(Order body) throws RestClientException {
public Mono<Order> placeOrder(Order body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling placeOrder");
throw new WebClientResponseException("Missing the required parameter 'body' when calling placeOrder", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();

View File

@ -12,10 +12,9 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.web.reactive.function.client.WebClientResponseException;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
@ -50,13 +49,13 @@ public class UserApi {
* This can only be done by the logged in user.
* <p><b>0</b> - successful operation
* @param body Created user object
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> createUser(User body) throws RestClientException {
public Mono<Void> createUser(User body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUser");
throw new WebClientResponseException("Missing the required parameter 'body' when calling createUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -81,13 +80,13 @@ public class UserApi {
*
* <p><b>0</b> - successful operation
* @param body List of user object
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> createUsersWithArrayInput(List<User> body) throws RestClientException {
public Mono<Void> createUsersWithArrayInput(List<User> body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithArrayInput");
throw new WebClientResponseException("Missing the required parameter 'body' when calling createUsersWithArrayInput", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -112,13 +111,13 @@ public class UserApi {
*
* <p><b>0</b> - successful operation
* @param body List of user object
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> createUsersWithListInput(List<User> body) throws RestClientException {
public Mono<Void> createUsersWithListInput(List<User> body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithListInput");
throw new WebClientResponseException("Missing the required parameter 'body' when calling createUsersWithListInput", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -144,13 +143,13 @@ public class UserApi {
* <p><b>400</b> - Invalid username supplied
* <p><b>404</b> - User not found
* @param username The name that needs to be deleted
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> deleteUser(String username) throws RestClientException {
public Mono<Void> deleteUser(String username) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'username' is set
if (username == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'username' when calling deleteUser");
throw new WebClientResponseException("Missing the required parameter 'username' when calling deleteUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -180,13 +179,13 @@ public class UserApi {
* <p><b>404</b> - User not found
* @param username The name that needs to be fetched. Use user1 for testing.
* @return User
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<User> getUserByName(String username) throws RestClientException {
public Mono<User> getUserByName(String username) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'username' is set
if (username == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'username' when calling getUserByName");
throw new WebClientResponseException("Missing the required parameter 'username' when calling getUserByName", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -218,17 +217,17 @@ public class UserApi {
* @param username The user name for login
* @param password The password for login in clear text
* @return String
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<String> loginUser(String username, String password) throws RestClientException {
public Mono<String> loginUser(String username, String password) throws WebClientResponseException {
Object postBody = null;
// verify the required parameter 'username' is set
if (username == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'username' when calling loginUser");
throw new WebClientResponseException("Missing the required parameter 'username' when calling loginUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'password' is set
if (password == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'password' when calling loginUser");
throw new WebClientResponseException("Missing the required parameter 'password' when calling loginUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -257,9 +256,9 @@ public class UserApi {
* Logs out current logged in user session
*
* <p><b>0</b> - successful operation
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> logoutUser() throws RestClientException {
public Mono<Void> logoutUser() throws WebClientResponseException {
Object postBody = null;
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();
@ -286,17 +285,17 @@ public class UserApi {
* <p><b>404</b> - User not found
* @param username name that need to be deleted
* @param body Updated user object
* @throws RestClientException if an error occurs while attempting to invoke the API
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
public Mono<Void> updateUser(String username, User body) throws RestClientException {
public Mono<Void> updateUser(String username, User body) throws WebClientResponseException {
Object postBody = body;
// verify the required parameter 'username' is set
if (username == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'username' when calling updateUser");
throw new WebClientResponseException("Missing the required parameter 'username' when calling updateUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// verify the required parameter 'body' is set
if (body == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updateUser");
throw new WebClientResponseException("Missing the required parameter 'body' when calling updateUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
}
// create path and map variables
final Map<String, Object> pathParams = new HashMap<String, Object>();