diff --git a/CI/pom.xml.circleci b/CI/pom.xml.circleci
index fd33729a9c4a..e9db66aed2d3 100644
--- a/CI/pom.xml.circleci
+++ b/CI/pom.xml.circleci
@@ -850,6 +850,7 @@
samples/client/petstore/jaxrs-cxf-clientsamples/client/petstore/java/resttemplatesamples/client/petstore/java/resttemplate-withXml
+ samples/client/petstore/java/webclientsamples/client/petstore/java/vertxsamples/client/petstore/java/resteasysamples/client/petstore/java/google-api-client
diff --git a/README.md b/README.md
index 788b9748c6b1..9ded12dd3153 100644
--- a/README.md
+++ b/README.md
@@ -467,6 +467,7 @@ Here is a list of template creators:
* Java (Jersey2): @xhh
* Java (okhttp-gson): @xhh
* Java (RestTemplate): @nbruno
+ * Java (Spring 5 WebClient): @daonomic
* Java (RESTEasy): @gayathrigs
* Java (Vertx): @lopesmcc
* Java (Google APIs Client Library): @charlescapps
diff --git a/bin/java-petstore-all.sh b/bin/java-petstore-all.sh
index 19f6c4359b0c..b8cb3014e08f 100755
--- a/bin/java-petstore-all.sh
+++ b/bin/java-petstore-all.sh
@@ -16,6 +16,7 @@
./bin/java-petstore-jersey2-java6.sh
./bin/java-petstore-resttemplate.sh
./bin/java-petstore-resttemplate-withxml.sh
+./bin/java-petstore-webclient.sh
./bin/java-petstore-resteasy.sh
./bin/java-petstore-google-api-client.sh
./bin/java-petstore-rest-assured.sh
diff --git a/bin/java-petstore-webclient.json b/bin/java-petstore-webclient.json
new file mode 100644
index 000000000000..822ddccce55e
--- /dev/null
+++ b/bin/java-petstore-webclient.json
@@ -0,0 +1,4 @@
+{
+ "library": "webclient",
+ "artifactId": "petstore-webclient"
+}
diff --git a/bin/java-petstore-webclient.sh b/bin/java-petstore-webclient.sh
new file mode 100755
index 000000000000..e0e86aa25849
--- /dev/null
+++ b/bin/java-petstore-webclient.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+SCRIPT="$0"
+echo "# START SCRIPT: $SCRIPT"
+
+while [ -h "$SCRIPT" ] ; do
+ ls=`ls -ld "$SCRIPT"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ SCRIPT="$link"
+ else
+ SCRIPT=`dirname "$SCRIPT"`/"$link"
+ fi
+done
+
+if [ ! -d "${APP_DIR}" ]; then
+ APP_DIR=`dirname "$SCRIPT"`/..
+ APP_DIR=`cd "${APP_DIR}"; pwd`
+fi
+
+executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
+
+if [ ! -f "$executable" ]
+then
+ mvn -B clean package
+fi
+
+# if you've executed sbt assembly previously it will use that instead.
+export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
+ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-webclient.json -o samples/client/petstore/java/webclient -DhideGenerationTimestamp=true $@"
+
+echo "Removing files and folders under samples/client/petstore/java/webclient/src/main"
+rm -rf samples/client/petstore/java/webclient/src/main
+find samples/client/petstore/java/webclient -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
+java $JAVA_OPTS -jar $executable $ags
+
+# copy additional manually written unit-tests
+mkdir samples/client/petstore/java/webclient/src/test/java/org/openapitools/client
+mkdir samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/auth
+mkdir samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model
+
+cp CI/samples.ci/client/petstore/java/test-manual/webclient/ApiClientTest.java samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/ApiClientTest.java
+cp CI/samples.ci/client/petstore/java/test-manual/webclient/auth/ApiKeyAuthTest.java samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java
+cp CI/samples.ci/client/petstore/java/test-manual/webclient/auth/HttpBasicAuthTest.java samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java
+cp CI/samples.ci/client/petstore/java/test-manual/webclient/model/EnumValueTest.java samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/EnumValueTest.java
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java
index 3c8a5950ab8c..0f3e41fef939 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java
@@ -75,6 +75,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen
public static final String OKHTTP_GSON = "okhttp-gson";
public static final String RESTEASY = "resteasy";
public static final String RESTTEMPLATE = "resttemplate";
+ public static final String WEBCLIENT = "webclient";
public static final String REST_ASSURED = "rest-assured";
public static final String RETROFIT_1 = "retrofit";
public static final String RETROFIT_2 = "retrofit2";
@@ -120,6 +121,7 @@ public JavaClientCodegen() {
supportedLibraries.put(RETROFIT_1, "HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.3.1 (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.");
supportedLibraries.put(RETROFIT_2, "HTTP client: OkHttp 3.8.0. JSON processing: Gson 2.6.1 (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)");
supportedLibraries.put(RESTTEMPLATE, "HTTP client: Spring RestTemplate 4.3.9-RELEASE. JSON processing: Jackson 2.8.9");
+ supportedLibraries.put(WEBCLIENT, "HTTP client: Spring WebClient 5.0.7-RELEASE. JSON processing: Jackson 2.9.5");
supportedLibraries.put(RESTEASY, "HTTP client: Resteasy client 3.1.3.Final. JSON processing: Jackson 2.8.9");
supportedLibraries.put(VERTX, "HTTP client: VertX client 3.2.4. JSON processing: Jackson 2.8.9");
supportedLibraries.put(GOOGLE_API_CLIENT, "HTTP client: Google API client 1.23.0. JSON processing: Jackson 2.8.9");
@@ -151,6 +153,10 @@ public String getHelp() {
@Override
public void processOpts() {
+ if (WEBCLIENT.equals(getLibrary()) && "threetenbp".equals(dateLibrary)) {
+ dateLibrary = "java8";
+ }
+
super.processOpts();
if (additionalProperties.containsKey(USE_RX_JAVA) && additionalProperties.containsKey(USE_RX_JAVA2)) {
@@ -280,6 +286,8 @@ public void processOpts() {
} else if (RESTTEMPLATE.equals(getLibrary())) {
additionalProperties.put("jackson", "true");
supportingFiles.add(new SupportingFile("auth/Authentication.mustache", authFolder, "Authentication.java"));
+ } else if (WEBCLIENT.equals(getLibrary())) {
+ additionalProperties.put("jackson", "true");
} else if (VERTX.equals(getLibrary())) {
typeMapping.put("file", "AsyncFile");
importMapping.put("AsyncFile", "io.vertx.core.file.AsyncFile");
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache
new file mode 100644
index 000000000000..28260368a9b3
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/ApiClient.mustache
@@ -0,0 +1,640 @@
+package {{invokerPackage}};
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpRequest;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.InvalidMediaTypeException;
+import org.springframework.http.MediaType;
+import org.springframework.http.RequestEntity;
+import org.springframework.http.RequestEntity.BodyBuilder;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.client.BufferingClientHttpRequestFactory;
+import org.springframework.http.client.ClientHttpRequestExecution;
+import org.springframework.http.client.ClientHttpRequestInterceptor;
+import org.springframework.http.client.ClientHttpResponse;
+import org.springframework.http.codec.json.Jackson2JsonDecoder;
+import org.springframework.http.codec.json.Jackson2JsonEncoder;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.util.StringUtils;
+import org.springframework.http.client.reactive.ClientHttpRequest;
+import org.springframework.web.client.RestClientException;
+import org.springframework.web.util.UriComponentsBuilder;
+import org.springframework.web.reactive.function.client.WebClient;
+import org.springframework.web.reactive.function.client.ClientResponse;
+import org.springframework.web.reactive.function.BodyInserter;
+import org.springframework.web.reactive.function.BodyInserters;
+import org.springframework.web.reactive.function.client.ExchangeStrategies;
+import reactor.core.publisher.Mono;
+import reactor.core.publisher.Flux;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.TimeZone;
+
+import {{invokerPackage}}.auth.Authentication;
+import {{invokerPackage}}.auth.HttpBasicAuth;
+import {{invokerPackage}}.auth.ApiKeyAuth;
+import {{invokerPackage}}.auth.OAuth;
+
+{{>generatedAnnotation}}
+public class ApiClient {
+ public enum CollectionFormat {
+ CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null);
+
+ private final String separator;
+ private CollectionFormat(String separator) {
+ this.separator = separator;
+ }
+
+ private String collectionToString(Collection extends CharSequence> collection) {
+ return StringUtils.collectionToDelimitedString(collection, separator);
+ }
+ }
+
+ private HttpHeaders defaultHeaders = new HttpHeaders();
+
+ private String basePath = "{{basePath}}";
+
+ private final WebClient webClient;
+ private final DateFormat dateFormat;
+
+ private Map authentications;
+
+
+ public ApiClient() {
+ this.dateFormat = createDefaultDateFormat();
+ this.webClient = buildWebClient(new ObjectMapper(), this.dateFormat);
+ }
+
+ public ApiClient(ObjectMapper mapper, DateFormat format) {
+ this(buildWebClient(mapper.copy(), format), format);
+ }
+
+ private ApiClient(WebClient webClient, DateFormat format) {
+ this.webClient = webClient;
+ this.dateFormat = format;
+ }
+
+ public DateFormat createDefaultDateFormat() {
+ DateFormat dateFormat = new RFC3339DateFormat();
+ dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
+ return dateFormat;
+ }
+
+ protected void init() {
+ // Setup authentications (key: authentication name, value: authentication).
+ authentications = new HashMap();{{#authMethods}}{{#isBasic}}
+ authentications.put("{{name}}", new HttpBasicAuth());{{/isBasic}}{{#isApiKey}}
+ authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}}
+ authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}}
+ // Prevent the authentications from being modified.
+ authentications = Collections.unmodifiableMap(authentications);
+ }
+
+ /**
+ * Build the RestTemplate used to make HTTP requests.
+ * @return RestTemplate
+ */
+ public static WebClient buildWebClient(ObjectMapper mapper, DateFormat dateFormat) {
+ mapper.setDateFormat(dateFormat);
+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+ ExchangeStrategies strategies = ExchangeStrategies
+ .builder()
+ .codecs(clientDefaultCodecsConfigurer -> {
+ clientDefaultCodecsConfigurer.defaultCodecs().jackson2JsonEncoder(new Jackson2JsonEncoder(mapper, MediaType.APPLICATION_JSON));
+ clientDefaultCodecsConfigurer.defaultCodecs().jackson2JsonDecoder(new Jackson2JsonDecoder(mapper, MediaType.APPLICATION_JSON));
+ }).build();
+ WebClient.Builder webClient = WebClient.builder().exchangeStrategies(strategies);
+ return webClient.build();
+ }
+
+
+ /**
+ * Get the current base path
+ * @return String the base path
+ */
+ public String getBasePath() {
+ return basePath;
+ }
+
+ /**
+ * Set the base path, which should include the host
+ * @param basePath the base path
+ * @return ApiClient this client
+ */
+ public ApiClient setBasePath(String basePath) {
+ this.basePath = basePath;
+ return this;
+ }
+
+ /**
+ * Get authentications (key: authentication name, value: authentication).
+ * @return Map the currently configured authentication types
+ */
+ public Map getAuthentications() {
+ return authentications;
+ }
+
+ /**
+ * Get authentication for the given name.
+ *
+ * @param authName The authentication name
+ * @return The authentication, null if not found
+ */
+ public Authentication getAuthentication(String authName) {
+ return authentications.get(authName);
+ }
+
+ /**
+ * Helper method to set username for the first HTTP basic authentication.
+ * @param username the username
+ */
+ public void setUsername(String username) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof HttpBasicAuth) {
+ ((HttpBasicAuth) auth).setUsername(username);
+ return;
+ }
+ }
+ throw new RuntimeException("No HTTP basic authentication configured!");
+ }
+
+ /**
+ * Helper method to set password for the first HTTP basic authentication.
+ * @param password the password
+ */
+ public void setPassword(String password) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof HttpBasicAuth) {
+ ((HttpBasicAuth) auth).setPassword(password);
+ return;
+ }
+ }
+ throw new RuntimeException("No HTTP basic authentication configured!");
+ }
+
+ /**
+ * Helper method to set API key value for the first API key authentication.
+ * @param apiKey the API key
+ */
+ public void setApiKey(String apiKey) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof ApiKeyAuth) {
+ ((ApiKeyAuth) auth).setApiKey(apiKey);
+ return;
+ }
+ }
+ throw new RuntimeException("No API key authentication configured!");
+ }
+
+ /**
+ * Helper method to set API key prefix for the first API key authentication.
+ * @param apiKeyPrefix the API key prefix
+ */
+ public void setApiKeyPrefix(String apiKeyPrefix) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof ApiKeyAuth) {
+ ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
+ return;
+ }
+ }
+ throw new RuntimeException("No API key authentication configured!");
+ }
+
+ /**
+ * Helper method to set access token for the first OAuth2 authentication.
+ * @param accessToken the access token
+ */
+ public void setAccessToken(String accessToken) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof OAuth) {
+ ((OAuth) auth).setAccessToken(accessToken);
+ return;
+ }
+ }
+ throw new RuntimeException("No OAuth2 authentication configured!");
+ }
+
+ /**
+ * Set the User-Agent header's value (by adding to the default header map).
+ * @param userAgent the user agent string
+ * @return ApiClient this client
+ */
+ public ApiClient setUserAgent(String userAgent) {
+ addDefaultHeader("User-Agent", userAgent);
+ return this;
+ }
+
+ /**
+ * Add a default header.
+ *
+ * @param name The header's name
+ * @param value The header's value
+ * @return ApiClient this client
+ */
+ public ApiClient addDefaultHeader(String name, String value) {
+ if (defaultHeaders.containsKey(name)) {
+ defaultHeaders.remove(name);
+ }
+ defaultHeaders.add(name, value);
+ return this;
+ }
+
+ /**
+ * Get the date format used to parse/format date parameters.
+ * @return DateFormat format
+ */
+ public DateFormat getDateFormat() {
+ return dateFormat;
+ }
+
+ /**
+ * Parse the given string into Date object.
+ */
+ public Date parseDate(String str) {
+ try {
+ return dateFormat.parse(str);
+ } catch (ParseException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Format the given Date object into string.
+ */
+ public String formatDate(Date date) {
+ return dateFormat.format(date);
+ }
+
+ /**
+ * Format the given parameter object into string.
+ * @param param the object to convert
+ * @return String the parameter represented as a String
+ */
+ public String parameterToString(Object param) {
+ if (param == null) {
+ return "";
+ } else if (param instanceof Date) {
+ return formatDate( (Date) param);
+ } else if (param instanceof Collection) {
+ StringBuilder b = new StringBuilder();
+ for(Object o : (Collection>) param) {
+ if(b.length() > 0) {
+ b.append(",");
+ }
+ b.append(String.valueOf(o));
+ }
+ return b.toString();
+ } else {
+ return String.valueOf(param);
+ }
+ }
+
+ /**
+ * Converts a parameter to a {@link MultiValueMap} for use in REST requests
+ * @param collectionFormat The format to convert to
+ * @param name The name of the parameter
+ * @param value The parameter's value
+ * @return a Map containing the String value(s) of the input parameter
+ */
+ public MultiValueMap parameterToMultiValueMap(CollectionFormat collectionFormat, String name, Object value) {
+ final MultiValueMap params = new LinkedMultiValueMap();
+
+ if (name == null || name.isEmpty() || value == null) {
+ return params;
+ }
+
+ if(collectionFormat == null) {
+ collectionFormat = CollectionFormat.CSV;
+ }
+
+ Collection> valueCollection = null;
+ if (value instanceof Collection) {
+ valueCollection = (Collection>) value;
+ } else {
+ params.add(name, parameterToString(value));
+ return params;
+ }
+
+ if (valueCollection.isEmpty()){
+ return params;
+ }
+
+ if (collectionFormat.equals(CollectionFormat.MULTI)) {
+ for (Object item : valueCollection) {
+ params.add(name, parameterToString(item));
+ }
+ return params;
+ }
+
+ List values = new ArrayList();
+ for(Object o : valueCollection) {
+ values.add(parameterToString(o));
+ }
+ params.add(name, collectionFormat.collectionToString(values));
+
+ return params;
+ }
+
+ /**
+ * Check if the given {@code String} is a JSON MIME.
+ * @param mediaType the input MediaType
+ * @return boolean true if the MediaType represents JSON, false otherwise
+ */
+ public boolean isJsonMime(String mediaType) {
+ // "* / *" is default to JSON
+ if ("*/*".equals(mediaType)) {
+ return true;
+ }
+
+ try {
+ return isJsonMime(MediaType.parseMediaType(mediaType));
+ } catch (InvalidMediaTypeException e) {
+ }
+ return false;
+ }
+
+ /**
+ * Check if the given MIME is a JSON MIME.
+ * JSON MIME examples:
+ * application/json
+ * application/json; charset=UTF8
+ * APPLICATION/JSON
+ * @param mediaType the input MediaType
+ * @return boolean true if the MediaType represents JSON, false otherwise
+ */
+ public boolean isJsonMime(MediaType mediaType) {
+ return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*\\+json[;]?\\s*$"));
+ }
+
+ /**
+ * Select the Accept header's value from the given accepts array:
+ * if JSON exists in the given array, use it;
+ * otherwise use all of them (joining into a string)
+ *
+ * @param accepts The accepts array to select from
+ * @return List The list of MediaTypes to use for the Accept header
+ */
+ public List selectHeaderAccept(String[] accepts) {
+ if (accepts.length == 0) {
+ return null;
+ }
+ for (String accept : accepts) {
+ MediaType mediaType = MediaType.parseMediaType(accept);
+ if (isJsonMime(mediaType)) {
+ return Collections.singletonList(mediaType);
+ }
+ }
+ return MediaType.parseMediaTypes(StringUtils.arrayToCommaDelimitedString(accepts));
+ }
+
+ /**
+ * Select the Content-Type header's value from the given array:
+ * if JSON exists in the given array, use it;
+ * otherwise use the first one of the array.
+ *
+ * @param contentTypes The Content-Type array to select from
+ * @return MediaType The Content-Type header to use. If the given array is empty, JSON will be used.
+ */
+ public MediaType selectHeaderContentType(String[] contentTypes) {
+ if (contentTypes.length == 0) {
+ return MediaType.APPLICATION_JSON;
+ }
+ for (String contentType : contentTypes) {
+ MediaType mediaType = MediaType.parseMediaType(contentType);
+ if (isJsonMime(mediaType)) {
+ return mediaType;
+ }
+ }
+ return MediaType.parseMediaType(contentTypes[0]);
+ }
+
+ /**
+ * Select the body to use for the request
+ * @param obj the body object
+ * @param formParams the form parameters
+ * @param contentType the content type of the request
+ * @return Object the selected body
+ */
+ protected BodyInserter, ? super ClientHttpRequest> selectBody(Object obj, MultiValueMap formParams, MediaType contentType) {
+ boolean isForm = MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType) || MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(contentType);
+ return isForm ? BodyInserters.fromMultipartData(formParams) : (obj != null ? BodyInserters.fromObject(obj) : null);
+ }
+
+ /**
+ * Invoke API by sending HTTP request with the given options.
+ *
+ * @param the return type to use
+ * @param path The sub-path of the HTTP URL
+ * @param method The request method
+ * @param queryParams The query parameters
+ * @param body The request body object
+ * @param headerParams The header parameters
+ * @param formParams The form parameters
+ * @param accept The request's Accept header
+ * @param contentType The request's Content-Type header
+ * @param authNames The authentications to apply
+ * @param returnType The return type into which to deserialize the response
+ * @return The response body in chosen type
+ */
+ public Mono invokeAPI(String path, HttpMethod method, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException {
+ final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, queryParams, body, headerParams, formParams, accept, contentType, authNames);
+
+ return requestBuilder.exchange()
+ .flatMap(response -> {
+ HttpStatus statusCode = response.statusCode();
+ if (response.statusCode() == HttpStatus.NO_CONTENT) {
+ return Mono.empty();
+ } else if (statusCode.is2xxSuccessful()) {
+ if (returnType == null) {
+ return Mono.empty();
+ } else {
+ return response.bodyToMono(returnType);
+ }
+ } else {
+ return Mono.error(new RestClientException("API returned " + statusCode + " and it wasn't handled by the RestTemplate error handler"));
+ }
+ });
+ }
+
+ /**
+ * Invoke API by sending HTTP request with the given options.
+ *
+ * @param the return type to use
+ * @param path The sub-path of the HTTP URL
+ * @param method The request method
+ * @param queryParams The query parameters
+ * @param body The request body object
+ * @param headerParams The header parameters
+ * @param formParams The form parameters
+ * @param accept The request's Accept header
+ * @param contentType The request's Content-Type header
+ * @param authNames The authentications to apply
+ * @param returnType The return type into which to deserialize the response
+ * @return The response body in chosen type
+ */
+ public Flux invokeFluxAPI(String path, HttpMethod method, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException {
+ final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, queryParams, body, headerParams, formParams, accept, contentType, authNames);
+
+ return requestBuilder.exchange()
+ .flatMapMany(response -> {
+ HttpStatus statusCode = response.statusCode();
+ ClientResponse.Headers headers = response.headers();
+ if (response.statusCode() == HttpStatus.NO_CONTENT) {
+ return Flux.empty();
+ } else if (statusCode.is2xxSuccessful()) {
+ if (returnType == null) {
+ return Flux.empty();
+ } else {
+ return response.bodyToFlux(returnType);
+ }
+ } else {
+ return Flux.error(new RestClientException("API returned " + statusCode + " and it wasn't handled by the RestTemplate error handler"));
+ }
+ });
+ }
+
+ private WebClient.RequestBodySpec prepareRequest(String path, HttpMethod method, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames) {
+ updateParamsForAuth(authNames, queryParams, headerParams);
+
+ final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path);
+ if (queryParams != null) {
+ //encode the query parameters in case they contain unsafe characters
+ for (List values : queryParams.values()) {
+ if (values != null) {
+ for (int i = 0; i < values.size(); i++) {
+ try {
+ values.set(i, URLEncoder.encode(values.get(i), "utf8"));
+ } catch (UnsupportedEncodingException e) {
+
+ }
+ }
+ }
+ }
+ builder.queryParams(queryParams);
+ }
+
+ final WebClient.RequestBodySpec requestBuilder = webClient.method(method).uri(builder.build().toUri());
+ if(accept != null) {
+ requestBuilder.accept(accept.toArray(new MediaType[accept.size()]));
+ }
+ if(contentType != null) {
+ requestBuilder.contentType(contentType);
+ }
+
+ addHeadersToRequest(headerParams, requestBuilder);
+ addHeadersToRequest(defaultHeaders, requestBuilder);
+
+ requestBuilder.body(selectBody(body, formParams, contentType));
+ return requestBuilder;
+ }
+
+ /**
+ * Add headers to the request that is being built
+ * @param headers The headers to add
+ * @param requestBuilder The current request
+ */
+ protected void addHeadersToRequest(HttpHeaders headers, WebClient.RequestBodySpec requestBuilder) {
+ for (Entry> entry : headers.entrySet()) {
+ List values = entry.getValue();
+ for(String value : values) {
+ if (value != null) {
+ requestBuilder.header(entry.getKey(), value);
+ }
+ }
+ }
+ }
+
+ /**
+ * Update query and header parameters based on authentication settings.
+ *
+ * @param authNames The authentications to apply
+ * @param queryParams The query parameters
+ * @param headerParams The header parameters
+ */
+ private void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams) {
+ for (String authName : authNames) {
+ Authentication auth = authentications.get(authName);
+ if (auth == null) {
+ throw new RestClientException("Authentication undefined: " + authName);
+ }
+ auth.applyToParams(queryParams, headerParams);
+ }
+ }
+
+ private class ApiClientHttpRequestInterceptor implements ClientHttpRequestInterceptor {
+ private final Log log = LogFactory.getLog(ApiClientHttpRequestInterceptor.class);
+
+ @Override
+ public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException {
+ logRequest(request, body);
+ ClientHttpResponse response = execution.execute(request, body);
+ logResponse(response);
+ return response;
+ }
+
+ private void logRequest(HttpRequest request, byte[] body) throws UnsupportedEncodingException {
+ log.info("URI: " + request.getURI());
+ log.info("HTTP Method: " + request.getMethod());
+ log.info("HTTP Headers: " + headersToString(request.getHeaders()));
+ log.info("Request Body: " + new String(body, StandardCharsets.UTF_8));
+ }
+
+ private void logResponse(ClientHttpResponse response) throws IOException {
+ log.info("HTTP Status Code: " + response.getRawStatusCode());
+ log.info("Status Text: " + response.getStatusText());
+ log.info("HTTP Headers: " + headersToString(response.getHeaders()));
+ log.info("Response Body: " + bodyToString(response.getBody()));
+ }
+
+ private String headersToString(HttpHeaders headers) {
+ StringBuilder builder = new StringBuilder();
+ for(Entry> entry : headers.entrySet()) {
+ builder.append(entry.getKey()).append("=[");
+ for(String value : entry.getValue()) {
+ builder.append(value).append(",");
+ }
+ builder.setLength(builder.length() - 1); // Get rid of trailing comma
+ builder.append("],");
+ }
+ builder.setLength(builder.length() - 1); // Get rid of trailing comma
+ return builder.toString();
+ }
+
+ private String bodyToString(InputStream body) throws IOException {
+ StringBuilder builder = new StringBuilder();
+ BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(body, StandardCharsets.UTF_8));
+ String line = bufferedReader.readLine();
+ while (line != null) {
+ builder.append(line).append(System.lineSeparator());
+ line = bufferedReader.readLine();
+ }
+ bufferedReader.close();
+ return builder.toString();
+ }
+ }
+}
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
new file mode 100644
index 000000000000..6d6a38e25c05
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache
@@ -0,0 +1,107 @@
+package {{package}};
+
+import {{invokerPackage}}.ApiClient;
+
+{{#imports}}import {{import}};
+{{/imports}}
+
+{{^fullJavaUtil}}import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;{{/fullJavaUtil}}
+
+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.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import reactor.core.publisher.Mono;
+import reactor.core.publisher.Flux;
+
+{{>generatedAnnotation}}
+{{#operations}}
+public class {{classname}} {
+ private ApiClient {{localVariablePrefix}}apiClient;
+
+ public {{classname}}() {
+ this(new ApiClient());
+ }
+
+ @Autowired
+ public {{classname}}(ApiClient apiClient) {
+ this.{{localVariablePrefix}}apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return {{localVariablePrefix}}apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.{{localVariablePrefix}}apiClient = apiClient;
+ }
+
+ {{#operation}}
+ /**
+ * {{summary}}
+ * {{notes}}
+{{#responses}} *
{{code}}{{#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
+{{#externalDocs}}
+ * {{description}}
+ * @see {{summary}} Documentation
+{{/externalDocs}}
+ */
+ public {{#returnType}}{{#isListContainer}}Flux<{{{returnBaseType}}}>{{/isListContainer}}{{^isListContainer}}Mono<{{{returnType}}}>{{/isListContainer}} {{/returnType}}{{^returnType}}Mono {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws RestClientException {
+ Object {{localVariablePrefix}}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}}");
+ }
+ {{/required}}{{/allParams}}{{#hasPathParams}}
+ // create path and map variables
+ final Map uriVariables = new HashMap();{{#pathParams}}
+ uriVariables.put("{{baseName}}", {{{paramName}}});{{/pathParams}}{{/hasPathParams}}
+ String {{localVariablePrefix}}path = UriComponentsBuilder.fromPath("{{{path}}}"){{#hasPathParams}}.buildAndExpand(uriVariables){{/hasPathParams}}{{^hasPathParams}}.build(){{/hasPathParams}}.toUriString();
+
+ final MultiValueMap {{localVariablePrefix}}queryParams = new LinkedMultiValueMap();
+ final HttpHeaders {{localVariablePrefix}}headerParams = new HttpHeaders();
+ final MultiValueMap {{localVariablePrefix}}formParams = new LinkedMultiValueMap();{{#hasQueryParams}}
+
+ {{#queryParams}}{{localVariablePrefix}}queryParams.putAll({{localVariablePrefix}}apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{collectionFormat}}}".toUpperCase()){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}));{{#hasMore}}
+ {{/hasMore}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}}
+
+ {{#headerParams}}if ({{paramName}} != null)
+ {{localVariablePrefix}}headerParams.add("{{baseName}}", {{localVariablePrefix}}apiClient.parameterToString({{paramName}}));{{#hasMore}}
+ {{/hasMore}}{{/headerParams}}{{/hasHeaderParams}}{{#hasFormParams}}
+
+ {{#formParams}}if ({{paramName}} != null)
+ {{localVariablePrefix}}formParams.add("{{baseName}}", {{#isFile}}new FileSystemResource({{paramName}}){{/isFile}}{{^isFile}}{{paramName}}{{/isFile}});{{#hasMore}}
+ {{/hasMore}}{{/formParams}}{{/hasFormParams}}
+
+ final String[] {{localVariablePrefix}}accepts = { {{#hasProduces}}
+ {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}}
+ {{/hasProduces}}};
+ final List {{localVariablePrefix}}accept = {{localVariablePrefix}}apiClient.selectHeaderAccept({{localVariablePrefix}}accepts);
+ final String[] {{localVariablePrefix}}contentTypes = { {{#hasConsumes}}
+ {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}}
+ {{/hasConsumes}}};
+ final MediaType {{localVariablePrefix}}contentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}contentTypes);
+
+ String[] {{localVariablePrefix}}authNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} };
+
+ {{#returnType}}ParameterizedTypeReference<{{#isListContainer}}{{{returnBaseType}}}{{/isListContainer}}{{^isListContainer}}{{{returnType}}}{{/isListContainer}}> {{localVariablePrefix}}returnType = new ParameterizedTypeReference<{{#isListContainer}}{{{returnBaseType}}}{{/isListContainer}}{{^isListContainer}}{{{returnType}}}{{/isListContainer}}>() {};{{/returnType}}{{^returnType}}ParameterizedTypeReference {{localVariablePrefix}}returnType = new ParameterizedTypeReference() {};{{/returnType}}
+ return {{localVariablePrefix}}apiClient.{{#isListContainer}}invokeFluxAPI{{/isListContainer}}{{^isListContainer}}invokeAPI{{/isListContainer}}({{localVariablePrefix}}path, HttpMethod.{{httpMethod}}, {{localVariablePrefix}}queryParams, {{localVariablePrefix}}postBody, {{localVariablePrefix}}headerParams, {{localVariablePrefix}}formParams, {{localVariablePrefix}}accept, {{localVariablePrefix}}contentType, {{localVariablePrefix}}authNames, {{localVariablePrefix}}returnType);
+ }
+ {{/operation}}
+}
+{{/operations}}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache
new file mode 100644
index 000000000000..f1dca2f41cf7
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache
@@ -0,0 +1,45 @@
+{{>licenseInfo}}
+
+package {{package}};
+
+import {{invokerPackage}}.ApiException;
+{{#imports}}import {{import}};
+{{/imports}}
+import org.junit.Test;
+import org.junit.Ignore;
+
+{{^fullJavaUtil}}
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+{{/fullJavaUtil}}
+
+/**
+ * API tests for {{classname}}
+ */
+@Ignore
+public class {{classname}}Test {
+
+ private final {{classname}} api = new {{classname}}();
+
+ {{#operations}}{{#operation}}
+ /**
+ * {{summary}}
+ *
+ * {{notes}}
+ *
+ * @throws ApiException
+ * if the Api call fails
+ */
+ @Test
+ public void {{operationId}}Test() throws ApiException {
+ {{#allParams}}
+ {{{dataType}}} {{paramName}} = null;
+ {{/allParams}}
+ {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#isListContainer}}.collectList().block(){{/isListContainer}}{{^isListContainer}}.block(){{/isListContainer}};
+
+ // TODO: test validations
+ }
+ {{/operation}}{{/operations}}
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/ApiKeyAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/ApiKeyAuth.mustache
new file mode 100644
index 000000000000..8b8c40fde755
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/ApiKeyAuth.mustache
@@ -0,0 +1,60 @@
+package {{invokerPackage}}.auth;
+
+import org.springframework.http.HttpHeaders;
+import org.springframework.util.MultiValueMap;
+
+{{>generatedAnnotation}}
+public class ApiKeyAuth implements Authentication {
+ private final String location;
+ private final String paramName;
+
+ private String apiKey;
+ private String apiKeyPrefix;
+
+ public ApiKeyAuth(String location, String paramName) {
+ this.location = location;
+ this.paramName = paramName;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public String getParamName() {
+ return paramName;
+ }
+
+ public String getApiKey() {
+ return apiKey;
+ }
+
+ public void setApiKey(String apiKey) {
+ this.apiKey = apiKey;
+ }
+
+ public String getApiKeyPrefix() {
+ return apiKeyPrefix;
+ }
+
+ public void setApiKeyPrefix(String apiKeyPrefix) {
+ this.apiKeyPrefix = apiKeyPrefix;
+ }
+
+ @Override
+ public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams) {
+ if (apiKey == null) {
+ return;
+ }
+ String value;
+ if (apiKeyPrefix != null) {
+ value = apiKeyPrefix + " " + apiKey;
+ } else {
+ value = apiKey;
+ }
+ if (location.equals("query")) {
+ queryParams.add(paramName, value);
+ } else if (location.equals("header")) {
+ headerParams.add(paramName, value);
+ }
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/Authentication.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/Authentication.mustache
new file mode 100644
index 000000000000..586de70836ae
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/Authentication.mustache
@@ -0,0 +1,13 @@
+package {{invokerPackage}}.auth;
+
+import org.springframework.http.HttpHeaders;
+import org.springframework.util.MultiValueMap;
+
+public interface Authentication {
+ /**
+ * Apply authentication settings to header and / or query parameters.
+ * @param queryParams The query parameters for the request
+ * @param headerParams The header parameters for the request
+ */
+ public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams);
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/HttpBasicAuth.mustache
new file mode 100644
index 000000000000..5f535b3698a7
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/HttpBasicAuth.mustache
@@ -0,0 +1,39 @@
+package {{invokerPackage}}.auth;
+
+import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
+
+import org.springframework.http.HttpHeaders;
+import org.springframework.util.Base64Utils;
+import org.springframework.util.MultiValueMap;
+
+{{>generatedAnnotation}}
+public class HttpBasicAuth implements Authentication {
+ private String username;
+ private String password;
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ @Override
+ public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams) {
+ if (username == null && password == null) {
+ return;
+ }
+ String str = (username == null ? "" : username) + ":" + (password == null ? "" : password);
+ headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64Utils.encodeToString(str.getBytes(StandardCharsets.UTF_8)));
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/OAuth.mustache
new file mode 100644
index 000000000000..fbb2f7f9c72a
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/OAuth.mustache
@@ -0,0 +1,24 @@
+package {{invokerPackage}}.auth;
+
+import org.springframework.http.HttpHeaders;
+import org.springframework.util.MultiValueMap;
+
+{{>generatedAnnotation}}
+public class OAuth implements Authentication {
+ private String accessToken;
+
+ public String getAccessToken() {
+ return accessToken;
+ }
+
+ public void setAccessToken(String accessToken) {
+ this.accessToken = accessToken;
+ }
+
+ @Override
+ public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams) {
+ if (accessToken != null) {
+ headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken);
+ }
+ }
+}
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/OAuthFlow.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/OAuthFlow.mustache
new file mode 100644
index 000000000000..7ab35f6d890a
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/auth/OAuthFlow.mustache
@@ -0,0 +1,5 @@
+package {{invokerPackage}}.auth;
+
+public enum OAuthFlow {
+ accessCode, implicit, password, application
+}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache
new file mode 100644
index 000000000000..4771a9bb6587
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache
@@ -0,0 +1,135 @@
+
+ 4.0.0
+ {{groupId}}
+ {{artifactId}}
+ jar
+ {{artifactId}}
+ {{artifactVersion}}
+ {{artifactUrl}}
+ {{artifactDescription}}
+
+ {{scmConnection}}
+ {{scmDeveloperConnection}}
+ {{scmUrl}}
+
+
+
+
+ {{licenseName}}
+ {{licenseUrl}}
+ repo
+
+
+
+
+
+ {{developerName}}
+ {{developerEmail}}
+ {{developerOrganization}}
+ {{developerOrganizationUrl}}
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.6.1
+
+ 1.8
+ 1.8
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 2.2.1
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+
+
+
+
+
+ io.swagger
+ swagger-annotations
+ ${swagger-annotations-version}
+
+
+
+ io.projectreactor
+ reactor-core
+ ${reactor-version}
+
+
+
+
+ org.springframework
+ spring-webflux
+ ${spring-web-version}
+
+
+
+ io.projectreactor.ipc
+ reactor-netty
+ ${reactor-netty-version}
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson-version}
+
+
+ {{#java8}}
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+ ${jackson-version}
+
+ {{/java8}}
+ {{#joda}}
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-joda
+ ${jackson-version}
+
+
+ joda-time
+ joda-time
+ ${jodatime-version}
+
+ {{/joda}}
+
+
+
+ junit
+ junit
+ ${junit-version}
+ test
+
+
+
+ UTF-8
+ 1.5.20
+ 5.0.7.RELEASE
+ 2.9.5
+ 4.12
+ 3.1.8.RELEASE
+ 0.7.8.RELEASE
+ {{#joda}}
+ 2.9.9
+ {{/joda}}
+
+
diff --git a/samples/client/petstore/java/webclient/.gitignore b/samples/client/petstore/java/webclient/.gitignore
new file mode 100644
index 000000000000..a530464afa1b
--- /dev/null
+++ b/samples/client/petstore/java/webclient/.gitignore
@@ -0,0 +1,21 @@
+*.class
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.ear
+
+# exclude jar for gradle wrapper
+!gradle/wrapper/*.jar
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+
+# build files
+**/target
+target
+.gradle
+build
diff --git a/samples/client/petstore/java/webclient/.openapi-generator-ignore b/samples/client/petstore/java/webclient/.openapi-generator-ignore
new file mode 100644
index 000000000000..7484ee590a38
--- /dev/null
+++ b/samples/client/petstore/java/webclient/.openapi-generator-ignore
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/samples/client/petstore/java/webclient/.openapi-generator/VERSION b/samples/client/petstore/java/webclient/.openapi-generator/VERSION
new file mode 100644
index 000000000000..0628777500bd
--- /dev/null
+++ b/samples/client/petstore/java/webclient/.openapi-generator/VERSION
@@ -0,0 +1 @@
+3.1.0-SNAPSHOT
\ No newline at end of file
diff --git a/samples/client/petstore/java/webclient/.travis.yml b/samples/client/petstore/java/webclient/.travis.yml
new file mode 100644
index 000000000000..80a7f2fc66c0
--- /dev/null
+++ b/samples/client/petstore/java/webclient/.travis.yml
@@ -0,0 +1,17 @@
+#
+# Generated by: https://openapi-generator.tech
+#
+language: java
+jdk:
+ - oraclejdk8
+ - oraclejdk7
+before_install:
+ # ensure gradlew has proper permission
+ - chmod a+x ./gradlew
+script:
+ # test using maven
+ - mvn test
+ # uncomment below to test using gradle
+ # - gradle test
+ # uncomment below to test using sbt
+ # - sbt test
diff --git a/samples/client/petstore/java/webclient/README.md b/samples/client/petstore/java/webclient/README.md
new file mode 100644
index 000000000000..3715c784c81d
--- /dev/null
+++ b/samples/client/petstore/java/webclient/README.md
@@ -0,0 +1,214 @@
+# petstore-webclient
+
+OpenAPI Petstore
+- API version: 1.0.0
+
+This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+
+
+*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
+
+
+## Requirements
+
+Building the API client library requires:
+1. Java 1.7+
+2. Maven/Gradle
+
+## Installation
+
+To install the API client library to your local Maven repository, simply execute:
+
+```shell
+mvn clean install
+```
+
+To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
+
+```shell
+mvn clean deploy
+```
+
+Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
+
+### Maven users
+
+Add this dependency to your project's POM:
+
+```xml
+
+ org.openapitools
+ petstore-webclient
+ 1.0.0
+ compile
+
+```
+
+### Gradle users
+
+Add this dependency to your project's build file:
+
+```groovy
+compile "org.openapitools:petstore-webclient:1.0.0"
+```
+
+### Others
+
+At first generate the JAR by executing:
+
+```shell
+mvn clean package
+```
+
+Then manually install the following JARs:
+
+* `target/petstore-webclient-1.0.0.jar`
+* `target/lib/*.jar`
+
+## Getting Started
+
+Please follow the [installation](#installation) instruction and execute the following Java code:
+
+```java
+
+import org.openapitools.client.*;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.AnotherFakeApi;
+
+import java.io.File;
+import java.util.*;
+
+public class AnotherFakeApiExample {
+
+ public static void main(String[] args) {
+
+ AnotherFakeApi apiInstance = new AnotherFakeApi();
+ Client client = new Client(); // Client | client model
+ try {
+ Client result = apiInstance.testSpecialTags(client);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling AnotherFakeApi#testSpecialTags");
+ e.printStackTrace();
+ }
+ }
+}
+
+```
+
+## Documentation for API Endpoints
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Class | Method | HTTP request | Description
+------------ | ------------- | ------------- | -------------
+*AnotherFakeApi* | [**testSpecialTags**](docs/AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
+*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
+*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
+*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
+*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
+*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
+*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
+*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
+*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
+*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
+*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
+*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
+*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
+*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
+*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
+*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
+*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
+*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
+*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
+*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
+*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
+*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
+*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
+*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
+*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user
+*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
+*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
+*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
+*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
+*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
+*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
+*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
+
+
+## Documentation for Models
+
+ - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
+ - [Animal](docs/Animal.md)
+ - [AnimalFarm](docs/AnimalFarm.md)
+ - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
+ - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
+ - [ArrayTest](docs/ArrayTest.md)
+ - [Capitalization](docs/Capitalization.md)
+ - [Cat](docs/Cat.md)
+ - [Category](docs/Category.md)
+ - [ClassModel](docs/ClassModel.md)
+ - [Client](docs/Client.md)
+ - [Dog](docs/Dog.md)
+ - [EnumArrays](docs/EnumArrays.md)
+ - [EnumClass](docs/EnumClass.md)
+ - [EnumTest](docs/EnumTest.md)
+ - [FormatTest](docs/FormatTest.md)
+ - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
+ - [MapTest](docs/MapTest.md)
+ - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
+ - [Model200Response](docs/Model200Response.md)
+ - [ModelApiResponse](docs/ModelApiResponse.md)
+ - [ModelReturn](docs/ModelReturn.md)
+ - [Name](docs/Name.md)
+ - [NumberOnly](docs/NumberOnly.md)
+ - [Order](docs/Order.md)
+ - [OuterComposite](docs/OuterComposite.md)
+ - [OuterEnum](docs/OuterEnum.md)
+ - [Pet](docs/Pet.md)
+ - [ReadOnlyFirst](docs/ReadOnlyFirst.md)
+ - [SpecialModelName](docs/SpecialModelName.md)
+ - [StringBooleanMap](docs/StringBooleanMap.md)
+ - [Tag](docs/Tag.md)
+ - [User](docs/User.md)
+
+
+## Documentation for Authorization
+
+Authentication schemes defined for the API:
+### api_key
+
+- **Type**: API key
+- **API key parameter name**: api_key
+- **Location**: HTTP header
+
+### api_key_query
+
+- **Type**: API key
+- **API key parameter name**: api_key_query
+- **Location**: URL query string
+
+### http_basic_test
+
+- **Type**: HTTP basic authentication
+
+### petstore_auth
+
+- **Type**: OAuth
+- **Flow**: implicit
+- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
+- **Scopes**:
+ - write:pets: modify pets in your account
+ - read:pets: read your pets
+
+
+## Recommendation
+
+It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
+
+## Author
+
+
+
diff --git a/samples/client/petstore/java/webclient/build.gradle b/samples/client/petstore/java/webclient/build.gradle
new file mode 100644
index 000000000000..4839efb77640
--- /dev/null
+++ b/samples/client/petstore/java/webclient/build.gradle
@@ -0,0 +1,129 @@
+apply plugin: 'idea'
+apply plugin: 'eclipse'
+
+group = 'org.openapitools'
+version = '1.0.0'
+
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:2.3.+'
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
+ }
+}
+
+repositories {
+ jcenter()
+}
+
+if(hasProperty('target') && target == 'android') {
+
+ apply plugin: 'com.android.library'
+ apply plugin: 'com.github.dcendents.android-maven'
+
+ android {
+ compileSdkVersion 25
+ buildToolsVersion '25.0.2'
+ defaultConfig {
+ minSdkVersion 14
+ targetSdkVersion 25
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+
+ // Rename the aar correctly
+ libraryVariants.all { variant ->
+ variant.outputs.each { output ->
+ def outputFile = output.outputFile
+ if (outputFile != null && outputFile.name.endsWith('.aar')) {
+ def fileName = "${project.name}-${variant.baseName}-${version}.aar"
+ output.outputFile = new File(outputFile.parent, fileName)
+ }
+ }
+ }
+
+ dependencies {
+ provided 'javax.annotation:jsr250-api:1.0'
+ }
+ }
+
+ afterEvaluate {
+ android.libraryVariants.all { variant ->
+ def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
+ task.description = "Create jar artifact for ${variant.name}"
+ task.dependsOn variant.javaCompile
+ task.from variant.javaCompile.destinationDir
+ task.destinationDir = project.file("${project.buildDir}/outputs/jar")
+ task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
+ artifacts.add('archives', task);
+ }
+ }
+
+ task sourcesJar(type: Jar) {
+ from android.sourceSets.main.java.srcDirs
+ classifier = 'sources'
+ }
+
+ artifacts {
+ archives sourcesJar
+ }
+
+} else {
+
+ apply plugin: 'java'
+ apply plugin: 'maven'
+
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+
+ install {
+ repositories.mavenInstaller {
+ pom.artifactId = 'petstore-webclient'
+ }
+ }
+
+ task execute(type:JavaExec) {
+ main = System.getProperty('mainClass')
+ classpath = sourceSets.main.runtimeClasspath
+ }
+
+ task sourcesJar(type: Jar, dependsOn: classes) {
+ classifier = 'sources'
+ from sourceSets.main.allSource
+ }
+
+ task javadocJar(type: Jar, dependsOn: javadoc) {
+ classifier = 'javadoc'
+ from javadoc.destinationDir
+ }
+
+ artifacts {
+ archives sourcesJar
+ archives javadocJar
+ }
+}
+
+ext {
+ swagger_annotations_version = "1.5.17"
+ jackson_version = "2.8.9"
+ jersey_version = "1.19.4"
+ jodatime_version = "2.9.9"
+ junit_version = "4.12"
+}
+
+dependencies {
+ compile "io.swagger:swagger-annotations:$swagger_annotations_version"
+ compile "com.sun.jersey:jersey-client:$jersey_version"
+ compile "com.sun.jersey.contribs:jersey-multipart:$jersey_version"
+ compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
+ compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
+ compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
+ compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version"
+ compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
+ testCompile "junit:junit:$junit_version"
+}
+
diff --git a/samples/client/petstore/java/webclient/build.sbt b/samples/client/petstore/java/webclient/build.sbt
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/samples/client/petstore/java/webclient/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/webclient/docs/AdditionalPropertiesClass.md
new file mode 100644
index 000000000000..0437c4dd8cc7
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/AdditionalPropertiesClass.md
@@ -0,0 +1,11 @@
+
+# AdditionalPropertiesClass
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**mapProperty** | **Map<String, String>** | | [optional]
+**mapOfMapProperty** | [**Map<String, Map<String, String>>**](Map.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/Animal.md b/samples/client/petstore/java/webclient/docs/Animal.md
new file mode 100644
index 000000000000..b3f325c3524d
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/Animal.md
@@ -0,0 +1,11 @@
+
+# Animal
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**className** | **String** | |
+**color** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/AnimalFarm.md b/samples/client/petstore/java/webclient/docs/AnimalFarm.md
new file mode 100644
index 000000000000..c7c7f1ddcce6
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/AnimalFarm.md
@@ -0,0 +1,9 @@
+
+# AnimalFarm
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/AnotherFakeApi.md b/samples/client/petstore/java/webclient/docs/AnotherFakeApi.md
new file mode 100644
index 000000000000..edb115b7933e
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/AnotherFakeApi.md
@@ -0,0 +1,54 @@
+# AnotherFakeApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
+
+
+
+# **testSpecialTags**
+> Client testSpecialTags(client)
+
+To test special tags
+
+To test special tags
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.AnotherFakeApi;
+
+
+AnotherFakeApi apiInstance = new AnotherFakeApi();
+Client client = new Client(); // Client | client model
+try {
+ Client result = apiInstance.testSpecialTags(client);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling AnotherFakeApi#testSpecialTags");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **client** | [**Client**](Client.md)| client model |
+
+### Return type
+
+[**Client**](Client.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
diff --git a/samples/client/petstore/java/webclient/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/webclient/docs/ArrayOfArrayOfNumberOnly.md
new file mode 100644
index 000000000000..772925499274
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/ArrayOfArrayOfNumberOnly.md
@@ -0,0 +1,10 @@
+
+# ArrayOfArrayOfNumberOnly
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**arrayArrayNumber** | [**List<List<BigDecimal>>**](List.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/webclient/docs/ArrayOfNumberOnly.md
new file mode 100644
index 000000000000..e8cc4cd36dc0
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/ArrayOfNumberOnly.md
@@ -0,0 +1,10 @@
+
+# ArrayOfNumberOnly
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**arrayNumber** | [**List<BigDecimal>**](BigDecimal.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/ArrayTest.md b/samples/client/petstore/java/webclient/docs/ArrayTest.md
new file mode 100644
index 000000000000..9feee16427fb
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/ArrayTest.md
@@ -0,0 +1,12 @@
+
+# ArrayTest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**arrayOfString** | **List<String>** | | [optional]
+**arrayArrayOfInteger** | [**List<List<Long>>**](List.md) | | [optional]
+**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/Capitalization.md b/samples/client/petstore/java/webclient/docs/Capitalization.md
new file mode 100644
index 000000000000..0f3064c1996f
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/Capitalization.md
@@ -0,0 +1,15 @@
+
+# Capitalization
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**smallCamel** | **String** | | [optional]
+**capitalCamel** | **String** | | [optional]
+**smallSnake** | **String** | | [optional]
+**capitalSnake** | **String** | | [optional]
+**scAETHFlowPoints** | **String** | | [optional]
+**ATT_NAME** | **String** | Name of the pet | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/Cat.md b/samples/client/petstore/java/webclient/docs/Cat.md
new file mode 100644
index 000000000000..6e9f71ce7dd0
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/Cat.md
@@ -0,0 +1,10 @@
+
+# Cat
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**declawed** | **Boolean** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/Category.md b/samples/client/petstore/java/webclient/docs/Category.md
new file mode 100644
index 000000000000..e2df08032787
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/Category.md
@@ -0,0 +1,11 @@
+
+# Category
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/ClassModel.md b/samples/client/petstore/java/webclient/docs/ClassModel.md
new file mode 100644
index 000000000000..64f880c87869
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/ClassModel.md
@@ -0,0 +1,10 @@
+
+# ClassModel
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**propertyClass** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/Client.md b/samples/client/petstore/java/webclient/docs/Client.md
new file mode 100644
index 000000000000..5c490ea166c7
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/Client.md
@@ -0,0 +1,10 @@
+
+# Client
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**client** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/Dog.md b/samples/client/petstore/java/webclient/docs/Dog.md
new file mode 100644
index 000000000000..ac7cea323ffd
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/Dog.md
@@ -0,0 +1,10 @@
+
+# Dog
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**breed** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/EnumArrays.md b/samples/client/petstore/java/webclient/docs/EnumArrays.md
new file mode 100644
index 000000000000..4dddc0bfd27b
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/EnumArrays.md
@@ -0,0 +1,27 @@
+
+# EnumArrays
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional]
+**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional]
+
+
+
+## Enum: JustSymbolEnum
+Name | Value
+---- | -----
+GREATER_THAN_OR_EQUAL_TO | ">="
+DOLLAR | "$"
+
+
+
+## Enum: List<ArrayEnumEnum>
+Name | Value
+---- | -----
+FISH | "fish"
+CRAB | "crab"
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/EnumClass.md b/samples/client/petstore/java/webclient/docs/EnumClass.md
new file mode 100644
index 000000000000..c746edc3cb1e
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/EnumClass.md
@@ -0,0 +1,14 @@
+
+# EnumClass
+
+## Enum
+
+
+* `_ABC` (value: `"_abc"`)
+
+* `_EFG` (value: `"-efg"`)
+
+* `_XYZ_` (value: `"(xyz)"`)
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/EnumTest.md b/samples/client/petstore/java/webclient/docs/EnumTest.md
new file mode 100644
index 000000000000..ca048bcc515b
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/EnumTest.md
@@ -0,0 +1,48 @@
+
+# EnumTest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional]
+**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | |
+**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional]
+**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional]
+**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional]
+
+
+
+## Enum: EnumStringEnum
+Name | Value
+---- | -----
+UPPER | "UPPER"
+LOWER | "lower"
+EMPTY | ""
+
+
+
+## Enum: EnumStringRequiredEnum
+Name | Value
+---- | -----
+UPPER | "UPPER"
+LOWER | "lower"
+EMPTY | ""
+
+
+
+## Enum: EnumIntegerEnum
+Name | Value
+---- | -----
+NUMBER_1 | 1
+NUMBER_MINUS_1 | -1
+
+
+
+## Enum: EnumNumberEnum
+Name | Value
+---- | -----
+NUMBER_1_DOT_1 | 1.1
+NUMBER_MINUS_1_DOT_2 | -1.2
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/FakeApi.md b/samples/client/petstore/java/webclient/docs/FakeApi.md
new file mode 100644
index 000000000000..19206a201470
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/FakeApi.md
@@ -0,0 +1,510 @@
+# FakeApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
+[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
+[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
+[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
+[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
+[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
+[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
+[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
+[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
+
+
+
+# **fakeOuterBooleanSerialize**
+> Boolean fakeOuterBooleanSerialize(body)
+
+
+
+Test serialization of outer boolean types
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.FakeApi;
+
+
+FakeApi apiInstance = new FakeApi();
+Boolean body = true; // Boolean | Input boolean as post body
+try {
+ Boolean result = apiInstance.fakeOuterBooleanSerialize(body);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **Boolean**| Input boolean as post body | [optional]
+
+### Return type
+
+**Boolean**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: */*
+
+
+# **fakeOuterCompositeSerialize**
+> OuterComposite fakeOuterCompositeSerialize(outerComposite)
+
+
+
+Test serialization of object with outer number type
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.FakeApi;
+
+
+FakeApi apiInstance = new FakeApi();
+OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body
+try {
+ OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
+
+### Return type
+
+[**OuterComposite**](OuterComposite.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: */*
+
+
+# **fakeOuterNumberSerialize**
+> BigDecimal fakeOuterNumberSerialize(body)
+
+
+
+Test serialization of outer number types
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.FakeApi;
+
+
+FakeApi apiInstance = new FakeApi();
+BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body
+try {
+ BigDecimal result = apiInstance.fakeOuterNumberSerialize(body);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **BigDecimal**| Input number as post body | [optional]
+
+### Return type
+
+[**BigDecimal**](BigDecimal.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: */*
+
+
+# **fakeOuterStringSerialize**
+> String fakeOuterStringSerialize(body)
+
+
+
+Test serialization of outer string types
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.FakeApi;
+
+
+FakeApi apiInstance = new FakeApi();
+String body = "body_example"; // String | Input string as post body
+try {
+ String result = apiInstance.fakeOuterStringSerialize(body);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **body** | **String**| Input string as post body | [optional]
+
+### Return type
+
+**String**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: */*
+
+
+# **testBodyWithQueryParams**
+> testBodyWithQueryParams(query, user)
+
+
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.FakeApi;
+
+
+FakeApi apiInstance = new FakeApi();
+String query = "query_example"; // String |
+User user = new User(); // User |
+try {
+ apiInstance.testBodyWithQueryParams(query, user);
+} catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testBodyWithQueryParams");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **query** | **String**| |
+ **user** | [**User**](User.md)| |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+
+# **testClientModel**
+> Client testClientModel(client)
+
+To test \"client\" model
+
+To test \"client\" model
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.FakeApi;
+
+
+FakeApi apiInstance = new FakeApi();
+Client client = new Client(); // Client | client model
+try {
+ Client result = apiInstance.testClientModel(client);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testClientModel");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **client** | [**Client**](Client.md)| client model |
+
+### Return type
+
+[**Client**](Client.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
+
+# **testEndpointParameters**
+> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback)
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiClient;
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.Configuration;
+//import org.openapitools.client.auth.*;
+//import org.openapitools.client.api.FakeApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure HTTP basic authorization: http_basic_test
+HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test");
+http_basic_test.setUsername("YOUR USERNAME");
+http_basic_test.setPassword("YOUR PASSWORD");
+
+FakeApi apiInstance = new FakeApi();
+BigDecimal number = new BigDecimal(); // BigDecimal | None
+Double _double = 3.4D; // Double | None
+String patternWithoutDelimiter = "null"; // String | None
+byte[] _byte = null; // byte[] | None
+Integer integer = null; // Integer | None
+Integer int32 = null; // Integer | None
+Long int64 = nullL; // Long | None
+Float _float = nullF; // Float | None
+String string = "null"; // String | None
+File binary = new File("null"); // File | None
+LocalDate date = new LocalDate(); // LocalDate | None
+OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None
+String password = "null"; // String | None
+String paramCallback = "null"; // String | None
+try {
+ apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
+} catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testEndpointParameters");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **number** | **BigDecimal**| None | [default to null]
+ **_double** | **Double**| None | [default to null]
+ **patternWithoutDelimiter** | **String**| None | [default to null]
+ **_byte** | **byte[]**| None | [default to null]
+ **integer** | **Integer**| None | [optional] [default to null]
+ **int32** | **Integer**| None | [optional] [default to null]
+ **int64** | **Long**| None | [optional] [default to null]
+ **_float** | **Float**| None | [optional] [default to null]
+ **string** | **String**| None | [optional] [default to null]
+ **binary** | **File**| None | [optional] [default to null]
+ **date** | **LocalDate**| None | [optional] [default to null]
+ **dateTime** | **OffsetDateTime**| None | [optional] [default to null]
+ **password** | **String**| None | [optional] [default to null]
+ **paramCallback** | **String**| None | [optional] [default to null]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[http_basic_test](../README.md#http_basic_test)
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
+
+
+# **testEnumParameters**
+> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString)
+
+To test enum parameters
+
+To test enum parameters
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.FakeApi;
+
+
+FakeApi apiInstance = new FakeApi();
+List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array)
+String enumHeaderString = "-efg"; // String | Header parameter enum test (string)
+List enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List | Query parameter enum test (string array)
+String enumQueryString = "-efg"; // String | Query parameter enum test (string)
+Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double)
+Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double)
+List enumFormStringArray = "$"; // List | Form parameter enum test (string array)
+String enumFormString = "-efg"; // String | Form parameter enum test (string)
+try {
+ apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
+} catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testEnumParameters");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $]
+ **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
+ **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $]
+ **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
+ **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2]
+ **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2]
+ **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to $] [enum: >, $]
+ **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
+
+
+# **testInlineAdditionalProperties**
+> testInlineAdditionalProperties(requestBody)
+
+test inline additionalProperties
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.FakeApi;
+
+
+FakeApi apiInstance = new FakeApi();
+Map requestBody = new HashMap(); // Map | request body
+try {
+ apiInstance.testInlineAdditionalProperties(requestBody);
+} catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **requestBody** | [**Map<String, String>**](String.md)| request body |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: Not defined
+
+
+# **testJsonFormData**
+> testJsonFormData(param, param2)
+
+test json serialization of form data
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.FakeApi;
+
+
+FakeApi apiInstance = new FakeApi();
+String param = "null"; // String | field1
+String param2 = "null"; // String | field2
+try {
+ apiInstance.testJsonFormData(param, param2);
+} catch (ApiException e) {
+ System.err.println("Exception when calling FakeApi#testJsonFormData");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **param** | **String**| field1 | [default to null]
+ **param2** | **String**| field2 | [default to null]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
+
diff --git a/samples/client/petstore/java/webclient/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/webclient/docs/FakeClassnameTags123Api.md
new file mode 100644
index 000000000000..89cd0fb3f73d
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/FakeClassnameTags123Api.md
@@ -0,0 +1,64 @@
+# FakeClassnameTags123Api
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
+
+
+
+# **testClassname**
+> Client testClassname(client)
+
+To test class name in snake case
+
+To test class name in snake case
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiClient;
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.Configuration;
+//import org.openapitools.client.auth.*;
+//import org.openapitools.client.api.FakeClassnameTags123Api;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure API key authorization: api_key_query
+ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query");
+api_key_query.setApiKey("YOUR API KEY");
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//api_key_query.setApiKeyPrefix("Token");
+
+FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api();
+Client client = new Client(); // Client | client model
+try {
+ Client result = apiInstance.testClassname(client);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling FakeClassnameTags123Api#testClassname");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **client** | [**Client**](Client.md)| client model |
+
+### Return type
+
+[**Client**](Client.md)
+
+### Authorization
+
+[api_key_query](../README.md#api_key_query)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json
+ - **Accept**: application/json
+
diff --git a/samples/client/petstore/java/webclient/docs/FormatTest.md b/samples/client/petstore/java/webclient/docs/FormatTest.md
new file mode 100644
index 000000000000..986f70236e10
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/FormatTest.md
@@ -0,0 +1,22 @@
+
+# FormatTest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**integer** | **Integer** | | [optional]
+**int32** | **Integer** | | [optional]
+**int64** | **Long** | | [optional]
+**number** | [**BigDecimal**](BigDecimal.md) | |
+**_float** | **Float** | | [optional]
+**_double** | **Double** | | [optional]
+**string** | **String** | | [optional]
+**_byte** | **byte[]** | |
+**binary** | [**File**](File.md) | | [optional]
+**date** | [**LocalDate**](LocalDate.md) | |
+**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
+**uuid** | [**UUID**](UUID.md) | | [optional]
+**password** | **String** | |
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/webclient/docs/HasOnlyReadOnly.md
new file mode 100644
index 000000000000..c1d0aac56728
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/HasOnlyReadOnly.md
@@ -0,0 +1,11 @@
+
+# HasOnlyReadOnly
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **String** | | [optional]
+**foo** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/MapTest.md b/samples/client/petstore/java/webclient/docs/MapTest.md
new file mode 100644
index 000000000000..f3b592d43fed
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/MapTest.md
@@ -0,0 +1,21 @@
+
+# MapTest
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional]
+**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional]
+**directMap** | **Map<String, Boolean>** | | [optional]
+**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
+
+
+
+## Enum: Map<String, InnerEnum>
+Name | Value
+---- | -----
+UPPER | "UPPER"
+LOWER | "lower"
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/webclient/docs/MixedPropertiesAndAdditionalPropertiesClass.md
new file mode 100644
index 000000000000..b12e2cd70e69
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/MixedPropertiesAndAdditionalPropertiesClass.md
@@ -0,0 +1,12 @@
+
+# MixedPropertiesAndAdditionalPropertiesClass
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**uuid** | [**UUID**](UUID.md) | | [optional]
+**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
+**map** | [**Map<String, Animal>**](Animal.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/Model200Response.md b/samples/client/petstore/java/webclient/docs/Model200Response.md
new file mode 100644
index 000000000000..5b3a9a0e46da
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/Model200Response.md
@@ -0,0 +1,11 @@
+
+# Model200Response
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **Integer** | | [optional]
+**propertyClass** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/ModelApiResponse.md b/samples/client/petstore/java/webclient/docs/ModelApiResponse.md
new file mode 100644
index 000000000000..3eec8686cc95
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/ModelApiResponse.md
@@ -0,0 +1,12 @@
+
+# ModelApiResponse
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**code** | **Integer** | | [optional]
+**type** | **String** | | [optional]
+**message** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/ModelReturn.md b/samples/client/petstore/java/webclient/docs/ModelReturn.md
new file mode 100644
index 000000000000..a679b04953e5
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/ModelReturn.md
@@ -0,0 +1,10 @@
+
+# ModelReturn
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**_return** | **Integer** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/Name.md b/samples/client/petstore/java/webclient/docs/Name.md
new file mode 100644
index 000000000000..64060f82de49
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/Name.md
@@ -0,0 +1,13 @@
+
+# Name
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**name** | **Integer** | |
+**snakeCase** | **Integer** | | [optional]
+**property** | **String** | | [optional]
+**_123number** | **Integer** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/NumberOnly.md b/samples/client/petstore/java/webclient/docs/NumberOnly.md
new file mode 100644
index 000000000000..a3feac7fadc5
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/NumberOnly.md
@@ -0,0 +1,10 @@
+
+# NumberOnly
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/Order.md b/samples/client/petstore/java/webclient/docs/Order.md
new file mode 100644
index 000000000000..268c617d1ff1
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/Order.md
@@ -0,0 +1,24 @@
+
+# Order
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**petId** | **Long** | | [optional]
+**quantity** | **Integer** | | [optional]
+**shipDate** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
+**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional]
+**complete** | **Boolean** | | [optional]
+
+
+
+## Enum: StatusEnum
+Name | Value
+---- | -----
+PLACED | "placed"
+APPROVED | "approved"
+DELIVERED | "delivered"
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/OuterComposite.md b/samples/client/petstore/java/webclient/docs/OuterComposite.md
new file mode 100644
index 000000000000..3f5a633c998e
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/OuterComposite.md
@@ -0,0 +1,12 @@
+
+# OuterComposite
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional]
+**myString** | **String** | | [optional]
+**myBoolean** | **Boolean** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/OuterEnum.md b/samples/client/petstore/java/webclient/docs/OuterEnum.md
new file mode 100644
index 000000000000..ed2cb206789b
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/OuterEnum.md
@@ -0,0 +1,14 @@
+
+# OuterEnum
+
+## Enum
+
+
+* `PLACED` (value: `"placed"`)
+
+* `APPROVED` (value: `"approved"`)
+
+* `DELIVERED` (value: `"delivered"`)
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/Pet.md b/samples/client/petstore/java/webclient/docs/Pet.md
new file mode 100644
index 000000000000..5b63109ef924
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/Pet.md
@@ -0,0 +1,24 @@
+
+# Pet
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**category** | [**Category**](Category.md) | | [optional]
+**name** | **String** | |
+**photoUrls** | **List<String>** | |
+**tags** | [**List<Tag>**](Tag.md) | | [optional]
+**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional]
+
+
+
+## Enum: StatusEnum
+Name | Value
+---- | -----
+AVAILABLE | "available"
+PENDING | "pending"
+SOLD | "sold"
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/PetApi.md b/samples/client/petstore/java/webclient/docs/PetApi.md
new file mode 100644
index 000000000000..dd4224a90200
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/PetApi.md
@@ -0,0 +1,494 @@
+# PetApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
+[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
+[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
+[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
+[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
+[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
+[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
+[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
+[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
+
+
+
+# **addPet**
+> addPet(pet)
+
+Add a new pet to the store
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiClient;
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.Configuration;
+//import org.openapitools.client.auth.*;
+//import org.openapitools.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store
+try {
+ apiInstance.addPet(pet);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#addPet");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: Not defined
+
+
+# **deletePet**
+> deletePet(petId, apiKey)
+
+Deletes a pet
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiClient;
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.Configuration;
+//import org.openapitools.client.auth.*;
+//import org.openapitools.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+Long petId = 56L; // Long | Pet id to delete
+String apiKey = "apiKey_example"; // String |
+try {
+ apiInstance.deletePet(petId, apiKey);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#deletePet");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| Pet id to delete |
+ **apiKey** | **String**| | [optional]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **findPetsByStatus**
+> List<Pet> findPetsByStatus(status)
+
+Finds Pets by status
+
+Multiple status values can be provided with comma separated strings
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiClient;
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.Configuration;
+//import org.openapitools.client.auth.*;
+//import org.openapitools.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+List status = Arrays.asList("status_example"); // List | Status values that need to be considered for filter
+try {
+ List result = apiInstance.findPetsByStatus(status);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#findPetsByStatus");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
+
+### Return type
+
+[**List<Pet>**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **findPetsByTags**
+> List<Pet> findPetsByTags(tags)
+
+Finds Pets by tags
+
+Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiClient;
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.Configuration;
+//import org.openapitools.client.auth.*;
+//import org.openapitools.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+List tags = Arrays.asList("tags_example"); // List | Tags to filter by
+try {
+ List result = apiInstance.findPetsByTags(tags);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#findPetsByTags");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **tags** | [**List<String>**](String.md)| Tags to filter by |
+
+### Return type
+
+[**List<Pet>**](Pet.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **getPetById**
+> Pet getPetById(petId)
+
+Find pet by ID
+
+Returns a single pet
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiClient;
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.Configuration;
+//import org.openapitools.client.auth.*;
+//import org.openapitools.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure API key authorization: api_key
+ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
+api_key.setApiKey("YOUR API KEY");
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//api_key.setApiKeyPrefix("Token");
+
+PetApi apiInstance = new PetApi();
+Long petId = 56L; // Long | ID of pet to return
+try {
+ Pet result = apiInstance.getPetById(petId);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#getPetById");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet to return |
+
+### Return type
+
+[**Pet**](Pet.md)
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **updatePet**
+> updatePet(pet)
+
+Update an existing pet
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiClient;
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.Configuration;
+//import org.openapitools.client.auth.*;
+//import org.openapitools.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store
+try {
+ apiInstance.updatePet(pet);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#updatePet");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/json, application/xml
+ - **Accept**: Not defined
+
+
+# **updatePetWithForm**
+> updatePetWithForm(petId, name, status)
+
+Updates a pet in the store with form data
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiClient;
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.Configuration;
+//import org.openapitools.client.auth.*;
+//import org.openapitools.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+Long petId = 56L; // Long | ID of pet that needs to be updated
+String name = "null"; // String | Updated name of the pet
+String status = "null"; // String | Updated status of the pet
+try {
+ apiInstance.updatePetWithForm(petId, name, status);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#updatePetWithForm");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet that needs to be updated |
+ **name** | **String**| Updated name of the pet | [optional] [default to null]
+ **status** | **String**| Updated status of the pet | [optional] [default to null]
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: application/x-www-form-urlencoded
+ - **Accept**: Not defined
+
+
+# **uploadFile**
+> ModelApiResponse uploadFile(petId, additionalMetadata, file)
+
+uploads an image
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiClient;
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.Configuration;
+//import org.openapitools.client.auth.*;
+//import org.openapitools.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+Long petId = 56L; // Long | ID of pet to update
+String additionalMetadata = "null"; // String | Additional data to pass to server
+File file = new File("null"); // File | file to upload
+try {
+ ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#uploadFile");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet to update |
+ **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null]
+ **file** | **File**| file to upload | [optional] [default to null]
+
+### Return type
+
+[**ModelApiResponse**](ModelApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: multipart/form-data
+ - **Accept**: application/json
+
+
+# **uploadFileWithRequiredFile**
+> ModelApiResponse uploadFileWithRequiredFile(petId, file, additionalMetadata)
+
+uploads an image (required)
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiClient;
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.Configuration;
+//import org.openapitools.client.auth.*;
+//import org.openapitools.client.api.PetApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure OAuth2 access token for authorization: petstore_auth
+OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
+petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
+
+PetApi apiInstance = new PetApi();
+Long petId = 56L; // Long | ID of pet to update
+File file = new File("null"); // File | file to upload
+String additionalMetadata = "null"; // String | Additional data to pass to server
+try {
+ ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, file, additionalMetadata);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **petId** | **Long**| ID of pet to update |
+ **file** | **File**| file to upload | [default to null]
+ **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null]
+
+### Return type
+
+[**ModelApiResponse**](ModelApiResponse.md)
+
+### Authorization
+
+[petstore_auth](../README.md#petstore_auth)
+
+### HTTP request headers
+
+ - **Content-Type**: multipart/form-data
+ - **Accept**: application/json
+
diff --git a/samples/client/petstore/java/webclient/docs/ReadOnlyFirst.md b/samples/client/petstore/java/webclient/docs/ReadOnlyFirst.md
new file mode 100644
index 000000000000..426b7cde95ab
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/ReadOnlyFirst.md
@@ -0,0 +1,11 @@
+
+# ReadOnlyFirst
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bar** | **String** | | [optional]
+**baz** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/SpecialModelName.md b/samples/client/petstore/java/webclient/docs/SpecialModelName.md
new file mode 100644
index 000000000000..6cf53410aced
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/SpecialModelName.md
@@ -0,0 +1,10 @@
+
+# SpecialModelName
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**$specialPropertyName** | **Long** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/StoreApi.md b/samples/client/petstore/java/webclient/docs/StoreApi.md
new file mode 100644
index 000000000000..578e086a3e14
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/StoreApi.md
@@ -0,0 +1,195 @@
+# StoreApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
+[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
+[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
+[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
+
+
+
+# **deleteOrder**
+> deleteOrder(orderId)
+
+Delete purchase order by ID
+
+For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.StoreApi;
+
+
+StoreApi apiInstance = new StoreApi();
+String orderId = "orderId_example"; // String | ID of the order that needs to be deleted
+try {
+ apiInstance.deleteOrder(orderId);
+} catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#deleteOrder");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **String**| ID of the order that needs to be deleted |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **getInventory**
+> Map<String, Integer> getInventory()
+
+Returns pet inventories by status
+
+Returns a map of status codes to quantities
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiClient;
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.Configuration;
+//import org.openapitools.client.auth.*;
+//import org.openapitools.client.api.StoreApi;
+
+ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+// Configure API key authorization: api_key
+ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
+api_key.setApiKey("YOUR API KEY");
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//api_key.setApiKeyPrefix("Token");
+
+StoreApi apiInstance = new StoreApi();
+try {
+ Map result = apiInstance.getInventory();
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#getInventory");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+**Map<String, Integer>**
+
+### Authorization
+
+[api_key](../README.md#api_key)
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/json
+
+
+# **getOrderById**
+> Order getOrderById(orderId)
+
+Find purchase order by ID
+
+For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.StoreApi;
+
+
+StoreApi apiInstance = new StoreApi();
+Long orderId = 56L; // Long | ID of pet that needs to be fetched
+try {
+ Order result = apiInstance.getOrderById(orderId);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#getOrderById");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **orderId** | **Long**| ID of pet that needs to be fetched |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **placeOrder**
+> Order placeOrder(order)
+
+Place an order for a pet
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.StoreApi;
+
+
+StoreApi apiInstance = new StoreApi();
+Order order = new Order(); // Order | order placed for purchasing the pet
+try {
+ Order result = apiInstance.placeOrder(order);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling StoreApi#placeOrder");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **order** | [**Order**](Order.md)| order placed for purchasing the pet |
+
+### Return type
+
+[**Order**](Order.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
diff --git a/samples/client/petstore/java/webclient/docs/StringBooleanMap.md b/samples/client/petstore/java/webclient/docs/StringBooleanMap.md
new file mode 100644
index 000000000000..cac7afc80e07
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/StringBooleanMap.md
@@ -0,0 +1,9 @@
+
+# StringBooleanMap
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/Tag.md b/samples/client/petstore/java/webclient/docs/Tag.md
new file mode 100644
index 000000000000..de6814b55d57
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/Tag.md
@@ -0,0 +1,11 @@
+
+# Tag
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**name** | **String** | | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/User.md b/samples/client/petstore/java/webclient/docs/User.md
new file mode 100644
index 000000000000..8b6753dd284a
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/User.md
@@ -0,0 +1,17 @@
+
+# User
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Long** | | [optional]
+**username** | **String** | | [optional]
+**firstName** | **String** | | [optional]
+**lastName** | **String** | | [optional]
+**email** | **String** | | [optional]
+**password** | **String** | | [optional]
+**phone** | **String** | | [optional]
+**userStatus** | **Integer** | User Status | [optional]
+
+
+
diff --git a/samples/client/petstore/java/webclient/docs/UserApi.md b/samples/client/petstore/java/webclient/docs/UserApi.md
new file mode 100644
index 000000000000..102d04ac2c4e
--- /dev/null
+++ b/samples/client/petstore/java/webclient/docs/UserApi.md
@@ -0,0 +1,360 @@
+# UserApi
+
+All URIs are relative to *http://petstore.swagger.io:80/v2*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**createUser**](UserApi.md#createUser) | **POST** /user | Create user
+[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
+[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
+[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
+[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
+[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
+[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
+[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
+
+
+
+# **createUser**
+> createUser(user)
+
+Create user
+
+This can only be done by the logged in user.
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+User user = new User(); // User | Created user object
+try {
+ apiInstance.createUser(user);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUser");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **user** | [**User**](User.md)| Created user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **createUsersWithArrayInput**
+> createUsersWithArrayInput(user)
+
+Creates list of users with given input array
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+List user = Arrays.asList(new List()); // List | List of user object
+try {
+ apiInstance.createUsersWithArrayInput(user);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **user** | [**List<User>**](List.md)| List of user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **createUsersWithListInput**
+> createUsersWithListInput(user)
+
+Creates list of users with given input array
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+List user = Arrays.asList(new List()); // List | List of user object
+try {
+ apiInstance.createUsersWithListInput(user);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#createUsersWithListInput");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **user** | [**List<User>**](List.md)| List of user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **deleteUser**
+> deleteUser(username)
+
+Delete user
+
+This can only be done by the logged in user.
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+String username = "username_example"; // String | The name that needs to be deleted
+try {
+ apiInstance.deleteUser(username);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#deleteUser");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The name that needs to be deleted |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **getUserByName**
+> User getUserByName(username)
+
+Get user by user name
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing.
+try {
+ User result = apiInstance.getUserByName(username);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#getUserByName");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The name that needs to be fetched. Use user1 for testing. |
+
+### Return type
+
+[**User**](User.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **loginUser**
+> String loginUser(username, password)
+
+Logs user into the system
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+String username = "username_example"; // String | The user name for login
+String password = "password_example"; // String | The password for login in clear text
+try {
+ String result = apiInstance.loginUser(username, password);
+ System.out.println(result);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#loginUser");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| The user name for login |
+ **password** | **String**| The password for login in clear text |
+
+### Return type
+
+**String**
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: application/xml, application/json
+
+
+# **logoutUser**
+> logoutUser()
+
+Logs out current logged in user session
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+try {
+ apiInstance.logoutUser();
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#logoutUser");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+This endpoint does not need any parameter.
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
+
+# **updateUser**
+> updateUser(username, user)
+
+Updated user
+
+This can only be done by the logged in user.
+
+### Example
+```java
+// Import classes:
+//import org.openapitools.client.ApiException;
+//import org.openapitools.client.api.UserApi;
+
+
+UserApi apiInstance = new UserApi();
+String username = "username_example"; // String | name that need to be deleted
+User user = new User(); // User | Updated user object
+try {
+ apiInstance.updateUser(username, user);
+} catch (ApiException e) {
+ System.err.println("Exception when calling UserApi#updateUser");
+ e.printStackTrace();
+}
+```
+
+### Parameters
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **username** | **String**| name that need to be deleted |
+ **user** | [**User**](User.md)| Updated user object |
+
+### Return type
+
+null (empty response body)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+ - **Content-Type**: Not defined
+ - **Accept**: Not defined
+
diff --git a/samples/client/petstore/java/webclient/git_push.sh b/samples/client/petstore/java/webclient/git_push.sh
new file mode 100644
index 000000000000..8442b80bb445
--- /dev/null
+++ b/samples/client/petstore/java/webclient/git_push.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
+#
+# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
+
+git_user_id=$1
+git_repo_id=$2
+release_note=$3
+
+if [ "$git_user_id" = "" ]; then
+ git_user_id="GIT_USER_ID"
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
+fi
+
+if [ "$git_repo_id" = "" ]; then
+ git_repo_id="GIT_REPO_ID"
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
+fi
+
+if [ "$release_note" = "" ]; then
+ release_note="Minor update"
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
+fi
+
+# Initialize the local directory as a Git repository
+git init
+
+# Adds the files in the local repository and stages them for commit.
+git add .
+
+# Commits the tracked changes and prepares them to be pushed to a remote repository.
+git commit -m "$release_note"
+
+# Sets the new remote
+git_remote=`git remote`
+if [ "$git_remote" = "" ]; then # git remote not defined
+
+ if [ "$GIT_TOKEN" = "" ]; then
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
+ git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
+ else
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
+ fi
+
+fi
+
+git pull origin master
+
+# Pushes (Forces) the changes in the local repository up to the remote repository
+echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
+git push origin master 2>&1 | grep -v 'To https'
+
diff --git a/samples/client/petstore/java/webclient/gradle.properties b/samples/client/petstore/java/webclient/gradle.properties
new file mode 100644
index 000000000000..05644f0754af
--- /dev/null
+++ b/samples/client/petstore/java/webclient/gradle.properties
@@ -0,0 +1,2 @@
+# Uncomment to build for Android
+#target = android
\ No newline at end of file
diff --git a/samples/client/petstore/java/webclient/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/webclient/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 000000000000..2c6137b87896
Binary files /dev/null and b/samples/client/petstore/java/webclient/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/samples/client/petstore/java/webclient/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/webclient/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 000000000000..b7a364739551
--- /dev/null
+++ b/samples/client/petstore/java/webclient/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Tue May 17 23:08:05 CST 2016
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
diff --git a/samples/client/petstore/java/webclient/gradlew b/samples/client/petstore/java/webclient/gradlew
new file mode 100644
index 000000000000..9d82f7891513
--- /dev/null
+++ b/samples/client/petstore/java/webclient/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/samples/client/petstore/java/webclient/gradlew.bat b/samples/client/petstore/java/webclient/gradlew.bat
new file mode 100644
index 000000000000..5f192121eb4f
--- /dev/null
+++ b/samples/client/petstore/java/webclient/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/samples/client/petstore/java/webclient/pom.xml b/samples/client/petstore/java/webclient/pom.xml
new file mode 100644
index 000000000000..9af35e5b212a
--- /dev/null
+++ b/samples/client/petstore/java/webclient/pom.xml
@@ -0,0 +1,118 @@
+
+ 4.0.0
+ org.openapitools
+ petstore-webclient
+ jar
+ petstore-webclient
+ 1.0.0
+ https://github.com/openapitools/openapi-generator
+ OpenAPI Java
+
+ scm:git:git@github.com:openapitools/openapi-generator.git
+ scm:git:git@github.com:openapitools/openapi-generator.git
+ https://github.com/openapitools/openapi-generator
+
+
+
+
+ Unlicense
+ http://www.apache.org/licenses/LICENSE-2.0.html
+ repo
+
+
+
+
+
+ OpenAPI
+ team@openapitools.org
+ OpenAPI
+ http://openapitools.org
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.6.1
+
+ 1.8
+ 1.8
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 2.2.1
+
+
+ attach-sources
+
+ jar-no-fork
+
+
+
+
+
+
+
+
+
+ io.swagger
+ swagger-annotations
+ ${swagger-annotations-version}
+
+
+
+ io.projectreactor
+ reactor-core
+ ${reactor-version}
+
+
+
+
+ org.springframework
+ spring-webflux
+ ${spring-web-version}
+
+
+
+ io.projectreactor.ipc
+ reactor-netty
+ ${reactor-netty-version}
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson-version}
+
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+ ${jackson-version}
+
+
+
+
+ junit
+ junit
+ ${junit-version}
+ test
+
+
+
+ UTF-8
+ 1.5.20
+ 5.0.7.RELEASE
+ 2.9.5
+ 4.12
+ 3.1.8.RELEASE
+ 0.7.8.RELEASE
+
+
diff --git a/samples/client/petstore/java/webclient/settings.gradle b/samples/client/petstore/java/webclient/settings.gradle
new file mode 100644
index 000000000000..c687d02a73d5
--- /dev/null
+++ b/samples/client/petstore/java/webclient/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = "petstore-webclient"
\ No newline at end of file
diff --git a/samples/client/petstore/java/webclient/src/main/AndroidManifest.xml b/samples/client/petstore/java/webclient/src/main/AndroidManifest.xml
new file mode 100644
index 000000000000..54fbcb3da1e8
--- /dev/null
+++ b/samples/client/petstore/java/webclient/src/main/AndroidManifest.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java
new file mode 100644
index 000000000000..ee1885811e6f
--- /dev/null
+++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiClient.java
@@ -0,0 +1,641 @@
+package org.openapitools.client;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpRequest;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.InvalidMediaTypeException;
+import org.springframework.http.MediaType;
+import org.springframework.http.RequestEntity;
+import org.springframework.http.RequestEntity.BodyBuilder;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.client.BufferingClientHttpRequestFactory;
+import org.springframework.http.client.ClientHttpRequestExecution;
+import org.springframework.http.client.ClientHttpRequestInterceptor;
+import org.springframework.http.client.ClientHttpResponse;
+import org.springframework.http.codec.json.Jackson2JsonDecoder;
+import org.springframework.http.codec.json.Jackson2JsonEncoder;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.util.StringUtils;
+import org.springframework.http.client.reactive.ClientHttpRequest;
+import org.springframework.web.client.RestClientException;
+import org.springframework.web.util.UriComponentsBuilder;
+import org.springframework.web.reactive.function.client.WebClient;
+import org.springframework.web.reactive.function.client.ClientResponse;
+import org.springframework.web.reactive.function.BodyInserter;
+import org.springframework.web.reactive.function.BodyInserters;
+import org.springframework.web.reactive.function.client.ExchangeStrategies;
+import reactor.core.publisher.Mono;
+import reactor.core.publisher.Flux;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.TimeZone;
+
+import org.openapitools.client.auth.Authentication;
+import org.openapitools.client.auth.HttpBasicAuth;
+import org.openapitools.client.auth.ApiKeyAuth;
+import org.openapitools.client.auth.OAuth;
+
+
+public class ApiClient {
+ public enum CollectionFormat {
+ CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null);
+
+ private final String separator;
+ private CollectionFormat(String separator) {
+ this.separator = separator;
+ }
+
+ private String collectionToString(Collection extends CharSequence> collection) {
+ return StringUtils.collectionToDelimitedString(collection, separator);
+ }
+ }
+
+ private HttpHeaders defaultHeaders = new HttpHeaders();
+
+ private String basePath = "http://petstore.swagger.io:80/v2";
+
+ private final WebClient webClient;
+ private final DateFormat dateFormat;
+
+ private Map authentications;
+
+
+ public ApiClient() {
+ this.dateFormat = createDefaultDateFormat();
+ this.webClient = buildWebClient(new ObjectMapper(), this.dateFormat);
+ }
+
+ public ApiClient(ObjectMapper mapper, DateFormat format) {
+ this(buildWebClient(mapper.copy(), format), format);
+ }
+
+ private ApiClient(WebClient webClient, DateFormat format) {
+ this.webClient = webClient;
+ this.dateFormat = format;
+ }
+
+ public DateFormat createDefaultDateFormat() {
+ DateFormat dateFormat = new RFC3339DateFormat();
+ dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
+ return dateFormat;
+ }
+
+ protected void init() {
+ // Setup authentications (key: authentication name, value: authentication).
+ authentications = new HashMap();
+ authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
+ authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query"));
+ authentications.put("http_basic_test", new HttpBasicAuth());
+ authentications.put("petstore_auth", new OAuth());
+ // Prevent the authentications from being modified.
+ authentications = Collections.unmodifiableMap(authentications);
+ }
+
+ /**
+ * Build the RestTemplate used to make HTTP requests.
+ * @return RestTemplate
+ */
+ public static WebClient buildWebClient(ObjectMapper mapper, DateFormat dateFormat) {
+ mapper.setDateFormat(dateFormat);
+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+ ExchangeStrategies strategies = ExchangeStrategies
+ .builder()
+ .codecs(clientDefaultCodecsConfigurer -> {
+ clientDefaultCodecsConfigurer.defaultCodecs().jackson2JsonEncoder(new Jackson2JsonEncoder(mapper, MediaType.APPLICATION_JSON));
+ clientDefaultCodecsConfigurer.defaultCodecs().jackson2JsonDecoder(new Jackson2JsonDecoder(mapper, MediaType.APPLICATION_JSON));
+ }).build();
+ WebClient.Builder webClient = WebClient.builder().exchangeStrategies(strategies);
+ return webClient.build();
+ }
+
+
+ /**
+ * Get the current base path
+ * @return String the base path
+ */
+ public String getBasePath() {
+ return basePath;
+ }
+
+ /**
+ * Set the base path, which should include the host
+ * @param basePath the base path
+ * @return ApiClient this client
+ */
+ public ApiClient setBasePath(String basePath) {
+ this.basePath = basePath;
+ return this;
+ }
+
+ /**
+ * Get authentications (key: authentication name, value: authentication).
+ * @return Map the currently configured authentication types
+ */
+ public Map getAuthentications() {
+ return authentications;
+ }
+
+ /**
+ * Get authentication for the given name.
+ *
+ * @param authName The authentication name
+ * @return The authentication, null if not found
+ */
+ public Authentication getAuthentication(String authName) {
+ return authentications.get(authName);
+ }
+
+ /**
+ * Helper method to set username for the first HTTP basic authentication.
+ * @param username the username
+ */
+ public void setUsername(String username) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof HttpBasicAuth) {
+ ((HttpBasicAuth) auth).setUsername(username);
+ return;
+ }
+ }
+ throw new RuntimeException("No HTTP basic authentication configured!");
+ }
+
+ /**
+ * Helper method to set password for the first HTTP basic authentication.
+ * @param password the password
+ */
+ public void setPassword(String password) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof HttpBasicAuth) {
+ ((HttpBasicAuth) auth).setPassword(password);
+ return;
+ }
+ }
+ throw new RuntimeException("No HTTP basic authentication configured!");
+ }
+
+ /**
+ * Helper method to set API key value for the first API key authentication.
+ * @param apiKey the API key
+ */
+ public void setApiKey(String apiKey) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof ApiKeyAuth) {
+ ((ApiKeyAuth) auth).setApiKey(apiKey);
+ return;
+ }
+ }
+ throw new RuntimeException("No API key authentication configured!");
+ }
+
+ /**
+ * Helper method to set API key prefix for the first API key authentication.
+ * @param apiKeyPrefix the API key prefix
+ */
+ public void setApiKeyPrefix(String apiKeyPrefix) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof ApiKeyAuth) {
+ ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
+ return;
+ }
+ }
+ throw new RuntimeException("No API key authentication configured!");
+ }
+
+ /**
+ * Helper method to set access token for the first OAuth2 authentication.
+ * @param accessToken the access token
+ */
+ public void setAccessToken(String accessToken) {
+ for (Authentication auth : authentications.values()) {
+ if (auth instanceof OAuth) {
+ ((OAuth) auth).setAccessToken(accessToken);
+ return;
+ }
+ }
+ throw new RuntimeException("No OAuth2 authentication configured!");
+ }
+
+ /**
+ * Set the User-Agent header's value (by adding to the default header map).
+ * @param userAgent the user agent string
+ * @return ApiClient this client
+ */
+ public ApiClient setUserAgent(String userAgent) {
+ addDefaultHeader("User-Agent", userAgent);
+ return this;
+ }
+
+ /**
+ * Add a default header.
+ *
+ * @param name The header's name
+ * @param value The header's value
+ * @return ApiClient this client
+ */
+ public ApiClient addDefaultHeader(String name, String value) {
+ if (defaultHeaders.containsKey(name)) {
+ defaultHeaders.remove(name);
+ }
+ defaultHeaders.add(name, value);
+ return this;
+ }
+
+ /**
+ * Get the date format used to parse/format date parameters.
+ * @return DateFormat format
+ */
+ public DateFormat getDateFormat() {
+ return dateFormat;
+ }
+
+ /**
+ * Parse the given string into Date object.
+ */
+ public Date parseDate(String str) {
+ try {
+ return dateFormat.parse(str);
+ } catch (ParseException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Format the given Date object into string.
+ */
+ public String formatDate(Date date) {
+ return dateFormat.format(date);
+ }
+
+ /**
+ * Format the given parameter object into string.
+ * @param param the object to convert
+ * @return String the parameter represented as a String
+ */
+ public String parameterToString(Object param) {
+ if (param == null) {
+ return "";
+ } else if (param instanceof Date) {
+ return formatDate( (Date) param);
+ } else if (param instanceof Collection) {
+ StringBuilder b = new StringBuilder();
+ for(Object o : (Collection>) param) {
+ if(b.length() > 0) {
+ b.append(",");
+ }
+ b.append(String.valueOf(o));
+ }
+ return b.toString();
+ } else {
+ return String.valueOf(param);
+ }
+ }
+
+ /**
+ * Converts a parameter to a {@link MultiValueMap} for use in REST requests
+ * @param collectionFormat The format to convert to
+ * @param name The name of the parameter
+ * @param value The parameter's value
+ * @return a Map containing the String value(s) of the input parameter
+ */
+ public MultiValueMap parameterToMultiValueMap(CollectionFormat collectionFormat, String name, Object value) {
+ final MultiValueMap params = new LinkedMultiValueMap();
+
+ if (name == null || name.isEmpty() || value == null) {
+ return params;
+ }
+
+ if(collectionFormat == null) {
+ collectionFormat = CollectionFormat.CSV;
+ }
+
+ Collection> valueCollection = null;
+ if (value instanceof Collection) {
+ valueCollection = (Collection>) value;
+ } else {
+ params.add(name, parameterToString(value));
+ return params;
+ }
+
+ if (valueCollection.isEmpty()){
+ return params;
+ }
+
+ if (collectionFormat.equals(CollectionFormat.MULTI)) {
+ for (Object item : valueCollection) {
+ params.add(name, parameterToString(item));
+ }
+ return params;
+ }
+
+ List values = new ArrayList();
+ for(Object o : valueCollection) {
+ values.add(parameterToString(o));
+ }
+ params.add(name, collectionFormat.collectionToString(values));
+
+ return params;
+ }
+
+ /**
+ * Check if the given {@code String} is a JSON MIME.
+ * @param mediaType the input MediaType
+ * @return boolean true if the MediaType represents JSON, false otherwise
+ */
+ public boolean isJsonMime(String mediaType) {
+ // "* / *" is default to JSON
+ if ("*/*".equals(mediaType)) {
+ return true;
+ }
+
+ try {
+ return isJsonMime(MediaType.parseMediaType(mediaType));
+ } catch (InvalidMediaTypeException e) {
+ }
+ return false;
+ }
+
+ /**
+ * Check if the given MIME is a JSON MIME.
+ * JSON MIME examples:
+ * application/json
+ * application/json; charset=UTF8
+ * APPLICATION/JSON
+ * @param mediaType the input MediaType
+ * @return boolean true if the MediaType represents JSON, false otherwise
+ */
+ public boolean isJsonMime(MediaType mediaType) {
+ return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*\\+json[;]?\\s*$"));
+ }
+
+ /**
+ * Select the Accept header's value from the given accepts array:
+ * if JSON exists in the given array, use it;
+ * otherwise use all of them (joining into a string)
+ *
+ * @param accepts The accepts array to select from
+ * @return List The list of MediaTypes to use for the Accept header
+ */
+ public List selectHeaderAccept(String[] accepts) {
+ if (accepts.length == 0) {
+ return null;
+ }
+ for (String accept : accepts) {
+ MediaType mediaType = MediaType.parseMediaType(accept);
+ if (isJsonMime(mediaType)) {
+ return Collections.singletonList(mediaType);
+ }
+ }
+ return MediaType.parseMediaTypes(StringUtils.arrayToCommaDelimitedString(accepts));
+ }
+
+ /**
+ * Select the Content-Type header's value from the given array:
+ * if JSON exists in the given array, use it;
+ * otherwise use the first one of the array.
+ *
+ * @param contentTypes The Content-Type array to select from
+ * @return MediaType The Content-Type header to use. If the given array is empty, JSON will be used.
+ */
+ public MediaType selectHeaderContentType(String[] contentTypes) {
+ if (contentTypes.length == 0) {
+ return MediaType.APPLICATION_JSON;
+ }
+ for (String contentType : contentTypes) {
+ MediaType mediaType = MediaType.parseMediaType(contentType);
+ if (isJsonMime(mediaType)) {
+ return mediaType;
+ }
+ }
+ return MediaType.parseMediaType(contentTypes[0]);
+ }
+
+ /**
+ * Select the body to use for the request
+ * @param obj the body object
+ * @param formParams the form parameters
+ * @param contentType the content type of the request
+ * @return Object the selected body
+ */
+ protected BodyInserter, ? super ClientHttpRequest> selectBody(Object obj, MultiValueMap formParams, MediaType contentType) {
+ boolean isForm = MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType) || MediaType.APPLICATION_FORM_URLENCODED.isCompatibleWith(contentType);
+ return isForm ? BodyInserters.fromMultipartData(formParams) : (obj != null ? BodyInserters.fromObject(obj) : null);
+ }
+
+ /**
+ * Invoke API by sending HTTP request with the given options.
+ *
+ * @param the return type to use
+ * @param path The sub-path of the HTTP URL
+ * @param method The request method
+ * @param queryParams The query parameters
+ * @param body The request body object
+ * @param headerParams The header parameters
+ * @param formParams The form parameters
+ * @param accept The request's Accept header
+ * @param contentType The request's Content-Type header
+ * @param authNames The authentications to apply
+ * @param returnType The return type into which to deserialize the response
+ * @return The response body in chosen type
+ */
+ public Mono invokeAPI(String path, HttpMethod method, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException {
+ final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, queryParams, body, headerParams, formParams, accept, contentType, authNames);
+
+ return requestBuilder.exchange()
+ .flatMap(response -> {
+ HttpStatus statusCode = response.statusCode();
+ if (response.statusCode() == HttpStatus.NO_CONTENT) {
+ return Mono.empty();
+ } else if (statusCode.is2xxSuccessful()) {
+ if (returnType == null) {
+ return Mono.empty();
+ } else {
+ return response.bodyToMono(returnType);
+ }
+ } else {
+ return Mono.error(new RestClientException("API returned " + statusCode + " and it wasn't handled by the RestTemplate error handler"));
+ }
+ });
+ }
+
+ /**
+ * Invoke API by sending HTTP request with the given options.
+ *
+ * @param the return type to use
+ * @param path The sub-path of the HTTP URL
+ * @param method The request method
+ * @param queryParams The query parameters
+ * @param body The request body object
+ * @param headerParams The header parameters
+ * @param formParams The form parameters
+ * @param accept The request's Accept header
+ * @param contentType The request's Content-Type header
+ * @param authNames The authentications to apply
+ * @param returnType The return type into which to deserialize the response
+ * @return The response body in chosen type
+ */
+ public Flux invokeFluxAPI(String path, HttpMethod method, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames, ParameterizedTypeReference returnType) throws RestClientException {
+ final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, queryParams, body, headerParams, formParams, accept, contentType, authNames);
+
+ return requestBuilder.exchange()
+ .flatMapMany(response -> {
+ HttpStatus statusCode = response.statusCode();
+ ClientResponse.Headers headers = response.headers();
+ if (response.statusCode() == HttpStatus.NO_CONTENT) {
+ return Flux.empty();
+ } else if (statusCode.is2xxSuccessful()) {
+ if (returnType == null) {
+ return Flux.empty();
+ } else {
+ return response.bodyToFlux(returnType);
+ }
+ } else {
+ return Flux.error(new RestClientException("API returned " + statusCode + " and it wasn't handled by the RestTemplate error handler"));
+ }
+ });
+ }
+
+ private WebClient.RequestBodySpec prepareRequest(String path, HttpMethod method, MultiValueMap queryParams, Object body, HttpHeaders headerParams, MultiValueMap formParams, List accept, MediaType contentType, String[] authNames) {
+ updateParamsForAuth(authNames, queryParams, headerParams);
+
+ final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path);
+ if (queryParams != null) {
+ //encode the query parameters in case they contain unsafe characters
+ for (List values : queryParams.values()) {
+ if (values != null) {
+ for (int i = 0; i < values.size(); i++) {
+ try {
+ values.set(i, URLEncoder.encode(values.get(i), "utf8"));
+ } catch (UnsupportedEncodingException e) {
+
+ }
+ }
+ }
+ }
+ builder.queryParams(queryParams);
+ }
+
+ final WebClient.RequestBodySpec requestBuilder = webClient.method(method).uri(builder.build().toUri());
+ if(accept != null) {
+ requestBuilder.accept(accept.toArray(new MediaType[accept.size()]));
+ }
+ if(contentType != null) {
+ requestBuilder.contentType(contentType);
+ }
+
+ addHeadersToRequest(headerParams, requestBuilder);
+ addHeadersToRequest(defaultHeaders, requestBuilder);
+
+ requestBuilder.body(selectBody(body, formParams, contentType));
+ return requestBuilder;
+ }
+
+ /**
+ * Add headers to the request that is being built
+ * @param headers The headers to add
+ * @param requestBuilder The current request
+ */
+ protected void addHeadersToRequest(HttpHeaders headers, WebClient.RequestBodySpec requestBuilder) {
+ for (Entry> entry : headers.entrySet()) {
+ List values = entry.getValue();
+ for(String value : values) {
+ if (value != null) {
+ requestBuilder.header(entry.getKey(), value);
+ }
+ }
+ }
+ }
+
+ /**
+ * Update query and header parameters based on authentication settings.
+ *
+ * @param authNames The authentications to apply
+ * @param queryParams The query parameters
+ * @param headerParams The header parameters
+ */
+ private void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams) {
+ for (String authName : authNames) {
+ Authentication auth = authentications.get(authName);
+ if (auth == null) {
+ throw new RestClientException("Authentication undefined: " + authName);
+ }
+ auth.applyToParams(queryParams, headerParams);
+ }
+ }
+
+ private class ApiClientHttpRequestInterceptor implements ClientHttpRequestInterceptor {
+ private final Log log = LogFactory.getLog(ApiClientHttpRequestInterceptor.class);
+
+ @Override
+ public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException {
+ logRequest(request, body);
+ ClientHttpResponse response = execution.execute(request, body);
+ logResponse(response);
+ return response;
+ }
+
+ private void logRequest(HttpRequest request, byte[] body) throws UnsupportedEncodingException {
+ log.info("URI: " + request.getURI());
+ log.info("HTTP Method: " + request.getMethod());
+ log.info("HTTP Headers: " + headersToString(request.getHeaders()));
+ log.info("Request Body: " + new String(body, StandardCharsets.UTF_8));
+ }
+
+ private void logResponse(ClientHttpResponse response) throws IOException {
+ log.info("HTTP Status Code: " + response.getRawStatusCode());
+ log.info("Status Text: " + response.getStatusText());
+ log.info("HTTP Headers: " + headersToString(response.getHeaders()));
+ log.info("Response Body: " + bodyToString(response.getBody()));
+ }
+
+ private String headersToString(HttpHeaders headers) {
+ StringBuilder builder = new StringBuilder();
+ for(Entry> entry : headers.entrySet()) {
+ builder.append(entry.getKey()).append("=[");
+ for(String value : entry.getValue()) {
+ builder.append(value).append(",");
+ }
+ builder.setLength(builder.length() - 1); // Get rid of trailing comma
+ builder.append("],");
+ }
+ builder.setLength(builder.length() - 1); // Get rid of trailing comma
+ return builder.toString();
+ }
+
+ private String bodyToString(InputStream body) throws IOException {
+ StringBuilder builder = new StringBuilder();
+ BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(body, StandardCharsets.UTF_8));
+ String line = bufferedReader.readLine();
+ while (line != null) {
+ builder.append(line).append(System.lineSeparator());
+ line = bufferedReader.readLine();
+ }
+ bufferedReader.close();
+ return builder.toString();
+ }
+ }
+}
diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiException.java
new file mode 100644
index 000000000000..6f3603607838
--- /dev/null
+++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/ApiException.java
@@ -0,0 +1,91 @@
+/*
+ * OpenAPI Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client;
+
+import java.util.Map;
+import java.util.List;
+
+
+public class ApiException extends Exception {
+ private int code = 0;
+ private Map> responseHeaders = null;
+ private String responseBody = null;
+
+ public ApiException() {}
+
+ public ApiException(Throwable throwable) {
+ super(throwable);
+ }
+
+ public ApiException(String message) {
+ super(message);
+ }
+
+ public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) {
+ super(message, throwable);
+ this.code = code;
+ this.responseHeaders = responseHeaders;
+ this.responseBody = responseBody;
+ }
+
+ public ApiException(String message, int code, Map> responseHeaders, String responseBody) {
+ this(message, (Throwable) null, code, responseHeaders, responseBody);
+ }
+
+ public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) {
+ this(message, throwable, code, responseHeaders, null);
+ }
+
+ public ApiException(int code, Map> responseHeaders, String responseBody) {
+ this((String) null, (Throwable) null, code, responseHeaders, responseBody);
+ }
+
+ public ApiException(int code, String message) {
+ super(message);
+ this.code = code;
+ }
+
+ public ApiException(int code, String message, Map> responseHeaders, String responseBody) {
+ this(code, message);
+ this.responseHeaders = responseHeaders;
+ this.responseBody = responseBody;
+ }
+
+ /**
+ * Get the HTTP status code.
+ *
+ * @return HTTP status code
+ */
+ public int getCode() {
+ return code;
+ }
+
+ /**
+ * Get the HTTP response headers.
+ *
+ * @return A map of list of string
+ */
+ public Map> getResponseHeaders() {
+ return responseHeaders;
+ }
+
+ /**
+ * Get the HTTP response body.
+ *
+ * @return Response body in the form of string
+ */
+ public String getResponseBody() {
+ return responseBody;
+ }
+}
diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/Configuration.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/Configuration.java
new file mode 100644
index 000000000000..1545483fe0b9
--- /dev/null
+++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/Configuration.java
@@ -0,0 +1,39 @@
+/*
+ * OpenAPI Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client;
+
+
+public class Configuration {
+ private static ApiClient defaultApiClient = new ApiClient();
+
+ /**
+ * Get the default API client, which would be used when creating API
+ * instances without providing an API client.
+ *
+ * @return Default API client
+ */
+ public static ApiClient getDefaultApiClient() {
+ return defaultApiClient;
+ }
+
+ /**
+ * Set the default API client, which would be used when creating API
+ * instances without providing an API client.
+ *
+ * @param apiClient API client
+ */
+ public static void setDefaultApiClient(ApiClient apiClient) {
+ defaultApiClient = apiClient;
+ }
+}
diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/Pair.java
new file mode 100644
index 000000000000..18a0e96bfc76
--- /dev/null
+++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/Pair.java
@@ -0,0 +1,52 @@
+/*
+ * OpenAPI Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client;
+
+
+public class Pair {
+ private String name = "";
+ private String value = "";
+
+ public Pair (String name, String value) {
+ setName(name);
+ setValue(value);
+ }
+
+ private void setName(String name) {
+ if (!isValidString(name)) return;
+
+ this.name = name;
+ }
+
+ private void setValue(String value) {
+ if (!isValidString(value)) return;
+
+ this.value = value;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+
+ public String getValue() {
+ return this.value;
+ }
+
+ private boolean isValidString(String arg) {
+ if (arg == null) return false;
+ if (arg.trim().isEmpty()) return false;
+
+ return true;
+ }
+}
diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/RFC3339DateFormat.java
new file mode 100644
index 000000000000..4ed672bced96
--- /dev/null
+++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/RFC3339DateFormat.java
@@ -0,0 +1,32 @@
+/*
+ * OpenAPI Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+package org.openapitools.client;
+
+import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
+import com.fasterxml.jackson.databind.util.ISO8601Utils;
+
+import java.text.FieldPosition;
+import java.util.Date;
+
+
+public class RFC3339DateFormat extends ISO8601DateFormat {
+
+ // Same as ISO8601DateFormat but serializing milliseconds.
+ @Override
+ public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
+ String value = ISO8601Utils.format(date, true);
+ toAppendTo.append(value);
+ return toAppendTo;
+ }
+
+}
\ No newline at end of file
diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/StringUtil.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/StringUtil.java
new file mode 100644
index 000000000000..b731bc530e29
--- /dev/null
+++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/StringUtil.java
@@ -0,0 +1,55 @@
+/*
+ * OpenAPI Petstore
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * OpenAPI spec version: 1.0.0
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+package org.openapitools.client;
+
+
+public class StringUtil {
+ /**
+ * Check if the given array contains the given value (with case-insensitive comparison).
+ *
+ * @param array The array
+ * @param value The value to search
+ * @return true if the array contains the value
+ */
+ public static boolean containsIgnoreCase(String[] array, String value) {
+ for (String str : array) {
+ if (value == null && str == null) return true;
+ if (value != null && value.equalsIgnoreCase(str)) return true;
+ }
+ return false;
+ }
+
+ /**
+ * Join an array of strings with the given separator.
+ *
+ * Note: This might be replaced by utility method from commons-lang or guava someday
+ * if one of those libraries is added as dependency.
+ *
+ *
+ * @param array The array of strings
+ * @param separator The separator
+ * @return the resulting string
+ */
+ public static String join(String[] array, String separator) {
+ int len = array.length;
+ if (len == 0) return "";
+
+ StringBuilder out = new StringBuilder();
+ out.append(array[0]);
+ for (int i = 1; i < len; i++) {
+ out.append(separator).append(array[i]);
+ }
+ return out.toString();
+ }
+}
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
new file mode 100644
index 000000000000..3b5beefa97f9
--- /dev/null
+++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java
@@ -0,0 +1,84 @@
+package org.openapitools.client.api;
+
+import org.openapitools.client.ApiClient;
+
+import org.openapitools.client.model.Client;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+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.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import reactor.core.publisher.Mono;
+import reactor.core.publisher.Flux;
+
+
+public class AnotherFakeApi {
+ private ApiClient apiClient;
+
+ public AnotherFakeApi() {
+ this(new ApiClient());
+ }
+
+ @Autowired
+ public AnotherFakeApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * To test special tags
+ * To test special tags
+ *
200 - successful operation
+ * @param client client model
+ * @return Client
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Mono testSpecialTags(Client client) throws RestClientException {
+ Object postBody = client;
+
+ // verify the required parameter 'client' is set
+ if (client == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'client' when calling testSpecialTags");
+ }
+
+ String path = UriComponentsBuilder.fromPath("/another-fake/dummy").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] accepts = {
+ "application/json"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = {
+ "application/json"
+ };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+}
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
new file mode 100644
index 000000000000..5337a13513d2
--- /dev/null
+++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java
@@ -0,0 +1,466 @@
+package org.openapitools.client.api;
+
+import org.openapitools.client.ApiClient;
+
+import java.math.BigDecimal;
+import org.openapitools.client.model.Client;
+import java.io.File;
+import java.time.LocalDate;
+import java.time.OffsetDateTime;
+import org.openapitools.client.model.OuterComposite;
+import org.openapitools.client.model.User;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+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.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import reactor.core.publisher.Mono;
+import reactor.core.publisher.Flux;
+
+
+public class FakeApi {
+ private ApiClient apiClient;
+
+ public FakeApi() {
+ this(new ApiClient());
+ }
+
+ @Autowired
+ public FakeApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ *
+ * Test serialization of outer boolean types
+ *
200 - Output boolean
+ * @param body Input boolean as post body
+ * @return Boolean
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Mono fakeOuterBooleanSerialize(Boolean body) throws RestClientException {
+ Object postBody = body;
+
+ String path = UriComponentsBuilder.fromPath("/fake/outer/boolean").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] accepts = {
+ "*/*"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = { };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ *
+ * Test serialization of object with outer number type
+ *
200 - Output composite
+ * @param outerComposite Input composite as post body
+ * @return OuterComposite
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Mono fakeOuterCompositeSerialize(OuterComposite outerComposite) throws RestClientException {
+ Object postBody = outerComposite;
+
+ String path = UriComponentsBuilder.fromPath("/fake/outer/composite").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] accepts = {
+ "*/*"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = { };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ *
+ * Test serialization of outer number types
+ *
200 - Output number
+ * @param body Input number as post body
+ * @return BigDecimal
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Mono fakeOuterNumberSerialize(BigDecimal body) throws RestClientException {
+ Object postBody = body;
+
+ String path = UriComponentsBuilder.fromPath("/fake/outer/number").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] accepts = {
+ "*/*"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = { };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ *
+ * Test serialization of outer string types
+ *
200 - Output string
+ * @param body Input string as post body
+ * @return String
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Mono fakeOuterStringSerialize(String body) throws RestClientException {
+ Object postBody = body;
+
+ String path = UriComponentsBuilder.fromPath("/fake/outer/string").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] accepts = {
+ "*/*"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = { };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ *
+ *
+ *
200 - Success
+ * @param query The query parameter
+ * @param user The user parameter
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Mono testBodyWithQueryParams(String query, User user) throws RestClientException {
+ Object postBody = user;
+
+ // verify the required parameter 'query' is set
+ if (query == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'query' when calling testBodyWithQueryParams");
+ }
+
+ // verify the required parameter 'user' is set
+ if (user == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'user' when calling testBodyWithQueryParams");
+ }
+
+ String path = UriComponentsBuilder.fromPath("/fake/body-with-query-params").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ queryParams.putAll(apiClient.parameterToMultiValueMap(null, "query", query));
+
+ final String[] accepts = { };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = {
+ "application/json"
+ };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * To test \"client\" model
+ * To test \"client\" model
+ *
200 - successful operation
+ * @param client client model
+ * @return Client
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Mono testClientModel(Client client) throws RestClientException {
+ Object postBody = client;
+
+ // verify the required parameter 'client' is set
+ if (client == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'client' when calling testClientModel");
+ }
+
+ String path = UriComponentsBuilder.fromPath("/fake").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] accepts = {
+ "application/json"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = {
+ "application/json"
+ };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * 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 RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Mono 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 {
+ 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");
+ }
+
+ // verify the required parameter '_double' is set
+ if (_double == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '_double' when calling testEndpointParameters");
+ }
+
+ // verify the required parameter 'patternWithoutDelimiter' is set
+ if (patternWithoutDelimiter == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters");
+ }
+
+ // verify the required parameter '_byte' is set
+ if (_byte == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '_byte' when calling testEndpointParameters");
+ }
+
+ String path = UriComponentsBuilder.fromPath("/fake").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ if (integer != null)
+ formParams.add("integer", integer);
+ if (int32 != null)
+ formParams.add("int32", int32);
+ if (int64 != null)
+ formParams.add("int64", int64);
+ if (number != null)
+ formParams.add("number", number);
+ if (_float != null)
+ formParams.add("float", _float);
+ if (_double != null)
+ formParams.add("double", _double);
+ if (string != null)
+ formParams.add("string", string);
+ if (patternWithoutDelimiter != null)
+ formParams.add("pattern_without_delimiter", patternWithoutDelimiter);
+ if (_byte != null)
+ formParams.add("byte", _byte);
+ if (binary != null)
+ formParams.add("binary", new FileSystemResource(binary));
+ if (date != null)
+ formParams.add("date", date);
+ if (dateTime != null)
+ formParams.add("dateTime", dateTime);
+ if (password != null)
+ formParams.add("password", password);
+ if (paramCallback != null)
+ formParams.add("callback", paramCallback);
+
+ final String[] accepts = { };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = {
+ "application/x-www-form-urlencoded"
+ };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "http_basic_test" };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * 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 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
+ */
+ public Mono testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws RestClientException {
+ Object postBody = null;
+
+ String path = UriComponentsBuilder.fromPath("/fake").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), "enum_query_string_array", enumQueryStringArray));
+ queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_string", enumQueryString));
+ queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_integer", enumQueryInteger));
+ queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_double", enumQueryDouble));
+
+ if (enumHeaderStringArray != null)
+ headerParams.add("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray));
+ if (enumHeaderString != null)
+ headerParams.add("enum_header_string", apiClient.parameterToString(enumHeaderString));
+
+ if (enumFormStringArray != null)
+ formParams.add("enum_form_string_array", enumFormStringArray);
+ if (enumFormString != null)
+ formParams.add("enum_form_string", enumFormString);
+
+ final String[] accepts = { };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = {
+ "application/x-www-form-urlencoded"
+ };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * test inline additionalProperties
+ *
+ *
200 - successful operation
+ * @param requestBody request body
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Mono testInlineAdditionalProperties(Map requestBody) throws RestClientException {
+ Object postBody = requestBody;
+
+ // verify the required parameter 'requestBody' is set
+ if (requestBody == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties");
+ }
+
+ String path = UriComponentsBuilder.fromPath("/fake/inline-additionalProperties").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] accepts = { };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = {
+ "application/json"
+ };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * test json serialization of form data
+ *
+ *
200 - successful operation
+ * @param param field1
+ * @param param2 field2
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Mono testJsonFormData(String param, String param2) throws RestClientException {
+ 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");
+ }
+
+ // verify the required parameter 'param2' is set
+ if (param2 == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param2' when calling testJsonFormData");
+ }
+
+ String path = UriComponentsBuilder.fromPath("/fake/jsonFormData").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ if (param != null)
+ formParams.add("param", param);
+ if (param2 != null)
+ formParams.add("param2", param2);
+
+ final String[] accepts = { };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = {
+ "application/x-www-form-urlencoded"
+ };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+}
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
new file mode 100644
index 000000000000..4d3111415b25
--- /dev/null
+++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java
@@ -0,0 +1,84 @@
+package org.openapitools.client.api;
+
+import org.openapitools.client.ApiClient;
+
+import org.openapitools.client.model.Client;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+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.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import reactor.core.publisher.Mono;
+import reactor.core.publisher.Flux;
+
+
+public class FakeClassnameTags123Api {
+ private ApiClient apiClient;
+
+ public FakeClassnameTags123Api() {
+ this(new ApiClient());
+ }
+
+ @Autowired
+ public FakeClassnameTags123Api(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * To test class name in snake case
+ * To test class name in snake case
+ *
200 - successful operation
+ * @param client client model
+ * @return Client
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Mono testClassname(Client client) throws RestClientException {
+ Object postBody = client;
+
+ // verify the required parameter 'client' is set
+ if (client == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'client' when calling testClassname");
+ }
+
+ String path = UriComponentsBuilder.fromPath("/fake_classname_test").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] accepts = {
+ "application/json"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = {
+ "application/json"
+ };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "api_key_query" };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+}
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
new file mode 100644
index 000000000000..f75bef47f0c8
--- /dev/null
+++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java
@@ -0,0 +1,409 @@
+package org.openapitools.client.api;
+
+import org.openapitools.client.ApiClient;
+
+import java.io.File;
+import org.openapitools.client.model.ModelApiResponse;
+import org.openapitools.client.model.Pet;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+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.core.io.FileSystemResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import reactor.core.publisher.Mono;
+import reactor.core.publisher.Flux;
+
+
+public class PetApi {
+ private ApiClient apiClient;
+
+ public PetApi() {
+ this(new ApiClient());
+ }
+
+ @Autowired
+ public PetApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Add a new pet to the store
+ *
+ *
405 - Invalid input
+ * @param pet Pet object that needs to be added to the store
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Mono addPet(Pet pet) throws RestClientException {
+ Object postBody = pet;
+
+ // verify the required parameter 'pet' is set
+ if (pet == null) {
+ throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'pet' when calling addPet");
+ }
+
+ String path = UriComponentsBuilder.fromPath("/pet").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ final String[] accepts = { };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = {
+ "application/json", "application/xml"
+ };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "petstore_auth" };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * Deletes a pet
+ *
+ *
400 - 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
+ */
+ public Mono deletePet(Long petId, String apiKey) throws RestClientException {
+ 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");
+ }
+
+ // create path and map variables
+ final Map uriVariables = new HashMap();
+ uriVariables.put("petId", petId);
+ String path = UriComponentsBuilder.fromPath("/pet/{petId}").buildAndExpand(uriVariables).toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ if (apiKey != null)
+ headerParams.add("api_key", apiClient.parameterToString(apiKey));
+
+ final String[] accepts = { };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = { };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "petstore_auth" };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * 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 List<Pet>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Flux findPetsByStatus(List status) throws RestClientException {
+ 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");
+ }
+
+ String path = UriComponentsBuilder.fromPath("/pet/findByStatus").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), "status", status));
+
+ final String[] accepts = {
+ "application/xml", "application/json"
+ };
+ final List accept = apiClient.selectHeaderAccept(accepts);
+ final String[] contentTypes = { };
+ final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
+
+ String[] authNames = new String[] { "petstore_auth" };
+
+ ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
+ return apiClient.invokeFluxAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
+ }
+ /**
+ * 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 List<Pet>
+ * @throws RestClientException if an error occurs while attempting to invoke the API
+ */
+ public Flux findPetsByTags(List tags) throws RestClientException {
+ 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");
+ }
+
+ String path = UriComponentsBuilder.fromPath("/pet/findByTags").build().toUriString();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap formParams = new LinkedMultiValueMap();
+
+ queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), "tags", tags));
+
+ final String[] accepts = {
+ "application/xml", "application/json"
+ };
+ final List