forked from loafle/openapi-generator-original
Add Generated annotations to more classes (#17736)
This commit is contained in:
@@ -11,6 +11,7 @@ import java.text.DecimalFormat;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.TimeZone;
|
||||
|
||||
{{>generatedAnnotation}}
|
||||
public class RFC3339DateFormat extends DateFormat {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||
@@ -43,4 +44,4 @@ public class RFC3339DateFormat extends DateFormat {
|
||||
public Object clone() {
|
||||
return super.clone();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Map;
|
||||
/**
|
||||
* Representing a Server configuration.
|
||||
*/
|
||||
{{>generatedAnnotation}}
|
||||
public class ServerConfiguration {
|
||||
public String URL;
|
||||
public String description;
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.HashSet;
|
||||
/**
|
||||
* Representing a Server Variable for server URL template substitution.
|
||||
*/
|
||||
{{>generatedAnnotation}}
|
||||
public class ServerVariable {
|
||||
public String description;
|
||||
public String defaultValue;
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.TreeMap;
|
||||
*
|
||||
* @param <T> The type of data that is deserialized from response body
|
||||
*/
|
||||
{{>generatedAnnotation}}
|
||||
public class ApiResponse<T> {
|
||||
final private int statusCode;
|
||||
final private Map<String, List<String>> headers;
|
||||
|
||||
@@ -81,6 +81,7 @@ public class JSON {
|
||||
/**
|
||||
* Helper class to register the discriminator mappings.
|
||||
*/
|
||||
{{>generatedAnnotation}}
|
||||
private static class ClassDiscriminatorMapping {
|
||||
// The model class name.
|
||||
Class<?> modelClass;
|
||||
|
||||
@@ -204,7 +204,7 @@ public class {{classname}} {
|
||||
try {
|
||||
String responseBody = localVarResponse.body();
|
||||
return CompletableFuture.completedFuture(
|
||||
responseBody == null || responseBody.isBlank() ? null : memberVarObjectMapper.readValue(responseBody, new TypeReference<{{{returnType}}}>() {})
|
||||
responseBody == null || responseBody.isBlank() ? null : memberVarObjectMapper.readValue(responseBody, new GenericTypeRef<{{{returnType}}}>())
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
@@ -274,7 +274,7 @@ public class {{classname}} {
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
{{#returnType}}
|
||||
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {}) // closes the InputStream
|
||||
localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new GenericTypeRef<{{{returnType}}}>()) // closes the InputStream
|
||||
{{/returnType}}
|
||||
{{^returnType}}
|
||||
null
|
||||
@@ -317,7 +317,7 @@ public class {{classname}} {
|
||||
new ApiResponse<{{{returnType}}}>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
responseBody == null || responseBody.isBlank() ? null : memberVarObjectMapper.readValue(responseBody, new TypeReference<{{{returnType}}}>() {}))
|
||||
responseBody == null || responseBody.isBlank() ? null : memberVarObjectMapper.readValue(responseBody, new GenericTypeRef<{{{returnType}}}>()))
|
||||
);
|
||||
} catch (IOException e) {
|
||||
return CompletableFuture.failedFuture(new ApiException(e));
|
||||
@@ -588,6 +588,9 @@ public class {{classname}} {
|
||||
}
|
||||
}
|
||||
|
||||
{{>generatedAnnotation}}
|
||||
private static final class GenericTypeRef<T> extends TypeReference<T> {}
|
||||
|
||||
{{/hasParams}}
|
||||
{{/vendorExtensions.x-group-parameters}}
|
||||
{{/operation}}
|
||||
|
||||
Reference in New Issue
Block a user