iterator = list.iterator();
+ StringBuilder out = new StringBuilder();
+ if (iterator.hasNext()) {
+ out.append(iterator.next());
+ }
+ while (iterator.hasNext()) {
+ out.append(separator).append(iterator.next());
+ }
+ return out.toString();
+ }
+}
diff --git a/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/api/BasApi.java b/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/api/BasApi.java
new file mode 100644
index 00000000000..1be5d319566
--- /dev/null
+++ b/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/api/BasApi.java
@@ -0,0 +1,157 @@
+package org.openapitools.client.api;
+
+import org.openapitools.client.ApiClient;
+
+import org.openapitools.client.model.DataChannel;
+import org.openapitools.client.model.DataDirection;
+import java.io.File;
+import org.openapitools.client.model.InlineObject;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Arrays;
+import java.util.stream.Collectors;
+
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestClient.ResponseSpec;
+import org.springframework.web.client.RestClientResponseException;
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0-SNAPSHOT")
+public class BasApi {
+ private ApiClient apiClient;
+
+ public BasApi() {
+ this(new ApiClient());
+ }
+
+ public BasApi(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ public ApiClient getApiClient() {
+ return apiClient;
+ }
+
+ public void setApiClient(ApiClient apiClient) {
+ this.apiClient = apiClient;
+ }
+
+ /**
+ * Creates a new message
+ * Creates a new message
+ * 201 - The message was created.
+ * @param fileContent The message payload
+ * @param idempotencyKey The idempotencyKey parameter
+ * @param dataDirection The dataDirection parameter
+ * @param dataChannel The dataChannel parameter
+ * @return InlineObject
+ * @throws RestClientResponseException if an error occurs while attempting to invoke the API
+ */
+ private ResponseSpec createMessageRequestCreation(@jakarta.annotation.Nonnull File fileContent, @jakarta.annotation.Nonnull String idempotencyKey, @jakarta.annotation.Nonnull DataDirection dataDirection, @jakarta.annotation.Nonnull DataChannel dataChannel) throws RestClientResponseException {
+ Object postBody = null;
+ // verify the required parameter 'fileContent' is set
+ if (fileContent == null) {
+ throw new RestClientResponseException("Missing the required parameter 'fileContent' when calling createMessage", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
+ // verify the required parameter 'idempotencyKey' is set
+ if (idempotencyKey == null) {
+ throw new RestClientResponseException("Missing the required parameter 'idempotencyKey' when calling createMessage", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
+ // verify the required parameter 'dataDirection' is set
+ if (dataDirection == null) {
+ throw new RestClientResponseException("Missing the required parameter 'dataDirection' when calling createMessage", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
+ // verify the required parameter 'dataChannel' is set
+ if (dataChannel == null) {
+ throw new RestClientResponseException("Missing the required parameter 'dataChannel' when calling createMessage", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
+ }
+ // create path and map variables
+ final Map pathParams = new HashMap<>();
+
+ final MultiValueMap queryParams = new LinkedMultiValueMap<>();
+ final HttpHeaders headerParams = new HttpHeaders();
+ final MultiValueMap cookieParams = new LinkedMultiValueMap<>();
+ final MultiValueMap formParams = new LinkedMultiValueMap<>();
+
+ if (fileContent != null)
+ formParams.add("fileContent", new FileSystemResource(fileContent));
+ if (idempotencyKey != null)
+ formParams.add("idempotencyKey", idempotencyKey);
+ if (dataDirection != null)
+ formParams.add("dataDirection", dataDirection);
+ if (dataChannel != null)
+ formParams.add("dataChannel", dataChannel);
+
+ final String[] localVarAccepts = {
+ "application/json"
+ };
+ final List localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
+ final String[] localVarContentTypes = {
+ "multipart/form-data"
+ };
+ final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
+
+ String[] localVarAuthNames = new String[] { "basicAuth" };
+
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};
+ return apiClient.invokeAPI("/messages", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
+ }
+
+ /**
+ * Creates a new message
+ * Creates a new message
+ * 201 - The message was created.
+ * @param fileContent The message payload
+ * @param idempotencyKey The idempotencyKey parameter
+ * @param dataDirection The dataDirection parameter
+ * @param dataChannel The dataChannel parameter
+ * @return InlineObject
+ * @throws RestClientResponseException if an error occurs while attempting to invoke the API
+ */
+ public InlineObject createMessage(@jakarta.annotation.Nonnull File fileContent, @jakarta.annotation.Nonnull String idempotencyKey, @jakarta.annotation.Nonnull DataDirection dataDirection, @jakarta.annotation.Nonnull DataChannel dataChannel) throws RestClientResponseException {
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};
+ return createMessageRequestCreation(fileContent, idempotencyKey, dataDirection, dataChannel).body(localVarReturnType);
+ }
+
+ /**
+ * Creates a new message
+ * Creates a new message
+ * 201 - The message was created.
+ * @param fileContent The message payload
+ * @param idempotencyKey The idempotencyKey parameter
+ * @param dataDirection The dataDirection parameter
+ * @param dataChannel The dataChannel parameter
+ * @return ResponseEntity<InlineObject>
+ * @throws RestClientResponseException if an error occurs while attempting to invoke the API
+ */
+ public ResponseEntity createMessageWithHttpInfo(@jakarta.annotation.Nonnull File fileContent, @jakarta.annotation.Nonnull String idempotencyKey, @jakarta.annotation.Nonnull DataDirection dataDirection, @jakarta.annotation.Nonnull DataChannel dataChannel) throws RestClientResponseException {
+ ParameterizedTypeReference localVarReturnType = new ParameterizedTypeReference<>() {};
+ return createMessageRequestCreation(fileContent, idempotencyKey, dataDirection, dataChannel).toEntity(localVarReturnType);
+ }
+
+ /**
+ * Creates a new message
+ * Creates a new message
+ * 201 - The message was created.
+ * @param fileContent The message payload
+ * @param idempotencyKey The idempotencyKey parameter
+ * @param dataDirection The dataDirection parameter
+ * @param dataChannel The dataChannel parameter
+ * @return ResponseSpec
+ * @throws RestClientResponseException if an error occurs while attempting to invoke the API
+ */
+ public ResponseSpec createMessageWithResponseSpec(@jakarta.annotation.Nonnull File fileContent, @jakarta.annotation.Nonnull String idempotencyKey, @jakarta.annotation.Nonnull DataDirection dataDirection, @jakarta.annotation.Nonnull DataChannel dataChannel) throws RestClientResponseException {
+ return createMessageRequestCreation(fileContent, idempotencyKey, dataDirection, dataChannel);
+ }
+}
diff --git a/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java
new file mode 100644
index 00000000000..c706b6dde35
--- /dev/null
+++ b/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java
@@ -0,0 +1,75 @@
+/*
+ * API
+ * API
+ *
+ * The version of the OpenAPI document: 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.auth;
+
+import org.springframework.http.HttpHeaders;
+import org.springframework.util.MultiValueMap;
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0-SNAPSHOT")
+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, MultiValueMap cookieParams) {
+ 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);
+ } else if (location.equals("cookie")) {
+ cookieParams.add(paramName, value);
+ }
+ }
+}
diff --git a/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/auth/Authentication.java
new file mode 100644
index 00000000000..c81865e3e47
--- /dev/null
+++ b/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/auth/Authentication.java
@@ -0,0 +1,29 @@
+/*
+ * API
+ * API
+ *
+ * The version of the OpenAPI document: 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.auth;
+
+import org.springframework.http.HttpHeaders;
+import org.springframework.util.MultiValueMap;
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0-SNAPSHOT")
+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
+ * @param cookieParams The cookie parameters for the request
+ */
+ void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams);
+}
diff --git a/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java
new file mode 100644
index 00000000000..87782a57ae9
--- /dev/null
+++ b/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java
@@ -0,0 +1,51 @@
+/*
+ * API
+ * API
+ *
+ * The version of the OpenAPI document: 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.auth;
+
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+
+import org.springframework.http.HttpHeaders;
+import org.springframework.util.MultiValueMap;
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0-SNAPSHOT")
+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, MultiValueMap cookieParams) {
+ if (username == null && password == null) {
+ return;
+ }
+ String str = (username == null ? "" : username) + ":" + (password == null ? "" : password);
+ headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8)));
+ }
+}
diff --git a/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java
new file mode 100644
index 00000000000..dd62f00bba6
--- /dev/null
+++ b/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java
@@ -0,0 +1,69 @@
+/*
+ * API
+ * API
+ *
+ * The version of the OpenAPI document: 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.auth;
+
+import java.util.Optional;
+import java.util.function.Supplier;
+import org.springframework.http.HttpHeaders;
+import org.springframework.util.MultiValueMap;
+
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0-SNAPSHOT")
+public class HttpBearerAuth implements Authentication {
+ private final String scheme;
+ private Supplier tokenSupplier;
+
+ public HttpBearerAuth(String scheme) {
+ this.scheme = scheme;
+ }
+
+ /**
+ * Gets the token, which together with the scheme, will be sent as the value of the Authorization header.
+ *
+ * @return The bearer token
+ */
+ public String getBearerToken() {
+ return tokenSupplier.get();
+ }
+
+ /**
+ * Sets the token, which together with the scheme, will be sent as the value of the Authorization header.
+ *
+ * @param bearerToken The bearer token to send in the Authorization header
+ */
+ public void setBearerToken(String bearerToken) {
+ this.tokenSupplier = () -> bearerToken;
+ }
+
+ /**
+ * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header.
+ *
+ * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header
+ */
+ public void setBearerToken(Supplier tokenSupplier) {
+ this.tokenSupplier = tokenSupplier;
+ }
+
+ @Override
+ public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) {
+ String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null);
+ if (bearerToken == null) {
+ return;
+ }
+ headerParams.add(HttpHeaders.AUTHORIZATION, (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken);
+ }
+
+ private static String upperCaseBearer(String scheme) {
+ return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme;
+ }
+}
diff --git a/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/model/DataChannel.java b/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/model/DataChannel.java
new file mode 100644
index 00000000000..37b33834a61
--- /dev/null
+++ b/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/model/DataChannel.java
@@ -0,0 +1,63 @@
+/*
+ * API
+ * API
+ *
+ * The version of the OpenAPI document: 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.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * The transport-channel
+ */
+public enum DataChannel {
+
+ BIKE("BIKE"),
+
+ CAR("CAR"),
+
+ BUS("BUS"),
+
+ PLANE("PLANE");
+
+ private String value;
+
+ DataChannel(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static DataChannel fromValue(String value) {
+ for (DataChannel b : DataChannel.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+}
+
diff --git a/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/model/DataDirection.java b/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/model/DataDirection.java
new file mode 100644
index 00000000000..817cdbf3a07
--- /dev/null
+++ b/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/model/DataDirection.java
@@ -0,0 +1,59 @@
+/*
+ * API
+ * API
+ *
+ * The version of the OpenAPI document: 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.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * The direction a message travels
+ */
+public enum DataDirection {
+
+ INGOING("INGOING"),
+
+ OUTGOING("OUTGOING");
+
+ private String value;
+
+ DataDirection(String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return String.valueOf(value);
+ }
+
+ @JsonCreator
+ public static DataDirection fromValue(String value) {
+ for (DataDirection b : DataDirection.values()) {
+ if (b.value.equals(value)) {
+ return b;
+ }
+ }
+ throw new IllegalArgumentException("Unexpected value '" + value + "'");
+ }
+}
+
diff --git a/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/model/InlineObject.java b/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/model/InlineObject.java
new file mode 100644
index 00000000000..ebac2bb4a39
--- /dev/null
+++ b/samples/client/others/java/restclient-enum-in-multipart/src/main/java/org/openapitools/client/model/InlineObject.java
@@ -0,0 +1,107 @@
+/*
+ * API
+ * API
+ *
+ * The version of the OpenAPI document: 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.model;
+
+import java.util.Objects;
+import java.util.Arrays;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import java.util.UUID;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+
+/**
+ * InlineObject
+ */
+@JsonPropertyOrder({
+ InlineObject.JSON_PROPERTY_MESSAGE_ID
+})
+@JsonTypeName("inline_object")
+@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0-SNAPSHOT")
+public class InlineObject {
+ public static final String JSON_PROPERTY_MESSAGE_ID = "messageId";
+ @jakarta.annotation.Nonnull
+ private UUID messageId;
+
+ public InlineObject() {
+ }
+
+ public InlineObject messageId(@jakarta.annotation.Nonnull UUID messageId) {
+
+ this.messageId = messageId;
+ return this;
+ }
+
+ /**
+ * The messageID
+ * @return messageId
+ */
+ @jakarta.annotation.Nonnull
+ @JsonProperty(JSON_PROPERTY_MESSAGE_ID)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+
+ public UUID getMessageId() {
+ return messageId;
+ }
+
+
+ @JsonProperty(JSON_PROPERTY_MESSAGE_ID)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public void setMessageId(@jakarta.annotation.Nonnull UUID messageId) {
+ this.messageId = messageId;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ InlineObject inlineObject = (InlineObject) o;
+ return Objects.equals(this.messageId, inlineObject.messageId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(messageId);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class InlineObject {\n");
+ sb.append(" messageId: ").append(toIndentedString(messageId)).append("\n");
+ sb.append("}");
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces
+ * (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+
+}
+
diff --git a/samples/client/others/java/restclient-enum-in-multipart/src/test/java/org/openapitools/client/api/BasApiTest.java b/samples/client/others/java/restclient-enum-in-multipart/src/test/java/org/openapitools/client/api/BasApiTest.java
new file mode 100644
index 00000000000..c72b1d2220e
--- /dev/null
+++ b/samples/client/others/java/restclient-enum-in-multipart/src/test/java/org/openapitools/client/api/BasApiTest.java
@@ -0,0 +1,57 @@
+package org.openapitools.client.api;
+
+import java.io.File;
+import org.junit.jupiter.api.Test;
+
+import org.openapitools.client.model.DataChannel;
+import org.openapitools.client.model.DataDirection;
+
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+import org.openapitools.client.ApiClient;
+import java.nio.charset.StandardCharsets;
+import java.util.UUID;
+import org.springframework.web.client.RestClient;
+import org.springframework.core.io.AbstractResource;
+import org.springframework.core.io.FileSystemResource;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+class BasApiTest {
+
+ @Test
+ public void requestTest() {
+
+ RestClient restClient = RestClient.builder() //
+ .requestInterceptor(
+ (request, body, execution) -> {
+ if (body != null && body.length > 0) {
+ String bodyString = new String(body, StandardCharsets.UTF_8);
+ bodyString = bodyString.replace("\r", "").replace("\n", "");
+ String expected = "Content-Disposition: form-data; name=\"dataChannel\"Content-Type: text/plain;charset=UTF-8";
+ assertTrue(bodyString.contains(expected));
+ }
+ return execution.execute(request, body);
+ })
+ .build();
+
+ ApiClient apiClient = new ApiClient(restClient);
+ apiClient.setBasePath("http://localhost:8080");
+ apiClient.setUsername("user");
+ apiClient.setPassword("password");
+ BasApi basApi = new BasApi(apiClient);
+
+ File fileContent = new File("src/test/resources/testdata.xml");
+ String idempotencyKey = UUID.randomUUID().toString();
+ DataDirection dataDirection = DataDirection.INGOING;
+ DataChannel dataChannel = DataChannel.BIKE;
+ try {
+ basApi.createMessage(fileContent, idempotencyKey, dataDirection, dataChannel);
+ } catch (Exception e) {
+ // Will happen as we can´t use endpoint
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/samples/client/others/java/restclient-enum-in-multipart/src/test/java/org/openapitools/client/model/DataChannelTest.java b/samples/client/others/java/restclient-enum-in-multipart/src/test/java/org/openapitools/client/model/DataChannelTest.java
new file mode 100644
index 00000000000..5f6b8c5c54f
--- /dev/null
+++ b/samples/client/others/java/restclient-enum-in-multipart/src/test/java/org/openapitools/client/model/DataChannelTest.java
@@ -0,0 +1,32 @@
+/*
+ * API
+ * API
+ *
+ * The version of the OpenAPI document: 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.model;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Model tests for DataChannel
+ */
+class DataChannelTest {
+ /**
+ * Model tests for DataChannel
+ */
+ @Test
+ void testDataChannel() {
+ // TODO: test DataChannel
+ }
+
+}
diff --git a/samples/client/others/java/restclient-enum-in-multipart/src/test/java/org/openapitools/client/model/DataDirectionTest.java b/samples/client/others/java/restclient-enum-in-multipart/src/test/java/org/openapitools/client/model/DataDirectionTest.java
new file mode 100644
index 00000000000..3e62944bc40
--- /dev/null
+++ b/samples/client/others/java/restclient-enum-in-multipart/src/test/java/org/openapitools/client/model/DataDirectionTest.java
@@ -0,0 +1,32 @@
+/*
+ * API
+ * API
+ *
+ * The version of the OpenAPI document: 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.model;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Model tests for DataDirection
+ */
+class DataDirectionTest {
+ /**
+ * Model tests for DataDirection
+ */
+ @Test
+ void testDataDirection() {
+ // TODO: test DataDirection
+ }
+
+}
diff --git a/samples/client/others/java/restclient-enum-in-multipart/src/test/java/org/openapitools/client/model/InlineObjectTest.java b/samples/client/others/java/restclient-enum-in-multipart/src/test/java/org/openapitools/client/model/InlineObjectTest.java
new file mode 100644
index 00000000000..6ea6e8107f3
--- /dev/null
+++ b/samples/client/others/java/restclient-enum-in-multipart/src/test/java/org/openapitools/client/model/InlineObjectTest.java
@@ -0,0 +1,48 @@
+/*
+ * API
+ * API
+ *
+ * The version of the OpenAPI document: 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.model;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+import com.fasterxml.jackson.annotation.JsonValue;
+import java.util.UUID;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Model tests for InlineObject
+ */
+class InlineObjectTest {
+ private final InlineObject model = new InlineObject();
+
+ /**
+ * Model tests for InlineObject
+ */
+ @Test
+ void testInlineObject() {
+ // TODO: test InlineObject
+ }
+
+ /**
+ * Test the property 'messageId'
+ */
+ @Test
+ void messageIdTest() {
+ // TODO: test messageId
+ }
+
+}
diff --git a/samples/client/others/java/restclient-enum-in-multipart/src/test/resources/testdata.xml b/samples/client/others/java/restclient-enum-in-multipart/src/test/resources/testdata.xml
new file mode 100644
index 00000000000..ae556c18d4f
--- /dev/null
+++ b/samples/client/others/java/restclient-enum-in-multipart/src/test/resources/testdata.xml
@@ -0,0 +1,5 @@
+
+
+ Boo
+
+
\ No newline at end of file
diff --git a/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java
index bb01d4ced08..d4df0646165 100644
--- a/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java
+++ b/samples/client/others/java/restclient-useAbstractionForFiles/src/main/java/org/openapitools/client/ApiClient.java
@@ -637,6 +637,18 @@ public class ApiClient extends JavaTimeFormatter {
addCookiesToRequest(cookieParams, requestBuilder);
addCookiesToRequest(defaultCookies, requestBuilder);
+ if (MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType)) {
+ formParams.forEach(
+ (k, v) -> {
+ if (v instanceof java.util.ArrayList) {
+ Object o = v.get(0);
+ if (o != null && o.getClass().getEnumConstants() != null) {
+ v.set(0, o.toString());
+ }
+ }
+ });
+ }
+
var selectedBody = selectBody(body, formParams, contentType);
if (selectedBody != null) {
requestBuilder.body(selectedBody);
diff --git a/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java
index a13af430bf2..2c1d02e1c33 100644
--- a/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java
+++ b/samples/client/petstore/java/restclient-nullable-arrays/src/main/java/org/openapitools/client/ApiClient.java
@@ -637,6 +637,18 @@ public class ApiClient extends JavaTimeFormatter {
addCookiesToRequest(cookieParams, requestBuilder);
addCookiesToRequest(defaultCookies, requestBuilder);
+ if (MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType)) {
+ formParams.forEach(
+ (k, v) -> {
+ if (v instanceof java.util.ArrayList) {
+ Object o = v.get(0);
+ if (o != null && o.getClass().getEnumConstants() != null) {
+ v.set(0, o.toString());
+ }
+ }
+ });
+ }
+
var selectedBody = selectBody(body, formParams, contentType);
if (selectedBody != null) {
requestBuilder.body(selectedBody);
diff --git a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java
index 204f66a4e54..5f24fb7906e 100644
--- a/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java
+++ b/samples/client/petstore/java/restclient-swagger2/src/main/java/org/openapitools/client/ApiClient.java
@@ -657,6 +657,18 @@ public class ApiClient extends JavaTimeFormatter {
addCookiesToRequest(cookieParams, requestBuilder);
addCookiesToRequest(defaultCookies, requestBuilder);
+ if (MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType)) {
+ formParams.forEach(
+ (k, v) -> {
+ if (v instanceof java.util.ArrayList) {
+ Object o = v.get(0);
+ if (o != null && o.getClass().getEnumConstants() != null) {
+ v.set(0, o.toString());
+ }
+ }
+ });
+ }
+
var selectedBody = selectBody(body, formParams, contentType);
if (selectedBody != null) {
requestBuilder.body(selectedBody);
diff --git a/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/ApiClient.java
index 204f66a4e54..5f24fb7906e 100644
--- a/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/ApiClient.java
+++ b/samples/client/petstore/java/restclient-useSingleRequestParameter-static/src/main/java/org/openapitools/client/ApiClient.java
@@ -657,6 +657,18 @@ public class ApiClient extends JavaTimeFormatter {
addCookiesToRequest(cookieParams, requestBuilder);
addCookiesToRequest(defaultCookies, requestBuilder);
+ if (MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType)) {
+ formParams.forEach(
+ (k, v) -> {
+ if (v instanceof java.util.ArrayList) {
+ Object o = v.get(0);
+ if (o != null && o.getClass().getEnumConstants() != null) {
+ v.set(0, o.toString());
+ }
+ }
+ });
+ }
+
var selectedBody = selectBody(body, formParams, contentType);
if (selectedBody != null) {
requestBuilder.body(selectedBody);
diff --git a/samples/client/petstore/java/restclient-useSingleRequestParameter/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/restclient-useSingleRequestParameter/src/main/java/org/openapitools/client/ApiClient.java
index 204f66a4e54..5f24fb7906e 100644
--- a/samples/client/petstore/java/restclient-useSingleRequestParameter/src/main/java/org/openapitools/client/ApiClient.java
+++ b/samples/client/petstore/java/restclient-useSingleRequestParameter/src/main/java/org/openapitools/client/ApiClient.java
@@ -657,6 +657,18 @@ public class ApiClient extends JavaTimeFormatter {
addCookiesToRequest(cookieParams, requestBuilder);
addCookiesToRequest(defaultCookies, requestBuilder);
+ if (MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType)) {
+ formParams.forEach(
+ (k, v) -> {
+ if (v instanceof java.util.ArrayList) {
+ Object o = v.get(0);
+ if (o != null && o.getClass().getEnumConstants() != null) {
+ v.set(0, o.toString());
+ }
+ }
+ });
+ }
+
var selectedBody = selectBody(body, formParams, contentType);
if (selectedBody != null) {
requestBuilder.body(selectedBody);
diff --git a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ApiClient.java
index 204f66a4e54..5f24fb7906e 100644
--- a/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ApiClient.java
+++ b/samples/client/petstore/java/restclient/src/main/java/org/openapitools/client/ApiClient.java
@@ -657,6 +657,18 @@ public class ApiClient extends JavaTimeFormatter {
addCookiesToRequest(cookieParams, requestBuilder);
addCookiesToRequest(defaultCookies, requestBuilder);
+ if (MediaType.MULTIPART_FORM_DATA.isCompatibleWith(contentType)) {
+ formParams.forEach(
+ (k, v) -> {
+ if (v instanceof java.util.ArrayList) {
+ Object o = v.get(0);
+ if (o != null && o.getClass().getEnumConstants() != null) {
+ v.set(0, o.toString());
+ }
+ }
+ });
+ }
+
var selectedBody = selectBody(body, formParams, contentType);
if (selectedBody != null) {
requestBuilder.body(selectedBody);