Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.12.0
7.13.0
Original file line number Diff line number Diff line change
Expand Up @@ -899,15 +899,8 @@ public <T> T deserialize(Response response, Type returnType) throws ApiException
return (T) downloadFileFromResponse(response);
}

String respBody;
try {
if (response.body() != null) respBody = response.body().string();
else respBody = null;
} catch (IOException e) {
throw new ApiException(e);
}

if (respBody == null || "".equals(respBody)) {
ResponseBody respBody = response.body();
if (respBody == null) {
return null;
}

Expand All @@ -916,17 +909,25 @@ public <T> T deserialize(Response response, Type returnType) throws ApiException
// ensuring a default content type
contentType = "application/json";
}
if (isJsonMime(contentType)) {
return JSON.deserialize(respBody, returnType);
} else if (returnType.equals(String.class)) {
// Expecting string, return the raw response body.
return (T) respBody;
} else {
throw new ApiException(
"Content type \"" + contentType + "\" is not supported for type: " + returnType,
response.code(),
response.headers().toMultimap(),
respBody);
try {
if (isJsonMime(contentType)) {
return JSON.deserialize(respBody.byteStream(), returnType);
} else if (returnType.equals(String.class)) {
String respBodyString = respBody.string();
if (respBodyString.isEmpty()) {
return null;
}
// Expecting string, return the raw response body.
return (T) respBodyString;
} else {
throw new ApiException(
"Content type \"" + contentType + "\" is not supported for type: " + returnType,
response.code(),
response.headers().toMultimap(),
response.body().string());
}
} catch (IOException e) {
throw new ApiException(e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@SuppressWarnings("serial")
@javax.annotation.Generated(
value = "org.openapitools.codegen.languages.JavaClientCodegen",
comments = "Generator version: 7.12.0")
comments = "Generator version: 7.13.0")
public class ApiException extends RuntimeException {
private static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@

package com.regula.documentreader.webclient;

import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Supplier;

@javax.annotation.Generated(
value = "org.openapitools.codegen.languages.JavaClientCodegen",
comments = "Generator version: 7.12.0")
comments = "Generator version: 7.13.0")
public class Configuration {
public static final String VERSION = "8.1.0";

private static volatile ApiClient defaultApiClient = new ApiClient();
private static final AtomicReference<ApiClient> defaultApiClient = new AtomicReference<>();
private static volatile Supplier<ApiClient> apiClientFactory = ApiClient::new;

/**
* Get the default API client, which would be used when creating API instances without providing
Expand All @@ -27,7 +32,18 @@ public class Configuration {
* @return Default API client
*/
public static ApiClient getDefaultApiClient() {
return defaultApiClient;
ApiClient client = defaultApiClient.get();
if (client == null) {
client =
defaultApiClient.updateAndGet(
val -> {
if (val != null) { // changed by another thread
return val;
}
return apiClientFactory.get();
});
}
return client;
}

/**
Expand All @@ -37,6 +53,13 @@ public static ApiClient getDefaultApiClient() {
* @param apiClient API client
*/
public static void setDefaultApiClient(ApiClient apiClient) {
defaultApiClient = apiClient;
defaultApiClient.set(apiClient);
}

/** set the callback used to create new ApiClient objects */
public static void setApiClientFactory(Supplier<ApiClient> factory) {
apiClientFactory = Objects.requireNonNull(factory);
}

private Configuration() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
import io.gsonfire.GsonFireBuilder;
import io.gsonfire.TypeSelector;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.lang.reflect.Type;
import java.nio.charset.StandardCharsets;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.ParsePosition;
Expand Down Expand Up @@ -1448,6 +1451,29 @@ public static <T> T deserialize(String body, Type returnType) {
}
}

/**
* Deserialize the given JSON InputStream to a Java object.
*
* @param <T> Type
* @param inputStream The JSON InputStream
* @param returnType The type to deserialize into
* @return The deserialized Java object
*/
@SuppressWarnings("unchecked")
public static <T> T deserialize(InputStream inputStream, Type returnType) throws IOException {
try (InputStreamReader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) {
if (isLenientOnJson) {
// see
// https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean)
JsonReader jsonReader = new JsonReader(reader);
jsonReader.setLenient(true);
return gson.fromJson(jsonReader, returnType);
} else {
return gson.fromJson(reader, returnType);
}
}
}

/** Gson TypeAdapter for Byte Array type */
public static class ByteArrayAdapter extends TypeAdapter<byte[]> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@javax.annotation.Generated(
value = "org.openapitools.codegen.languages.JavaClientCodegen",
comments = "Generator version: 7.12.0")
comments = "Generator version: 7.13.0")
public class Pair {
private String name = "";
private String value = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/** Representing a Server configuration. */
@javax.annotation.Generated(
value = "org.openapitools.codegen.languages.JavaClientCodegen",
comments = "Generator version: 7.12.0")
comments = "Generator version: 7.13.0")
public class ServerConfiguration {
public String URL;
public String description;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/** Representing a Server Variable for server URL template substitution. */
@javax.annotation.Generated(
value = "org.openapitools.codegen.languages.JavaClientCodegen",
comments = "Generator version: 7.12.0")
comments = "Generator version: 7.13.0")
public class ServerVariable {
public String description;
public String defaultValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

@javax.annotation.Generated(
value = "org.openapitools.codegen.languages.JavaClientCodegen",
comments = "Generator version: 7.12.0")
comments = "Generator version: 7.13.0")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public void setCustomBaseUrl(String customBaseUrl) {
* <tr><td> 200 </td><td> Device info. </td><td> - </td></tr>
* </table>
*/
public okhttp3.Call healthzCall(String xRequestID, final ApiCallback _callback)
public okhttp3.Call healthzCall(
@javax.annotation.Nullable String xRequestID, final ApiCallback _callback)
throws ApiException {
String basePath = null;
// Operation Servers
Expand Down Expand Up @@ -137,7 +138,8 @@ public okhttp3.Call healthzCall(String xRequestID, final ApiCallback _callback)
}

@SuppressWarnings("rawtypes")
private okhttp3.Call healthzValidateBeforeCall(String xRequestID, final ApiCallback _callback)
private okhttp3.Call healthzValidateBeforeCall(
@javax.annotation.Nullable String xRequestID, final ApiCallback _callback)
throws ApiException {
return healthzCall(xRequestID, _callback);
}
Expand All @@ -156,7 +158,7 @@ private okhttp3.Call healthzValidateBeforeCall(String xRequestID, final ApiCallb
* <tr><td> 200 </td><td> Device info. </td><td> - </td></tr>
* </table>
*/
public Healthcheck healthz(String xRequestID) throws ApiException {
public Healthcheck healthz(@javax.annotation.Nullable String xRequestID) throws ApiException {
ApiResponse<Healthcheck> localVarResp = healthzWithHttpInfo(xRequestID);
return localVarResp.getData();
}
Expand All @@ -175,7 +177,8 @@ public Healthcheck healthz(String xRequestID) throws ApiException {
* <tr><td> 200 </td><td> Device info. </td><td> - </td></tr>
* </table>
*/
public ApiResponse<Healthcheck> healthzWithHttpInfo(String xRequestID) throws ApiException {
public ApiResponse<Healthcheck> healthzWithHttpInfo(@javax.annotation.Nullable String xRequestID)
throws ApiException {
okhttp3.Call localVarCall = healthzValidateBeforeCall(xRequestID, null);
Type localVarReturnType = new TypeToken<Healthcheck>() {}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
Expand All @@ -195,7 +198,8 @@ public ApiResponse<Healthcheck> healthzWithHttpInfo(String xRequestID) throws Ap
* <tr><td> 200 </td><td> Device info. </td><td> - </td></tr>
* </table>
*/
public okhttp3.Call healthzAsync(String xRequestID, final ApiCallback<Healthcheck> _callback)
public okhttp3.Call healthzAsync(
@javax.annotation.Nullable String xRequestID, final ApiCallback<Healthcheck> _callback)
throws ApiException {

okhttp3.Call localVarCall = healthzValidateBeforeCall(xRequestID, _callback);
Expand All @@ -220,7 +224,9 @@ public okhttp3.Call healthzAsync(String xRequestID, final ApiCallback<Healthchec
* @deprecated
*/
@Deprecated
public okhttp3.Call pingCall(String xRequestID, final ApiCallback _callback) throws ApiException {
public okhttp3.Call pingCall(
@javax.annotation.Nullable String xRequestID, final ApiCallback _callback)
throws ApiException {
String basePath = null;
// Operation Servers
String[] localBasePaths = new String[] {};
Expand Down Expand Up @@ -279,7 +285,8 @@ public okhttp3.Call pingCall(String xRequestID, final ApiCallback _callback) thr

@Deprecated
@SuppressWarnings("rawtypes")
private okhttp3.Call pingValidateBeforeCall(String xRequestID, final ApiCallback _callback)
private okhttp3.Call pingValidateBeforeCall(
@javax.annotation.Nullable String xRequestID, final ApiCallback _callback)
throws ApiException {
return pingCall(xRequestID, _callback);
}
Expand All @@ -301,7 +308,7 @@ private okhttp3.Call pingValidateBeforeCall(String xRequestID, final ApiCallback
* @deprecated
*/
@Deprecated
public DeviceInfo ping(String xRequestID) throws ApiException {
public DeviceInfo ping(@javax.annotation.Nullable String xRequestID) throws ApiException {
ApiResponse<DeviceInfo> localVarResp = pingWithHttpInfo(xRequestID);
return localVarResp.getData();
}
Expand All @@ -323,7 +330,8 @@ public DeviceInfo ping(String xRequestID) throws ApiException {
* @deprecated
*/
@Deprecated
public ApiResponse<DeviceInfo> pingWithHttpInfo(String xRequestID) throws ApiException {
public ApiResponse<DeviceInfo> pingWithHttpInfo(@javax.annotation.Nullable String xRequestID)
throws ApiException {
okhttp3.Call localVarCall = pingValidateBeforeCall(xRequestID, null);
Type localVarReturnType = new TypeToken<DeviceInfo>() {}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
Expand All @@ -346,7 +354,8 @@ public ApiResponse<DeviceInfo> pingWithHttpInfo(String xRequestID) throws ApiExc
* @deprecated
*/
@Deprecated
public okhttp3.Call pingAsync(String xRequestID, final ApiCallback<DeviceInfo> _callback)
public okhttp3.Call pingAsync(
@javax.annotation.Nullable String xRequestID, final ApiCallback<DeviceInfo> _callback)
throws ApiException {

okhttp3.Call localVarCall = pingValidateBeforeCall(xRequestID, _callback);
Expand All @@ -369,7 +378,8 @@ public okhttp3.Call pingAsync(String xRequestID, final ApiCallback<DeviceInfo> _
* <tr><td> 400 </td><td> The license is not valid. </td><td> - </td></tr>
* </table>
*/
public okhttp3.Call readyzCall(String xRequestID, final ApiCallback _callback)
public okhttp3.Call readyzCall(
@javax.annotation.Nullable String xRequestID, final ApiCallback _callback)
throws ApiException {
String basePath = null;
// Operation Servers
Expand Down Expand Up @@ -428,7 +438,8 @@ public okhttp3.Call readyzCall(String xRequestID, final ApiCallback _callback)
}

@SuppressWarnings("rawtypes")
private okhttp3.Call readyzValidateBeforeCall(String xRequestID, final ApiCallback _callback)
private okhttp3.Call readyzValidateBeforeCall(
@javax.annotation.Nullable String xRequestID, final ApiCallback _callback)
throws ApiException {
return readyzCall(xRequestID, _callback);
}
Expand All @@ -447,7 +458,7 @@ private okhttp3.Call readyzValidateBeforeCall(String xRequestID, final ApiCallba
* <tr><td> 400 </td><td> The license is not valid. </td><td> - </td></tr>
* </table>
*/
public void readyz(String xRequestID) throws ApiException {
public void readyz(@javax.annotation.Nullable String xRequestID) throws ApiException {
readyzWithHttpInfo(xRequestID);
}

Expand All @@ -466,7 +477,8 @@ public void readyz(String xRequestID) throws ApiException {
* <tr><td> 400 </td><td> The license is not valid. </td><td> - </td></tr>
* </table>
*/
public ApiResponse<Void> readyzWithHttpInfo(String xRequestID) throws ApiException {
public ApiResponse<Void> readyzWithHttpInfo(@javax.annotation.Nullable String xRequestID)
throws ApiException {
okhttp3.Call localVarCall = readyzValidateBeforeCall(xRequestID, null);
return localVarApiClient.execute(localVarCall);
}
Expand All @@ -486,7 +498,8 @@ public ApiResponse<Void> readyzWithHttpInfo(String xRequestID) throws ApiExcepti
* <tr><td> 400 </td><td> The license is not valid. </td><td> - </td></tr>
* </table>
*/
public okhttp3.Call readyzAsync(String xRequestID, final ApiCallback<Void> _callback)
public okhttp3.Call readyzAsync(
@javax.annotation.Nullable String xRequestID, final ApiCallback<Void> _callback)
throws ApiException {

okhttp3.Call localVarCall = readyzValidateBeforeCall(xRequestID, _callback);
Expand Down
Loading