forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 5.2.x
This commit is contained in:
@@ -25,7 +25,6 @@ import java.net.URLEncoder;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.nio.charset.Charset;
|
||||
import java.time.Duration;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@@ -36,6 +35,8 @@ import java.util.StringJoiner;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
/**
|
||||
* Configuration and utility class for API clients.
|
||||
*
|
||||
@@ -52,8 +53,6 @@ import java.util.stream.Collectors;
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ApiClient {
|
||||
|
||||
private static final Charset UTF_8 = Charset.forName("UTF-8");
|
||||
|
||||
private HttpClient.Builder builder;
|
||||
private ObjectMapper mapper;
|
||||
private String scheme;
|
||||
@@ -176,7 +175,7 @@ public class ApiClient {
|
||||
public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) {
|
||||
this.builder = builder;
|
||||
this.mapper = mapper;
|
||||
updateBaseUri(baseUri);
|
||||
updateBaseUri(baseUri != null ? baseUri : getDefaultBaseUri());
|
||||
interceptor = null;
|
||||
readTimeout = null;
|
||||
responseInterceptor = null;
|
||||
|
||||
@@ -67,6 +67,14 @@ public class AnotherFakeApi {
|
||||
localVarResponse.body());
|
||||
}
|
||||
|
||||
protected ApiException createApiException(HttpResponse<InputStream> response, String msgPrefix) throws IOException {
|
||||
String body = response.body() == null ? null : new String(response.body().readAllBytes());
|
||||
if (body != null) {
|
||||
msgPrefix += ": " + body;
|
||||
}
|
||||
return new ApiException(response.statusCode(), msgPrefix, response.headers(), body);
|
||||
}
|
||||
|
||||
/**
|
||||
* To test special tags
|
||||
* To test special tags and operation ID starting with number
|
||||
|
||||
@@ -75,6 +75,14 @@ public class FakeApi {
|
||||
localVarResponse.body());
|
||||
}
|
||||
|
||||
protected ApiException createApiException(HttpResponse<InputStream> response, String msgPrefix) throws IOException {
|
||||
String body = response.body() == null ? null : new String(response.body().readAllBytes());
|
||||
if (body != null) {
|
||||
msgPrefix += ": " + body;
|
||||
}
|
||||
return new ApiException(response.statusCode(), msgPrefix, response.headers(), body);
|
||||
}
|
||||
|
||||
/**
|
||||
* creates an XmlItem
|
||||
* this route creates an XmlItem
|
||||
|
||||
@@ -67,6 +67,14 @@ public class FakeClassnameTags123Api {
|
||||
localVarResponse.body());
|
||||
}
|
||||
|
||||
protected ApiException createApiException(HttpResponse<InputStream> response, String msgPrefix) throws IOException {
|
||||
String body = response.body() == null ? null : new String(response.body().readAllBytes());
|
||||
if (body != null) {
|
||||
msgPrefix += ": " + body;
|
||||
}
|
||||
return new ApiException(response.statusCode(), msgPrefix, response.headers(), body);
|
||||
}
|
||||
|
||||
/**
|
||||
* To test class name in snake case
|
||||
* To test class name in snake case
|
||||
|
||||
@@ -70,6 +70,14 @@ public class PetApi {
|
||||
localVarResponse.body());
|
||||
}
|
||||
|
||||
protected ApiException createApiException(HttpResponse<InputStream> response, String msgPrefix) throws IOException {
|
||||
String body = response.body() == null ? null : new String(response.body().readAllBytes());
|
||||
if (body != null) {
|
||||
msgPrefix += ": " + body;
|
||||
}
|
||||
return new ApiException(response.statusCode(), msgPrefix, response.headers(), body);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
|
||||
@@ -67,6 +67,14 @@ public class StoreApi {
|
||||
localVarResponse.body());
|
||||
}
|
||||
|
||||
protected ApiException createApiException(HttpResponse<InputStream> response, String msgPrefix) throws IOException {
|
||||
String body = response.body() == null ? null : new String(response.body().readAllBytes());
|
||||
if (body != null) {
|
||||
msgPrefix += ": " + body;
|
||||
}
|
||||
return new ApiException(response.statusCode(), msgPrefix, response.headers(), body);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
|
||||
@@ -67,6 +67,14 @@ public class UserApi {
|
||||
localVarResponse.body());
|
||||
}
|
||||
|
||||
protected ApiException createApiException(HttpResponse<InputStream> response, String msgPrefix) throws IOException {
|
||||
String body = response.body() == null ? null : new String(response.body().readAllBytes());
|
||||
if (body != null) {
|
||||
msgPrefix += ": " + body;
|
||||
}
|
||||
return new ApiException(response.statusCode(), msgPrefix, response.headers(), body);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
|
||||
Reference in New Issue
Block a user