forked from loafle/openapi-generator-original
[Java][Native] Support oneOf/anyOf schemas (#7263)
* Java-native add models of oneOf/anyOf * Java-native refresh samples * Java-native add a sample project for openapi3
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
<manifest package="org.openapitools.client" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application />
|
||||
</manifest>
|
||||
@@ -0,0 +1,358 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import org.openapitools.jackson.nullable.JsonNullableModule;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
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.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Configuration and utility class for API clients.
|
||||
*
|
||||
* <p>This class can be constructed and modified, then used to instantiate the
|
||||
* various API classes. The API classes use the settings in this class to
|
||||
* configure themselves, but otherwise do not store a link to this class.</p>
|
||||
*
|
||||
* <p>This class is mutable and not synchronized, so it is not thread-safe.
|
||||
* The API classes generated from this are immutable and thread-safe.</p>
|
||||
*
|
||||
* <p>The setter methods of this class return the current object to facilitate
|
||||
* a fluent style of configuration.</p>
|
||||
*/
|
||||
@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;
|
||||
private String host;
|
||||
private int port;
|
||||
private String basePath;
|
||||
private Consumer<HttpRequest.Builder> interceptor;
|
||||
private Consumer<HttpResponse<InputStream>> responseInterceptor;
|
||||
private Duration readTimeout;
|
||||
|
||||
private static String valueToString(Object value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* URL encode a string in the UTF-8 encoding.
|
||||
*
|
||||
* @param s String to encode.
|
||||
* @return URL-encoded representation of the input string.
|
||||
*/
|
||||
public static String urlEncode(String s) {
|
||||
return URLEncoder.encode(s, UTF_8);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a URL query name/value parameter to a list of encoded {@link Pair}
|
||||
* objects.
|
||||
*
|
||||
* <p>The value can be null, in which case an empty list is returned.</p>
|
||||
*
|
||||
* @param name The query name parameter.
|
||||
* @param value The query value, which may not be a collection but may be
|
||||
* null.
|
||||
* @return A singleton list of the {@link Pair} objects representing the input
|
||||
* parameters, which is encoded for use in a URL. If the value is null, an
|
||||
* empty list is returned.
|
||||
*/
|
||||
public static List<Pair> parameterToPairs(String name, Object value) {
|
||||
if (name == null || name.isEmpty() || value == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return Collections.singletonList(new Pair(urlEncode(name), urlEncode(value.toString())));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a URL query name/collection parameter to a list of encoded
|
||||
* {@link Pair} objects.
|
||||
*
|
||||
* @param collectionFormat The swagger collectionFormat string (csv, tsv, etc).
|
||||
* @param name The query name parameter.
|
||||
* @param values A collection of values for the given query name, which may be
|
||||
* null.
|
||||
* @return A list of {@link Pair} objects representing the input parameters,
|
||||
* which is encoded for use in a URL. If the values collection is null, an
|
||||
* empty list is returned.
|
||||
*/
|
||||
public static List<Pair> parameterToPairs(
|
||||
String collectionFormat, String name, Collection<?> values) {
|
||||
if (name == null || name.isEmpty() || values == null || values.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
// get the collection format (default: csv)
|
||||
String format = collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat;
|
||||
|
||||
// create the params based on the collection format
|
||||
if ("multi".equals(format)) {
|
||||
return values.stream()
|
||||
.map(value -> new Pair(urlEncode(name), urlEncode(valueToString(value))))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
String delimiter;
|
||||
switch(format) {
|
||||
case "csv":
|
||||
delimiter = urlEncode(",");
|
||||
break;
|
||||
case "ssv":
|
||||
delimiter = urlEncode(" ");
|
||||
break;
|
||||
case "tsv":
|
||||
delimiter = urlEncode("\t");
|
||||
break;
|
||||
case "pipes":
|
||||
delimiter = urlEncode("|");
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException("Illegal collection format: " + collectionFormat);
|
||||
}
|
||||
|
||||
StringJoiner joiner = new StringJoiner(delimiter);
|
||||
for (Object value : values) {
|
||||
joiner.add(urlEncode(valueToString(value)));
|
||||
}
|
||||
|
||||
return Collections.singletonList(new Pair(urlEncode(name), joiner.toString()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Ctor.
|
||||
*/
|
||||
public ApiClient() {
|
||||
builder = HttpClient.newBuilder();
|
||||
mapper = new ObjectMapper();
|
||||
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false);
|
||||
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
||||
mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
|
||||
mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
|
||||
mapper.registerModule(new JavaTimeModule());
|
||||
JsonNullableModule jnm = new JsonNullableModule();
|
||||
mapper.registerModule(jnm);
|
||||
URI baseURI = URI.create("http://petstore.swagger.io:80/v2");
|
||||
scheme = baseURI.getScheme();
|
||||
host = baseURI.getHost();
|
||||
port = baseURI.getPort();
|
||||
basePath = baseURI.getRawPath();
|
||||
interceptor = null;
|
||||
readTimeout = null;
|
||||
responseInterceptor = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a custom {@link HttpClient.Builder} object to use when creating the
|
||||
* {@link HttpClient} that is used by the API client.
|
||||
*
|
||||
* @param builder Custom client builder.
|
||||
* @return This object.
|
||||
*/
|
||||
public ApiClient setHttpClientBuilder(HttpClient.Builder builder) {
|
||||
this.builder = builder;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an {@link HttpClient} based on the current {@link HttpClient.Builder}.
|
||||
*
|
||||
* <p>The returned object is immutable and thread-safe.</p>
|
||||
*
|
||||
* @return The HTTP client.
|
||||
*/
|
||||
public HttpClient getHttpClient() {
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a custom {@link ObjectMapper} to serialize and deserialize the request
|
||||
* and response bodies.
|
||||
*
|
||||
* @param mapper Custom object mapper.
|
||||
* @return This object.
|
||||
*/
|
||||
public ApiClient setObjectMapper(ObjectMapper mapper) {
|
||||
this.mapper = mapper;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a copy of the current {@link ObjectMapper}.
|
||||
*
|
||||
* @return A copy of the current object mapper.
|
||||
*/
|
||||
public ObjectMapper getObjectMapper() {
|
||||
return mapper.copy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a custom host name for the target service.
|
||||
*
|
||||
* @param host The host name of the target service.
|
||||
* @return This object.
|
||||
*/
|
||||
public ApiClient setHost(String host) {
|
||||
this.host = host;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a custom port number for the target service.
|
||||
*
|
||||
* @param port The port of the target service. Set this to -1 to reset the
|
||||
* value to the default for the scheme.
|
||||
* @return This object.
|
||||
*/
|
||||
public ApiClient setPort(int port) {
|
||||
this.port = port;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a custom base path for the target service, for example '/v2'.
|
||||
*
|
||||
* @param basePath The base path against which the rest of the path is
|
||||
* resolved.
|
||||
* @return This object.
|
||||
*/
|
||||
public ApiClient setBasePath(String basePath) {
|
||||
this.basePath = basePath;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the base URI to resolve the endpoint paths against.
|
||||
*
|
||||
* @return The complete base URI that the rest of the API parameters are
|
||||
* resolved against.
|
||||
*/
|
||||
public String getBaseUri() {
|
||||
return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a custom scheme for the target service, for example 'https'.
|
||||
*
|
||||
* @param scheme The scheme of the target service
|
||||
* @return This object.
|
||||
*/
|
||||
public ApiClient setScheme(String scheme){
|
||||
this.scheme = scheme;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a custom request interceptor.
|
||||
*
|
||||
* <p>A request interceptor is a mechanism for altering each request before it
|
||||
* is sent. After the request has been fully configured but not yet built, the
|
||||
* request builder is passed into this function for further modification,
|
||||
* after which it is sent out.</p>
|
||||
*
|
||||
* <p>This is useful for altering the requests in a custom manner, such as
|
||||
* adding headers. It could also be used for logging and monitoring.</p>
|
||||
*
|
||||
* @param interceptor A function invoked before creating each request. A value
|
||||
* of null resets the interceptor to a no-op.
|
||||
* @return This object.
|
||||
*/
|
||||
public ApiClient setRequestInterceptor(Consumer<HttpRequest.Builder> interceptor) {
|
||||
this.interceptor = interceptor;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the custom interceptor.
|
||||
*
|
||||
* @return The custom interceptor that was set, or null if there isn't any.
|
||||
*/
|
||||
public Consumer<HttpRequest.Builder> getRequestInterceptor() {
|
||||
return interceptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a custom response interceptor.
|
||||
*
|
||||
* <p>This is useful for logging, monitoring or extraction of header variables</p>
|
||||
*
|
||||
* @param interceptor A function invoked before creating each request. A value
|
||||
* of null resets the interceptor to a no-op.
|
||||
* @return This object.
|
||||
*/
|
||||
public ApiClient setResponseInterceptor(Consumer<HttpResponse<InputStream>> interceptor) {
|
||||
this.responseInterceptor = interceptor;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the custom response interceptor.
|
||||
*
|
||||
* @return The custom interceptor that was set, or null if there isn't any.
|
||||
*/
|
||||
public Consumer<HttpResponse<InputStream>> getResponseInterceptor() {
|
||||
return responseInterceptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the read timeout for the http client.
|
||||
*
|
||||
* <p>This is the value used by default for each request, though it can be
|
||||
* overridden on a per-request basis with a request interceptor.</p>
|
||||
*
|
||||
* @param readTimeout The read timeout used by default by the http client.
|
||||
* Setting this value to null resets the timeout to an
|
||||
* effectively infinite value.
|
||||
* @return This object.
|
||||
*/
|
||||
public ApiClient setReadTimeout(Duration readTimeout) {
|
||||
this.readTimeout = readTimeout;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the read timeout that was set.
|
||||
*
|
||||
* @return The read timeout, or null if no timeout was set. Null represents
|
||||
* an infinite wait time.
|
||||
*/
|
||||
public Duration getReadTimeout() {
|
||||
return readTimeout;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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;
|
||||
|
||||
import java.net.http.HttpHeaders;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ApiException extends Exception {
|
||||
private int code = 0;
|
||||
private HttpHeaders 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, HttpHeaders responseHeaders, String responseBody) {
|
||||
super(message, throwable);
|
||||
this.code = code;
|
||||
this.responseHeaders = responseHeaders;
|
||||
this.responseBody = responseBody;
|
||||
}
|
||||
|
||||
public ApiException(String message, int code, HttpHeaders responseHeaders, String responseBody) {
|
||||
this(message, (Throwable) null, code, responseHeaders, responseBody);
|
||||
}
|
||||
|
||||
public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders) {
|
||||
this(message, throwable, code, responseHeaders, null);
|
||||
}
|
||||
|
||||
public ApiException(int code, HttpHeaders 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, HttpHeaders 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 Headers as an HttpHeaders object
|
||||
*/
|
||||
public HttpHeaders getResponseHeaders() {
|
||||
return responseHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the HTTP response body.
|
||||
*
|
||||
* @return Response body in the form of string
|
||||
*/
|
||||
public String getResponseBody() {
|
||||
return responseBody;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* API response returned by API call.
|
||||
*
|
||||
* @param <T> The type of data that is deserialized from response body
|
||||
*/
|
||||
public class ApiResponse<T> {
|
||||
final private int statusCode;
|
||||
final private Map<String, List<String>> headers;
|
||||
final private T data;
|
||||
|
||||
/**
|
||||
* @param statusCode The status code of HTTP response
|
||||
* @param headers The headers of HTTP response
|
||||
*/
|
||||
public ApiResponse(int statusCode, Map<String, List<String>> headers) {
|
||||
this(statusCode, headers, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param statusCode The status code of HTTP response
|
||||
* @param headers The headers of HTTP response
|
||||
* @param data The object deserialized from response bod
|
||||
*/
|
||||
public ApiResponse(int statusCode, Map<String, List<String>> headers, T data) {
|
||||
this.statusCode = statusCode;
|
||||
this.headers = headers;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public int getStatusCode() {
|
||||
return statusCode;
|
||||
}
|
||||
|
||||
public Map<String, List<String>> getHeaders() {
|
||||
return headers;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -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: \" \\
|
||||
*
|
||||
* 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;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
package org.openapitools.client;
|
||||
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
import com.fasterxml.jackson.databind.*;
|
||||
import org.openapitools.jackson.nullable.JsonNullableModule;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import org.openapitools.client.model.*;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.ws.rs.core.GenericType;
|
||||
import javax.ws.rs.ext.ContextResolver;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class JSON implements ContextResolver<ObjectMapper> {
|
||||
private ObjectMapper mapper;
|
||||
|
||||
public JSON() {
|
||||
mapper = new ObjectMapper();
|
||||
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||
mapper.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false);
|
||||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true);
|
||||
mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true);
|
||||
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
||||
mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
|
||||
mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING);
|
||||
mapper.setDateFormat(new RFC3339DateFormat());
|
||||
mapper.registerModule(new JavaTimeModule());
|
||||
JsonNullableModule jnm = new JsonNullableModule();
|
||||
mapper.registerModule(jnm);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the date format for JSON (de)serialization with Date properties.
|
||||
* @param dateFormat Date format
|
||||
*/
|
||||
public void setDateFormat(DateFormat dateFormat) {
|
||||
mapper.setDateFormat(dateFormat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ObjectMapper getContext(Class<?> type) {
|
||||
return mapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the object mapper
|
||||
*
|
||||
* @return object mapper
|
||||
*/
|
||||
public ObjectMapper getMapper() { return mapper; }
|
||||
|
||||
/**
|
||||
* Returns the target model class that should be used to deserialize the input data.
|
||||
* The discriminator mappings are used to determine the target model class.
|
||||
*
|
||||
* @param node The input data.
|
||||
* @param modelClass The class that contains the discriminator mappings.
|
||||
*/
|
||||
public static Class<?> getClassForElement(JsonNode node, Class<?> modelClass) {
|
||||
ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass);
|
||||
if (cdm != null) {
|
||||
return cdm.getClassForElement(node, new HashSet<Class<?>>());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper class to register the discriminator mappings.
|
||||
*/
|
||||
private static class ClassDiscriminatorMapping {
|
||||
// The model class name.
|
||||
Class<?> modelClass;
|
||||
// The name of the discriminator property.
|
||||
String discriminatorName;
|
||||
// The discriminator mappings for a model class.
|
||||
Map<String, Class<?>> discriminatorMappings;
|
||||
|
||||
// Constructs a new class discriminator.
|
||||
ClassDiscriminatorMapping(Class<?> cls, String propertyName, Map<String, Class<?>> mappings) {
|
||||
modelClass = cls;
|
||||
discriminatorName = propertyName;
|
||||
discriminatorMappings = new HashMap<String, Class<?>>();
|
||||
if (mappings != null) {
|
||||
discriminatorMappings.putAll(mappings);
|
||||
}
|
||||
}
|
||||
|
||||
// Return the name of the discriminator property for this model class.
|
||||
String getDiscriminatorPropertyName() {
|
||||
return discriminatorName;
|
||||
}
|
||||
|
||||
// Return the discriminator value or null if the discriminator is not
|
||||
// present in the payload.
|
||||
String getDiscriminatorValue(JsonNode node) {
|
||||
// Determine the value of the discriminator property in the input data.
|
||||
if (discriminatorName != null) {
|
||||
// Get the value of the discriminator property, if present in the input payload.
|
||||
node = node.get(discriminatorName);
|
||||
if (node != null && node.isValueNode()) {
|
||||
String discrValue = node.asText();
|
||||
if (discrValue != null) {
|
||||
return discrValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the target model class that should be used to deserialize the input data.
|
||||
* This function can be invoked for anyOf/oneOf composed models with discriminator mappings.
|
||||
* The discriminator mappings are used to determine the target model class.
|
||||
*
|
||||
* @param node The input data.
|
||||
* @param visitedClasses The set of classes that have already been visited.
|
||||
*/
|
||||
Class<?> getClassForElement(JsonNode node, Set<Class<?>> visitedClasses) {
|
||||
if (visitedClasses.contains(modelClass)) {
|
||||
// Class has already been visited.
|
||||
return null;
|
||||
}
|
||||
// Determine the value of the discriminator property in the input data.
|
||||
String discrValue = getDiscriminatorValue(node);
|
||||
if (discrValue == null) {
|
||||
return null;
|
||||
}
|
||||
Class<?> cls = discriminatorMappings.get(discrValue);
|
||||
// It may not be sufficient to return this cls directly because that target class
|
||||
// may itself be a composed schema, possibly with its own discriminator.
|
||||
visitedClasses.add(modelClass);
|
||||
for (Class<?> childClass : discriminatorMappings.values()) {
|
||||
ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass);
|
||||
if (childCdm == null) {
|
||||
continue;
|
||||
}
|
||||
if (!discriminatorName.equals(childCdm.discriminatorName)) {
|
||||
discrValue = getDiscriminatorValue(node);
|
||||
if (discrValue == null) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (childCdm != null) {
|
||||
// Recursively traverse the discriminator mappings.
|
||||
Class<?> childDiscr = childCdm.getClassForElement(node, visitedClasses);
|
||||
if (childDiscr != null) {
|
||||
return childDiscr;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cls;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy.
|
||||
*
|
||||
* The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy,
|
||||
* so it's not possible to use the instanceof keyword.
|
||||
*
|
||||
* @param modelClass A OpenAPI model class.
|
||||
* @param inst The instance object.
|
||||
*/
|
||||
public static boolean isInstanceOf(Class<?> modelClass, Object inst, Set<Class<?>> visitedClasses) {
|
||||
if (modelClass.isInstance(inst)) {
|
||||
// This handles the 'allOf' use case with single parent inheritance.
|
||||
return true;
|
||||
}
|
||||
if (visitedClasses.contains(modelClass)) {
|
||||
// This is to prevent infinite recursion when the composed schemas have
|
||||
// a circular dependency.
|
||||
return false;
|
||||
}
|
||||
visitedClasses.add(modelClass);
|
||||
|
||||
// Traverse the oneOf/anyOf composed schemas.
|
||||
Map<String, GenericType> descendants = modelDescendants.get(modelClass);
|
||||
if (descendants != null) {
|
||||
for (GenericType childType : descendants.values()) {
|
||||
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* A map of discriminators for all model classes.
|
||||
*/
|
||||
private static Map<Class<?>, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<Class<?>, ClassDiscriminatorMapping>();
|
||||
|
||||
/**
|
||||
* A map of oneOf/anyOf descendants for each model class.
|
||||
*/
|
||||
private static Map<Class<?>, Map<String, GenericType>> modelDescendants = new HashMap<Class<?>, Map<String, GenericType>>();
|
||||
|
||||
/**
|
||||
* Register a model class discriminator.
|
||||
*
|
||||
* @param modelClass the model class
|
||||
* @param discriminatorPropertyName the name of the discriminator property
|
||||
* @param mappings a map with the discriminator mappings.
|
||||
*/
|
||||
public static void registerDiscriminator(Class<?> modelClass, String discriminatorPropertyName, Map<String, Class<?>> mappings) {
|
||||
ClassDiscriminatorMapping m = new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings);
|
||||
modelDiscriminators.put(modelClass, m);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the oneOf/anyOf descendants of the modelClass.
|
||||
*
|
||||
* @param modelClass the model class
|
||||
* @param descendants a map of oneOf/anyOf descendants.
|
||||
*/
|
||||
public static void registerDescendants(Class<?> modelClass, Map<String, GenericType> descendants) {
|
||||
modelDescendants.put(modelClass, descendants);
|
||||
}
|
||||
|
||||
private static JSON json;
|
||||
|
||||
static {
|
||||
json = new JSON();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default JSON instance.
|
||||
*
|
||||
* @return the default JSON instance
|
||||
*/
|
||||
public static JSON getDefault() {
|
||||
return json;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the default JSON instance.
|
||||
*
|
||||
* @param json JSON instance to be used
|
||||
*/
|
||||
public static void setDefault(JSON json) {
|
||||
JSON.json = json;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -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: \" \\
|
||||
*
|
||||
* 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;
|
||||
|
||||
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.FieldPosition;
|
||||
import java.text.ParsePosition;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.TimeZone;
|
||||
|
||||
public class RFC3339DateFormat extends DateFormat {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||
|
||||
private final StdDateFormat fmt = new StdDateFormat()
|
||||
.withTimeZone(TIMEZONE_Z)
|
||||
.withColonInTimeZone(true);
|
||||
|
||||
public RFC3339DateFormat() {
|
||||
this.calendar = new GregorianCalendar();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date parse(String source) {
|
||||
return parse(source, new ParsePosition(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date parse(String source, ParsePosition pos) {
|
||||
return fmt.parse(source, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||
return fmt.format(date, toAppendTo, fieldPosition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package org.openapitools.client;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Representing a Server configuration.
|
||||
*/
|
||||
public class ServerConfiguration {
|
||||
public String URL;
|
||||
public String description;
|
||||
public Map<String, ServerVariable> variables;
|
||||
|
||||
/**
|
||||
* @param URL A URL to the target host.
|
||||
* @param description A describtion of the host designated by the URL.
|
||||
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
|
||||
*/
|
||||
public ServerConfiguration(String URL, String description, Map<String, ServerVariable> variables) {
|
||||
this.URL = URL;
|
||||
this.description = description;
|
||||
this.variables = variables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format URL template using given variables.
|
||||
*
|
||||
* @param variables A map between a variable name and its value.
|
||||
* @return Formatted URL.
|
||||
*/
|
||||
public String URL(Map<String, String> variables) {
|
||||
String url = this.URL;
|
||||
|
||||
// go through variables and replace placeholders
|
||||
for (Map.Entry<String, ServerVariable> variable: this.variables.entrySet()) {
|
||||
String name = variable.getKey();
|
||||
ServerVariable serverVariable = variable.getValue();
|
||||
String value = serverVariable.defaultValue;
|
||||
|
||||
if (variables != null && variables.containsKey(name)) {
|
||||
value = variables.get(name);
|
||||
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
|
||||
throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + ".");
|
||||
}
|
||||
}
|
||||
url = url.replaceAll("\\{" + name + "\\}", value);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format URL template using default server variables.
|
||||
*
|
||||
* @return Formatted URL.
|
||||
*/
|
||||
public String URL() {
|
||||
return URL(null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.openapitools.client;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* Representing a Server Variable for server URL template substitution.
|
||||
*/
|
||||
public class ServerVariable {
|
||||
public String description;
|
||||
public String defaultValue;
|
||||
public HashSet<String> enumValues = null;
|
||||
|
||||
/**
|
||||
* @param description A description for the server variable.
|
||||
* @param defaultValue The default value to use for substitution.
|
||||
* @param enumValues An enumeration of string values to be used if the substitution options are from a limited set.
|
||||
*/
|
||||
public ServerVariable(String description, String defaultValue, HashSet<String> enumValues) {
|
||||
this.description = description;
|
||||
this.defaultValue = defaultValue;
|
||||
this.enumValues = enumValues;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
import org.openapitools.client.model.Client;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.time.Duration;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class AnotherFakeApi {
|
||||
private final HttpClient memberVarHttpClient;
|
||||
private final ObjectMapper memberVarObjectMapper;
|
||||
private final String memberVarBaseUri;
|
||||
private final Consumer<HttpRequest.Builder> memberVarInterceptor;
|
||||
private final Duration memberVarReadTimeout;
|
||||
private final Consumer<HttpResponse<InputStream>> memberVarResponseInterceptor;
|
||||
|
||||
public AnotherFakeApi() {
|
||||
this(new ApiClient());
|
||||
}
|
||||
|
||||
public AnotherFakeApi(ApiClient apiClient) {
|
||||
memberVarHttpClient = apiClient.getHttpClient();
|
||||
memberVarObjectMapper = apiClient.getObjectMapper();
|
||||
memberVarBaseUri = apiClient.getBaseUri();
|
||||
memberVarInterceptor = apiClient.getRequestInterceptor();
|
||||
memberVarReadTimeout = apiClient.getReadTimeout();
|
||||
memberVarResponseInterceptor = apiClient.getResponseInterceptor();
|
||||
}
|
||||
|
||||
/**
|
||||
* To test special tags
|
||||
* To test special tags and operation ID starting with number
|
||||
* @param client client model (required)
|
||||
* @return Client
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Client call123testSpecialTags(Client client) throws ApiException {
|
||||
ApiResponse<Client> localVarResponse = call123testSpecialTagsWithHttpInfo(client);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* To test special tags
|
||||
* To test special tags and operation ID starting with number
|
||||
* @param client client model (required)
|
||||
* @return ApiResponse<Client>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Client> call123testSpecialTagsWithHttpInfo(Client client) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = call123testSpecialTagsRequestBuilder(client);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"call123testSpecialTags call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Client>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Client>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder call123testSpecialTagsRequestBuilder(Client client) throws ApiException {
|
||||
// verify the required parameter 'client' is set
|
||||
if (client == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'client' when calling call123testSpecialTags");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/another-fake/dummy";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Content-Type", "application/json");
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(client);
|
||||
localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
import org.openapitools.client.model.InlineResponseDefault;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.time.Duration;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class DefaultApi {
|
||||
private final HttpClient memberVarHttpClient;
|
||||
private final ObjectMapper memberVarObjectMapper;
|
||||
private final String memberVarBaseUri;
|
||||
private final Consumer<HttpRequest.Builder> memberVarInterceptor;
|
||||
private final Duration memberVarReadTimeout;
|
||||
private final Consumer<HttpResponse<InputStream>> memberVarResponseInterceptor;
|
||||
|
||||
public DefaultApi() {
|
||||
this(new ApiClient());
|
||||
}
|
||||
|
||||
public DefaultApi(ApiClient apiClient) {
|
||||
memberVarHttpClient = apiClient.getHttpClient();
|
||||
memberVarObjectMapper = apiClient.getObjectMapper();
|
||||
memberVarBaseUri = apiClient.getBaseUri();
|
||||
memberVarInterceptor = apiClient.getRequestInterceptor();
|
||||
memberVarReadTimeout = apiClient.getReadTimeout();
|
||||
memberVarResponseInterceptor = apiClient.getResponseInterceptor();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return InlineResponseDefault
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public InlineResponseDefault fooGet() throws ApiException {
|
||||
ApiResponse<InlineResponseDefault> localVarResponse = fooGetWithHttpInfo();
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return ApiResponse<InlineResponseDefault>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<InlineResponseDefault> fooGetWithHttpInfo() throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = fooGetRequestBuilder();
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"fooGet call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<InlineResponseDefault>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<InlineResponseDefault>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder fooGetRequestBuilder() throws ApiException {
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/foo";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
import org.openapitools.client.model.Client;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.time.Duration;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class FakeClassnameTags123Api {
|
||||
private final HttpClient memberVarHttpClient;
|
||||
private final ObjectMapper memberVarObjectMapper;
|
||||
private final String memberVarBaseUri;
|
||||
private final Consumer<HttpRequest.Builder> memberVarInterceptor;
|
||||
private final Duration memberVarReadTimeout;
|
||||
private final Consumer<HttpResponse<InputStream>> memberVarResponseInterceptor;
|
||||
|
||||
public FakeClassnameTags123Api() {
|
||||
this(new ApiClient());
|
||||
}
|
||||
|
||||
public FakeClassnameTags123Api(ApiClient apiClient) {
|
||||
memberVarHttpClient = apiClient.getHttpClient();
|
||||
memberVarObjectMapper = apiClient.getObjectMapper();
|
||||
memberVarBaseUri = apiClient.getBaseUri();
|
||||
memberVarInterceptor = apiClient.getRequestInterceptor();
|
||||
memberVarReadTimeout = apiClient.getReadTimeout();
|
||||
memberVarResponseInterceptor = apiClient.getResponseInterceptor();
|
||||
}
|
||||
|
||||
/**
|
||||
* To test class name in snake case
|
||||
* To test class name in snake case
|
||||
* @param client client model (required)
|
||||
* @return Client
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Client testClassname(Client client) throws ApiException {
|
||||
ApiResponse<Client> localVarResponse = testClassnameWithHttpInfo(client);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* To test class name in snake case
|
||||
* To test class name in snake case
|
||||
* @param client client model (required)
|
||||
* @return ApiResponse<Client>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Client> testClassnameWithHttpInfo(Client client) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = testClassnameRequestBuilder(client);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"testClassname call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Client>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Client>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder testClassnameRequestBuilder(Client client) throws ApiException {
|
||||
// verify the required parameter 'client' is set
|
||||
if (client == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'client' when calling testClassname");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/fake_classname_test";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Content-Type", "application/json");
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(client);
|
||||
localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,754 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.ModelApiResponse;
|
||||
import org.openapitools.client.model.Pet;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.time.Duration;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class PetApi {
|
||||
private final HttpClient memberVarHttpClient;
|
||||
private final ObjectMapper memberVarObjectMapper;
|
||||
private final String memberVarBaseUri;
|
||||
private final Consumer<HttpRequest.Builder> memberVarInterceptor;
|
||||
private final Duration memberVarReadTimeout;
|
||||
private final Consumer<HttpResponse<InputStream>> memberVarResponseInterceptor;
|
||||
|
||||
public PetApi() {
|
||||
this(new ApiClient());
|
||||
}
|
||||
|
||||
public PetApi(ApiClient apiClient) {
|
||||
memberVarHttpClient = apiClient.getHttpClient();
|
||||
memberVarObjectMapper = apiClient.getObjectMapper();
|
||||
memberVarBaseUri = apiClient.getBaseUri();
|
||||
memberVarInterceptor = apiClient.getRequestInterceptor();
|
||||
memberVarReadTimeout = apiClient.getReadTimeout();
|
||||
memberVarResponseInterceptor = apiClient.getResponseInterceptor();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* @param pet Pet object that needs to be added to the store (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void addPet(Pet pet) throws ApiException {
|
||||
addPetWithHttpInfo(pet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* @param pet Pet object that needs to be added to the store (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> addPetWithHttpInfo(Pet pet) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = addPetRequestBuilder(pet);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"addPet call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder addPetRequestBuilder(Pet pet) throws ApiException {
|
||||
// verify the required parameter 'pet' is set
|
||||
if (pet == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/pet";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Content-Type", "application/json");
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(pet);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
* @param petId Pet id to delete (required)
|
||||
* @param apiKey (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void deletePet(Long petId, String apiKey) throws ApiException {
|
||||
deletePetWithHttpInfo(petId, apiKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
* @param petId Pet id to delete (required)
|
||||
* @param apiKey (optional)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = deletePetRequestBuilder(petId, apiKey);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"deletePet call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder deletePetRequestBuilder(Long petId, String apiKey) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replace("{petId}", ApiClient.urlEncode(petId.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
if (apiKey != null) {
|
||||
localVarRequestBuilder.header("api_key", apiKey.toString());
|
||||
}
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* @param status Status values that need to be considered for filter (required)
|
||||
* @return List<Pet>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public List<Pet> findPetsByStatus(List<String> status) throws ApiException {
|
||||
ApiResponse<List<Pet>> localVarResponse = findPetsByStatusWithHttpInfo(status);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* @param status Status values that need to be considered for filter (required)
|
||||
* @return ApiResponse<List<Pet>>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<List<Pet>> findPetsByStatusWithHttpInfo(List<String> status) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = findPetsByStatusRequestBuilder(status);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"findPetsByStatus call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<List<Pet>>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<List<Pet>>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder findPetsByStatusRequestBuilder(List<String> status) throws ApiException {
|
||||
// verify the required parameter 'status' is set
|
||||
if (status == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/pet/findByStatus";
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<>();
|
||||
localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "status", status));
|
||||
|
||||
if (!localVarQueryParams.isEmpty()) {
|
||||
StringJoiner queryJoiner = new StringJoiner("&");
|
||||
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
|
||||
} else {
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
}
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* @param tags Tags to filter by (required)
|
||||
* @return List<Pet>
|
||||
* @throws ApiException if fails to make API call
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public List<Pet> findPetsByTags(List<String> tags) throws ApiException {
|
||||
ApiResponse<List<Pet>> localVarResponse = findPetsByTagsWithHttpInfo(tags);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* @param tags Tags to filter by (required)
|
||||
* @return ApiResponse<List<Pet>>
|
||||
* @throws ApiException if fails to make API call
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
public ApiResponse<List<Pet>> findPetsByTagsWithHttpInfo(List<String> tags) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = findPetsByTagsRequestBuilder(tags);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"findPetsByTags call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<List<Pet>>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<List<Pet>>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder findPetsByTagsRequestBuilder(List<String> tags) throws ApiException {
|
||||
// verify the required parameter 'tags' is set
|
||||
if (tags == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/pet/findByTags";
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<>();
|
||||
localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "tags", tags));
|
||||
|
||||
if (!localVarQueryParams.isEmpty()) {
|
||||
StringJoiner queryJoiner = new StringJoiner("&");
|
||||
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
|
||||
} else {
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
}
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Find pet by ID
|
||||
* Returns a single pet
|
||||
* @param petId ID of pet to return (required)
|
||||
* @return Pet
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Pet getPetById(Long petId) throws ApiException {
|
||||
ApiResponse<Pet> localVarResponse = getPetByIdWithHttpInfo(petId);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find pet by ID
|
||||
* Returns a single pet
|
||||
* @param petId ID of pet to return (required)
|
||||
* @return ApiResponse<Pet>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Pet> getPetByIdWithHttpInfo(Long petId) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = getPetByIdRequestBuilder(petId);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"getPetById call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Pet>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Pet>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder getPetByIdRequestBuilder(Long petId) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replace("{petId}", ApiClient.urlEncode(petId.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param pet Pet object that needs to be added to the store (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void updatePet(Pet pet) throws ApiException {
|
||||
updatePetWithHttpInfo(pet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param pet Pet object that needs to be added to the store (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> updatePetWithHttpInfo(Pet pet) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = updatePetRequestBuilder(pet);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"updatePet call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder updatePetRequestBuilder(Pet pet) throws ApiException {
|
||||
// verify the required parameter 'pet' is set
|
||||
if (pet == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/pet";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Content-Type", "application/json");
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(pet);
|
||||
localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* @param petId ID of pet that needs to be updated (required)
|
||||
* @param name Updated name of the pet (optional)
|
||||
* @param status Updated status of the pet (optional)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void updatePetWithForm(Long petId, String name, String status) throws ApiException {
|
||||
updatePetWithFormWithHttpInfo(petId, name, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* @param petId ID of pet that needs to be updated (required)
|
||||
* @param name Updated name of the pet (optional)
|
||||
* @param status Updated status of the pet (optional)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = updatePetWithFormRequestBuilder(petId, name, status);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"updatePetWithForm call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder updatePetWithFormRequestBuilder(Long petId, String name, String status) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/pet/{petId}"
|
||||
.replace("{petId}", ApiClient.urlEncode(petId.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @return ModelApiResponse
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
ApiResponse<ModelApiResponse> localVarResponse = uploadFileWithHttpInfo(petId, additionalMetadata, file);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @param file file to upload (optional)
|
||||
* @return ApiResponse<ModelApiResponse>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<ModelApiResponse> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = uploadFileRequestBuilder(petId, additionalMetadata, file);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"uploadFile call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<ModelApiResponse>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<ModelApiResponse>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder uploadFileRequestBuilder(Long petId, String additionalMetadata, File file) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/pet/{petId}/uploadImage"
|
||||
.replace("{petId}", ApiClient.urlEncode(petId.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* uploads an image (required)
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param requiredFile file to upload (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @return ModelApiResponse
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException {
|
||||
ApiResponse<ModelApiResponse> localVarResponse = uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* uploads an image (required)
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param requiredFile file to upload (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
* @return ApiResponse<ModelApiResponse>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<ModelApiResponse> uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = uploadFileWithRequiredFileRequestBuilder(petId, requiredFile, additionalMetadata);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"uploadFileWithRequiredFile call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<ModelApiResponse>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<ModelApiResponse>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder uploadFileWithRequiredFileRequestBuilder(Long petId, File requiredFile, String additionalMetadata) throws ApiException {
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile");
|
||||
}
|
||||
// verify the required parameter 'requiredFile' is set
|
||||
if (requiredFile == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile"
|
||||
.replace("{petId}", ApiClient.urlEncode(petId.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,345 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
import org.openapitools.client.model.Order;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.time.Duration;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class StoreApi {
|
||||
private final HttpClient memberVarHttpClient;
|
||||
private final ObjectMapper memberVarObjectMapper;
|
||||
private final String memberVarBaseUri;
|
||||
private final Consumer<HttpRequest.Builder> memberVarInterceptor;
|
||||
private final Duration memberVarReadTimeout;
|
||||
private final Consumer<HttpResponse<InputStream>> memberVarResponseInterceptor;
|
||||
|
||||
public StoreApi() {
|
||||
this(new ApiClient());
|
||||
}
|
||||
|
||||
public StoreApi(ApiClient apiClient) {
|
||||
memberVarHttpClient = apiClient.getHttpClient();
|
||||
memberVarObjectMapper = apiClient.getObjectMapper();
|
||||
memberVarBaseUri = apiClient.getBaseUri();
|
||||
memberVarInterceptor = apiClient.getRequestInterceptor();
|
||||
memberVarReadTimeout = apiClient.getReadTimeout();
|
||||
memberVarResponseInterceptor = apiClient.getResponseInterceptor();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param orderId ID of the order that needs to be deleted (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void deleteOrder(String orderId) throws ApiException {
|
||||
deleteOrderWithHttpInfo(orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param orderId ID of the order that needs to be deleted (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> deleteOrderWithHttpInfo(String orderId) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = deleteOrderRequestBuilder(orderId);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"deleteOrder call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder deleteOrderRequestBuilder(String orderId) throws ApiException {
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/store/order/{order_id}"
|
||||
.replace("{order_id}", ApiClient.urlEncode(orderId.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Returns pet inventories by status
|
||||
* Returns a map of status codes to quantities
|
||||
* @return Map<String, Integer>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Map<String, Integer> getInventory() throws ApiException {
|
||||
ApiResponse<Map<String, Integer>> localVarResponse = getInventoryWithHttpInfo();
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns pet inventories by status
|
||||
* Returns a map of status codes to quantities
|
||||
* @return ApiResponse<Map<String, Integer>>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Map<String, Integer>> getInventoryWithHttpInfo() throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = getInventoryRequestBuilder();
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"getInventory call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Map<String, Integer>>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Map<String, Integer>>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder getInventoryRequestBuilder() throws ApiException {
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/store/inventory";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* @param orderId ID of pet that needs to be fetched (required)
|
||||
* @return Order
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Order getOrderById(Long orderId) throws ApiException {
|
||||
ApiResponse<Order> localVarResponse = getOrderByIdWithHttpInfo(orderId);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* @param orderId ID of pet that needs to be fetched (required)
|
||||
* @return ApiResponse<Order>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Order> getOrderByIdWithHttpInfo(Long orderId) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = getOrderByIdRequestBuilder(orderId);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"getOrderById call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Order>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Order>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder getOrderByIdRequestBuilder(Long orderId) throws ApiException {
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/store/order/{order_id}"
|
||||
.replace("{order_id}", ApiClient.urlEncode(orderId.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param order order placed for purchasing the pet (required)
|
||||
* @return Order
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public Order placeOrder(Order order) throws ApiException {
|
||||
ApiResponse<Order> localVarResponse = placeOrderWithHttpInfo(order);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param order order placed for purchasing the pet (required)
|
||||
* @return ApiResponse<Order>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Order> placeOrderWithHttpInfo(Order order) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = placeOrderRequestBuilder(order);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"placeOrder call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Order>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<Order>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder placeOrderRequestBuilder(Order order) throws ApiException {
|
||||
// verify the required parameter 'order' is set
|
||||
if (order == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/store/order";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Content-Type", "application/json");
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(order);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,660 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.ApiResponse;
|
||||
import org.openapitools.client.Pair;
|
||||
|
||||
import org.openapitools.client.model.User;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.time.Duration;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class UserApi {
|
||||
private final HttpClient memberVarHttpClient;
|
||||
private final ObjectMapper memberVarObjectMapper;
|
||||
private final String memberVarBaseUri;
|
||||
private final Consumer<HttpRequest.Builder> memberVarInterceptor;
|
||||
private final Duration memberVarReadTimeout;
|
||||
private final Consumer<HttpResponse<InputStream>> memberVarResponseInterceptor;
|
||||
|
||||
public UserApi() {
|
||||
this(new ApiClient());
|
||||
}
|
||||
|
||||
public UserApi(ApiClient apiClient) {
|
||||
memberVarHttpClient = apiClient.getHttpClient();
|
||||
memberVarObjectMapper = apiClient.getObjectMapper();
|
||||
memberVarBaseUri = apiClient.getBaseUri();
|
||||
memberVarInterceptor = apiClient.getRequestInterceptor();
|
||||
memberVarReadTimeout = apiClient.getReadTimeout();
|
||||
memberVarResponseInterceptor = apiClient.getResponseInterceptor();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
* @param user Created user object (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void createUser(User user) throws ApiException {
|
||||
createUserWithHttpInfo(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
* @param user Created user object (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> createUserWithHttpInfo(User user) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = createUserRequestBuilder(user);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"createUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder createUserRequestBuilder(User user) throws ApiException {
|
||||
// verify the required parameter 'user' is set
|
||||
if (user == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'user' when calling createUser");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/user";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Content-Type", "application/json");
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param user List of user object (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void createUsersWithArrayInput(List<User> user) throws ApiException {
|
||||
createUsersWithArrayInputWithHttpInfo(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param user List of user object (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> createUsersWithArrayInputWithHttpInfo(List<User> user) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = createUsersWithArrayInputRequestBuilder(user);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"createUsersWithArrayInput call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder createUsersWithArrayInputRequestBuilder(List<User> user) throws ApiException {
|
||||
// verify the required parameter 'user' is set
|
||||
if (user == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/user/createWithArray";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Content-Type", "application/json");
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param user List of user object (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void createUsersWithListInput(List<User> user) throws ApiException {
|
||||
createUsersWithListInputWithHttpInfo(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param user List of user object (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> createUsersWithListInputWithHttpInfo(List<User> user) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = createUsersWithListInputRequestBuilder(user);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"createUsersWithListInput call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder createUsersWithListInputRequestBuilder(List<User> user) throws ApiException {
|
||||
// verify the required parameter 'user' is set
|
||||
if (user == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/user/createWithList";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Content-Type", "application/json");
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user);
|
||||
localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username The name that needs to be deleted (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void deleteUser(String username) throws ApiException {
|
||||
deleteUserWithHttpInfo(username);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username The name that needs to be deleted (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> deleteUserWithHttpInfo(String username) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = deleteUserRequestBuilder(username);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"deleteUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder deleteUserRequestBuilder(String username) throws ApiException {
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/user/{username}"
|
||||
.replace("{username}", ApiClient.urlEncode(username.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @return User
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public User getUserByName(String username) throws ApiException {
|
||||
ApiResponse<User> localVarResponse = getUserByNameWithHttpInfo(username);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @return ApiResponse<User>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<User> getUserByNameWithHttpInfo(String username) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = getUserByNameRequestBuilder(username);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"getUserByName call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<User>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<User>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder getUserByNameRequestBuilder(String username) throws ApiException {
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/user/{username}"
|
||||
.replace("{username}", ApiClient.urlEncode(username.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
* @param username The user name for login (required)
|
||||
* @param password The password for login in clear text (required)
|
||||
* @return String
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public String loginUser(String username, String password) throws ApiException {
|
||||
ApiResponse<String> localVarResponse = loginUserWithHttpInfo(username, password);
|
||||
return localVarResponse.getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
* @param username The user name for login (required)
|
||||
* @param password The password for login in clear text (required)
|
||||
* @return ApiResponse<String>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<String> loginUserWithHttpInfo(String username, String password) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = loginUserRequestBuilder(username, password);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"loginUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<String>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<String>() {})
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder loginUserRequestBuilder(String username, String password) throws ApiException {
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser");
|
||||
}
|
||||
// verify the required parameter 'password' is set
|
||||
if (password == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/user/login";
|
||||
|
||||
List<Pair> localVarQueryParams = new ArrayList<>();
|
||||
localVarQueryParams.addAll(ApiClient.parameterToPairs("username", username));
|
||||
localVarQueryParams.addAll(ApiClient.parameterToPairs("password", password));
|
||||
|
||||
if (!localVarQueryParams.isEmpty()) {
|
||||
StringJoiner queryJoiner = new StringJoiner("&");
|
||||
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
|
||||
} else {
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
}
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void logoutUser() throws ApiException {
|
||||
logoutUserWithHttpInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> logoutUserWithHttpInfo() throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = logoutUserRequestBuilder();
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"logoutUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder logoutUserRequestBuilder() throws ApiException {
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/user/logout";
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
/**
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username name that need to be deleted (required)
|
||||
* @param user Updated user object (required)
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public void updateUser(String username, User user) throws ApiException {
|
||||
updateUserWithHttpInfo(username, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username name that need to be deleted (required)
|
||||
* @param user Updated user object (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException if fails to make API call
|
||||
*/
|
||||
public ApiResponse<Void> updateUserWithHttpInfo(String username, User user) throws ApiException {
|
||||
HttpRequest.Builder localVarRequestBuilder = updateUserRequestBuilder(username, user);
|
||||
try {
|
||||
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
|
||||
localVarRequestBuilder.build(),
|
||||
HttpResponse.BodyHandlers.ofInputStream());
|
||||
if (memberVarResponseInterceptor != null) {
|
||||
memberVarResponseInterceptor.accept(localVarResponse);
|
||||
}
|
||||
if (localVarResponse.statusCode()/ 100 != 2) {
|
||||
throw new ApiException(localVarResponse.statusCode(),
|
||||
"updateUser call received non-success response",
|
||||
localVarResponse.headers(),
|
||||
localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes()));
|
||||
}
|
||||
return new ApiResponse<Void>(
|
||||
localVarResponse.statusCode(),
|
||||
localVarResponse.headers().map(),
|
||||
null
|
||||
);
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new ApiException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpRequest.Builder updateUserRequestBuilder(String username, User user) throws ApiException {
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser");
|
||||
}
|
||||
// verify the required parameter 'user' is set
|
||||
if (user == null) {
|
||||
throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser");
|
||||
}
|
||||
|
||||
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
|
||||
|
||||
String localVarPath = "/user/{username}"
|
||||
.replace("{username}", ApiClient.urlEncode(username.toString()));
|
||||
|
||||
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
|
||||
|
||||
localVarRequestBuilder.header("Content-Type", "application/json");
|
||||
localVarRequestBuilder.header("Accept", "application/json");
|
||||
|
||||
try {
|
||||
byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user);
|
||||
localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));
|
||||
} catch (IOException e) {
|
||||
throw new ApiException(e);
|
||||
}
|
||||
if (memberVarReadTimeout != null) {
|
||||
localVarRequestBuilder.timeout(memberVarReadTimeout);
|
||||
}
|
||||
if (memberVarInterceptor != null) {
|
||||
memberVarInterceptor.accept(localVarRequestBuilder);
|
||||
}
|
||||
return localVarRequestBuilder;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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.openapitools.client.ApiException;
|
||||
import java.util.Objects;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.core.GenericType;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
/**
|
||||
* Abstract class for oneOf,anyOf schemas defined in OpenAPI spec
|
||||
*/
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public abstract class AbstractOpenApiSchema {
|
||||
|
||||
// store the actual instance of the schema/object
|
||||
private Object instance;
|
||||
|
||||
// is nullable
|
||||
private Boolean isNullable;
|
||||
|
||||
// schema type (e.g. oneOf, anyOf)
|
||||
private final String schemaType;
|
||||
|
||||
public AbstractOpenApiSchema(String schemaType, Boolean isNullable) {
|
||||
this.schemaType = schemaType;
|
||||
this.isNullable = isNullable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of oneOf/anyOf composed schemas allowed to be stored in this object
|
||||
*
|
||||
* @return an instance of the actual schema/object
|
||||
*/
|
||||
public abstract Map<String, GenericType> getSchemas();
|
||||
|
||||
/**
|
||||
* Get the actual instance
|
||||
*
|
||||
* @return an instance of the actual schema/object
|
||||
*/
|
||||
@JsonValue
|
||||
public Object getActualInstance() {return instance;}
|
||||
|
||||
/**
|
||||
* Set the actual instance
|
||||
*
|
||||
* @param instance the actual instance of the schema/object
|
||||
*/
|
||||
public void setActualInstance(Object instance) {this.instance = instance;}
|
||||
|
||||
/**
|
||||
* Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well
|
||||
*
|
||||
* @return an instance of the actual schema/object
|
||||
*/
|
||||
public Object getActualInstanceRecursively() {
|
||||
return getActualInstanceRecursively(this);
|
||||
}
|
||||
|
||||
private Object getActualInstanceRecursively(AbstractOpenApiSchema object) {
|
||||
if (object.getActualInstance() == null) {
|
||||
return null;
|
||||
} else if (object.getActualInstance() instanceof AbstractOpenApiSchema) {
|
||||
return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance());
|
||||
} else {
|
||||
return object.getActualInstance();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the schema type (e.g. anyOf, oneOf)
|
||||
*
|
||||
* @return the schema type
|
||||
*/
|
||||
public String getSchemaType() {
|
||||
return schemaType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ").append(getClass()).append(" {\n");
|
||||
sb.append(" instance: ").append(toIndentedString(instance)).append("\n");
|
||||
sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n");
|
||||
sb.append(" schemaType: ").append(toIndentedString(schemaType)).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 ");
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
AbstractOpenApiSchema a = (AbstractOpenApiSchema) o;
|
||||
return Objects.equals(this.instance, a.instance) &&
|
||||
Objects.equals(this.isNullable, a.isNullable) &&
|
||||
Objects.equals(this.schemaType, a.schemaType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(instance, isNullable, schemaType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Is nullalble
|
||||
*
|
||||
* @return true if it's nullable
|
||||
*/
|
||||
public Boolean isNullable() {
|
||||
if (Boolean.TRUE.equals(isNullable)) {
|
||||
return Boolean.TRUE;
|
||||
} else {
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,334 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import java.util.NoSuchElementException;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* AdditionalPropertiesClass
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
AdditionalPropertiesClass.JSON_PROPERTY_MAP_PROPERTY,
|
||||
AdditionalPropertiesClass.JSON_PROPERTY_MAP_OF_MAP_PROPERTY,
|
||||
AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1,
|
||||
AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1,
|
||||
AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2,
|
||||
AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3,
|
||||
AdditionalPropertiesClass.JSON_PROPERTY_EMPTY_MAP,
|
||||
AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class AdditionalPropertiesClass {
|
||||
public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property";
|
||||
private Map<String, String> mapProperty = null;
|
||||
|
||||
public static final String JSON_PROPERTY_MAP_OF_MAP_PROPERTY = "map_of_map_property";
|
||||
private Map<String, Map<String, String>> mapOfMapProperty = null;
|
||||
|
||||
public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1";
|
||||
private JsonNullable<Object> anytype1 = JsonNullable.<Object>of(null);
|
||||
|
||||
public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1 = "map_with_undeclared_properties_anytype_1";
|
||||
private Object mapWithUndeclaredPropertiesAnytype1;
|
||||
|
||||
public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2 = "map_with_undeclared_properties_anytype_2";
|
||||
private Object mapWithUndeclaredPropertiesAnytype2;
|
||||
|
||||
public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3 = "map_with_undeclared_properties_anytype_3";
|
||||
private Map<String, Object> mapWithUndeclaredPropertiesAnytype3 = null;
|
||||
|
||||
public static final String JSON_PROPERTY_EMPTY_MAP = "empty_map";
|
||||
private Object emptyMap;
|
||||
|
||||
public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING = "map_with_undeclared_properties_string";
|
||||
private Map<String, String> mapWithUndeclaredPropertiesString = null;
|
||||
|
||||
|
||||
public AdditionalPropertiesClass mapProperty(Map<String, String> mapProperty) {
|
||||
this.mapProperty = mapProperty;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mapProperty
|
||||
* @return mapProperty
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_MAP_PROPERTY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Map<String, String> getMapProperty() {
|
||||
return mapProperty;
|
||||
}
|
||||
|
||||
|
||||
public void setMapProperty(Map<String, String> mapProperty) {
|
||||
this.mapProperty = mapProperty;
|
||||
}
|
||||
|
||||
|
||||
public AdditionalPropertiesClass mapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
|
||||
this.mapOfMapProperty = mapOfMapProperty;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mapOfMapProperty
|
||||
* @return mapOfMapProperty
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Map<String, Map<String, String>> getMapOfMapProperty() {
|
||||
return mapOfMapProperty;
|
||||
}
|
||||
|
||||
|
||||
public void setMapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
|
||||
this.mapOfMapProperty = mapOfMapProperty;
|
||||
}
|
||||
|
||||
|
||||
public AdditionalPropertiesClass anytype1(Object anytype1) {
|
||||
this.anytype1 = JsonNullable.<Object>of(anytype1);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get anytype1
|
||||
* @return anytype1
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonIgnore
|
||||
|
||||
public Object getAnytype1() {
|
||||
return anytype1.orElse(null);
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_ANYTYPE1)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public JsonNullable<Object> getAnytype1_JsonNullable() {
|
||||
return anytype1;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_ANYTYPE1)
|
||||
public void setAnytype1_JsonNullable(JsonNullable<Object> anytype1) {
|
||||
this.anytype1 = anytype1;
|
||||
}
|
||||
|
||||
public void setAnytype1(Object anytype1) {
|
||||
this.anytype1 = JsonNullable.<Object>of(anytype1);
|
||||
}
|
||||
|
||||
|
||||
public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype1(Object mapWithUndeclaredPropertiesAnytype1) {
|
||||
this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mapWithUndeclaredPropertiesAnytype1
|
||||
* @return mapWithUndeclaredPropertiesAnytype1
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Object getMapWithUndeclaredPropertiesAnytype1() {
|
||||
return mapWithUndeclaredPropertiesAnytype1;
|
||||
}
|
||||
|
||||
|
||||
public void setMapWithUndeclaredPropertiesAnytype1(Object mapWithUndeclaredPropertiesAnytype1) {
|
||||
this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1;
|
||||
}
|
||||
|
||||
|
||||
public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype2(Object mapWithUndeclaredPropertiesAnytype2) {
|
||||
this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mapWithUndeclaredPropertiesAnytype2
|
||||
* @return mapWithUndeclaredPropertiesAnytype2
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Object getMapWithUndeclaredPropertiesAnytype2() {
|
||||
return mapWithUndeclaredPropertiesAnytype2;
|
||||
}
|
||||
|
||||
|
||||
public void setMapWithUndeclaredPropertiesAnytype2(Object mapWithUndeclaredPropertiesAnytype2) {
|
||||
this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2;
|
||||
}
|
||||
|
||||
|
||||
public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype3(Map<String, Object> mapWithUndeclaredPropertiesAnytype3) {
|
||||
this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mapWithUndeclaredPropertiesAnytype3
|
||||
* @return mapWithUndeclaredPropertiesAnytype3
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3)
|
||||
@JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Map<String, Object> getMapWithUndeclaredPropertiesAnytype3() {
|
||||
return mapWithUndeclaredPropertiesAnytype3;
|
||||
}
|
||||
|
||||
|
||||
public void setMapWithUndeclaredPropertiesAnytype3(Map<String, Object> mapWithUndeclaredPropertiesAnytype3) {
|
||||
this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3;
|
||||
}
|
||||
|
||||
|
||||
public AdditionalPropertiesClass emptyMap(Object emptyMap) {
|
||||
this.emptyMap = emptyMap;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* an object with no declared properties and no undeclared properties, hence it's an empty map.
|
||||
* @return emptyMap
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "an object with no declared properties and no undeclared properties, hence it's an empty map.")
|
||||
@JsonProperty(JSON_PROPERTY_EMPTY_MAP)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Object getEmptyMap() {
|
||||
return emptyMap;
|
||||
}
|
||||
|
||||
|
||||
public void setEmptyMap(Object emptyMap) {
|
||||
this.emptyMap = emptyMap;
|
||||
}
|
||||
|
||||
|
||||
public AdditionalPropertiesClass mapWithUndeclaredPropertiesString(Map<String, String> mapWithUndeclaredPropertiesString) {
|
||||
this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mapWithUndeclaredPropertiesString
|
||||
* @return mapWithUndeclaredPropertiesString
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Map<String, String> getMapWithUndeclaredPropertiesString() {
|
||||
return mapWithUndeclaredPropertiesString;
|
||||
}
|
||||
|
||||
|
||||
public void setMapWithUndeclaredPropertiesString(Map<String, String> mapWithUndeclaredPropertiesString) {
|
||||
this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this AdditionalPropertiesClass object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o;
|
||||
return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) &&
|
||||
Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty) &&
|
||||
Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) &&
|
||||
Objects.equals(this.mapWithUndeclaredPropertiesAnytype1, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype1) &&
|
||||
Objects.equals(this.mapWithUndeclaredPropertiesAnytype2, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype2) &&
|
||||
Objects.equals(this.mapWithUndeclaredPropertiesAnytype3, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype3) &&
|
||||
Objects.equals(this.emptyMap, additionalPropertiesClass.emptyMap) &&
|
||||
Objects.equals(this.mapWithUndeclaredPropertiesString, additionalPropertiesClass.mapWithUndeclaredPropertiesString);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(mapProperty, mapOfMapProperty, anytype1, mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, emptyMap, mapWithUndeclaredPropertiesString);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class AdditionalPropertiesClass {\n");
|
||||
sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n");
|
||||
sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n");
|
||||
sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n");
|
||||
sb.append(" mapWithUndeclaredPropertiesAnytype1: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype1)).append("\n");
|
||||
sb.append(" mapWithUndeclaredPropertiesAnytype2: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype2)).append("\n");
|
||||
sb.append(" mapWithUndeclaredPropertiesAnytype3: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype3)).append("\n");
|
||||
sb.append(" emptyMap: ").append(toIndentedString(emptyMap)).append("\n");
|
||||
sb.append(" mapWithUndeclaredPropertiesString: ").append(toIndentedString(mapWithUndeclaredPropertiesString)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.Cat;
|
||||
import org.openapitools.client.model.Dog;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Animal
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
Animal.JSON_PROPERTY_CLASS_NAME,
|
||||
Animal.JSON_PROPERTY_COLOR
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true)
|
||||
@JsonSubTypes({
|
||||
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
|
||||
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
|
||||
})
|
||||
|
||||
public class Animal {
|
||||
public static final String JSON_PROPERTY_CLASS_NAME = "className";
|
||||
private String className;
|
||||
|
||||
public static final String JSON_PROPERTY_COLOR = "color";
|
||||
private String color = "red";
|
||||
|
||||
|
||||
public Animal className(String className) {
|
||||
this.className = className;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get className
|
||||
* @return className
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_CLASS_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
|
||||
public void setClassName(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
|
||||
public Animal color(String color) {
|
||||
this.color = color;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_COLOR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this Animal object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Animal animal = (Animal) o;
|
||||
return Objects.equals(this.className, animal.className) &&
|
||||
Objects.equals(this.color, animal.color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(className, color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Animal {\n");
|
||||
sb.append(" className: ").append(toIndentedString(className)).append("\n");
|
||||
sb.append(" color: ").append(toIndentedString(color)).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 ");
|
||||
}
|
||||
|
||||
static {
|
||||
// Initialize and register the discriminator mappings.
|
||||
Map<String, Class<?>> mappings = new HashMap<String, Class<?>>();
|
||||
mappings.put("Cat", Cat.class);
|
||||
mappings.put("Dog", Dog.class);
|
||||
mappings.put("Animal", Animal.class);
|
||||
JSON.registerDiscriminator(Animal.class, "className", mappings);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Apple
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
Apple.JSON_PROPERTY_CULTIVAR,
|
||||
Apple.JSON_PROPERTY_ORIGIN
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Apple {
|
||||
public static final String JSON_PROPERTY_CULTIVAR = "cultivar";
|
||||
private String cultivar;
|
||||
|
||||
public static final String JSON_PROPERTY_ORIGIN = "origin";
|
||||
private String origin;
|
||||
|
||||
|
||||
public Apple cultivar(String cultivar) {
|
||||
this.cultivar = cultivar;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cultivar
|
||||
* @return cultivar
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_CULTIVAR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getCultivar() {
|
||||
return cultivar;
|
||||
}
|
||||
|
||||
|
||||
public void setCultivar(String cultivar) {
|
||||
this.cultivar = cultivar;
|
||||
}
|
||||
|
||||
|
||||
public Apple origin(String origin) {
|
||||
this.origin = origin;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get origin
|
||||
* @return origin
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_ORIGIN)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getOrigin() {
|
||||
return origin;
|
||||
}
|
||||
|
||||
|
||||
public void setOrigin(String origin) {
|
||||
this.origin = origin;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this apple object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Apple apple = (Apple) o;
|
||||
return Objects.equals(this.cultivar, apple.cultivar) &&
|
||||
Objects.equals(this.origin, apple.origin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(cultivar, origin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Apple {\n");
|
||||
sb.append(" cultivar: ").append(toIndentedString(cultivar)).append("\n");
|
||||
sb.append(" origin: ").append(toIndentedString(origin)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* AppleReq
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
AppleReq.JSON_PROPERTY_CULTIVAR,
|
||||
AppleReq.JSON_PROPERTY_MEALY
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class AppleReq {
|
||||
public static final String JSON_PROPERTY_CULTIVAR = "cultivar";
|
||||
private String cultivar;
|
||||
|
||||
public static final String JSON_PROPERTY_MEALY = "mealy";
|
||||
private Boolean mealy;
|
||||
|
||||
|
||||
public AppleReq cultivar(String cultivar) {
|
||||
this.cultivar = cultivar;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cultivar
|
||||
* @return cultivar
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_CULTIVAR)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getCultivar() {
|
||||
return cultivar;
|
||||
}
|
||||
|
||||
|
||||
public void setCultivar(String cultivar) {
|
||||
this.cultivar = cultivar;
|
||||
}
|
||||
|
||||
|
||||
public AppleReq mealy(Boolean mealy) {
|
||||
this.mealy = mealy;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mealy
|
||||
* @return mealy
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_MEALY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Boolean getMealy() {
|
||||
return mealy;
|
||||
}
|
||||
|
||||
|
||||
public void setMealy(Boolean mealy) {
|
||||
this.mealy = mealy;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this appleReq object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
AppleReq appleReq = (AppleReq) o;
|
||||
return Objects.equals(this.cultivar, appleReq.cultivar) &&
|
||||
Objects.equals(this.mealy, appleReq.mealy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(cultivar, mealy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class AppleReq {\n");
|
||||
sb.append(" cultivar: ").append(toIndentedString(cultivar)).append("\n");
|
||||
sb.append(" mealy: ").append(toIndentedString(mealy)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* ArrayOfArrayOfNumberOnly
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber";
|
||||
private List<List<BigDecimal>> arrayArrayNumber = null;
|
||||
|
||||
|
||||
public ArrayOfArrayOfNumberOnly arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
|
||||
this.arrayArrayNumber = arrayArrayNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
|
||||
if (this.arrayArrayNumber == null) {
|
||||
this.arrayArrayNumber = new ArrayList<>();
|
||||
}
|
||||
this.arrayArrayNumber.add(arrayArrayNumberItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayArrayNumber
|
||||
* @return arrayArrayNumber
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<List<BigDecimal>> getArrayArrayNumber() {
|
||||
return arrayArrayNumber;
|
||||
}
|
||||
|
||||
|
||||
public void setArrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
|
||||
this.arrayArrayNumber = arrayArrayNumber;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this ArrayOfArrayOfNumberOnly object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o;
|
||||
return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(arrayArrayNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ArrayOfArrayOfNumberOnly {\n");
|
||||
sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* ArrayOfNumberOnly
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber";
|
||||
private List<BigDecimal> arrayNumber = null;
|
||||
|
||||
|
||||
public ArrayOfNumberOnly arrayNumber(List<BigDecimal> arrayNumber) {
|
||||
this.arrayNumber = arrayNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
|
||||
if (this.arrayNumber == null) {
|
||||
this.arrayNumber = new ArrayList<>();
|
||||
}
|
||||
this.arrayNumber.add(arrayNumberItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayNumber
|
||||
* @return arrayNumber
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_NUMBER)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<BigDecimal> getArrayNumber() {
|
||||
return arrayNumber;
|
||||
}
|
||||
|
||||
|
||||
public void setArrayNumber(List<BigDecimal> arrayNumber) {
|
||||
this.arrayNumber = arrayNumber;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this ArrayOfNumberOnly object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o;
|
||||
return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(arrayNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ArrayOfNumberOnly {\n");
|
||||
sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,195 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.client.model.ReadOnlyFirst;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* ArrayTest
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING,
|
||||
ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER,
|
||||
ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ArrayTest {
|
||||
public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string";
|
||||
private List<String> arrayOfString = null;
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
|
||||
private List<List<Long>> arrayArrayOfInteger = null;
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = null;
|
||||
|
||||
|
||||
public ArrayTest arrayOfString(List<String> arrayOfString) {
|
||||
this.arrayOfString = arrayOfString;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
|
||||
if (this.arrayOfString == null) {
|
||||
this.arrayOfString = new ArrayList<>();
|
||||
}
|
||||
this.arrayOfString.add(arrayOfStringItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayOfString
|
||||
* @return arrayOfString
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<String> getArrayOfString() {
|
||||
return arrayOfString;
|
||||
}
|
||||
|
||||
|
||||
public void setArrayOfString(List<String> arrayOfString) {
|
||||
this.arrayOfString = arrayOfString;
|
||||
}
|
||||
|
||||
|
||||
public ArrayTest arrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
|
||||
this.arrayArrayOfInteger = arrayArrayOfInteger;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
|
||||
if (this.arrayArrayOfInteger == null) {
|
||||
this.arrayArrayOfInteger = new ArrayList<>();
|
||||
}
|
||||
this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayArrayOfInteger
|
||||
* @return arrayArrayOfInteger
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<List<Long>> getArrayArrayOfInteger() {
|
||||
return arrayArrayOfInteger;
|
||||
}
|
||||
|
||||
|
||||
public void setArrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
|
||||
this.arrayArrayOfInteger = arrayArrayOfInteger;
|
||||
}
|
||||
|
||||
|
||||
public ArrayTest arrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
|
||||
this.arrayArrayOfModel = arrayArrayOfModel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
|
||||
if (this.arrayArrayOfModel == null) {
|
||||
this.arrayArrayOfModel = new ArrayList<>();
|
||||
}
|
||||
this.arrayArrayOfModel.add(arrayArrayOfModelItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayArrayOfModel
|
||||
* @return arrayArrayOfModel
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
|
||||
return arrayArrayOfModel;
|
||||
}
|
||||
|
||||
|
||||
public void setArrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
|
||||
this.arrayArrayOfModel = arrayArrayOfModel;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this ArrayTest object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ArrayTest arrayTest = (ArrayTest) o;
|
||||
return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) &&
|
||||
Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) &&
|
||||
Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ArrayTest {\n");
|
||||
sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n");
|
||||
sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n");
|
||||
sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Banana
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
Banana.JSON_PROPERTY_LENGTH_CM
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Banana {
|
||||
public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm";
|
||||
private BigDecimal lengthCm;
|
||||
|
||||
|
||||
public Banana lengthCm(BigDecimal lengthCm) {
|
||||
this.lengthCm = lengthCm;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get lengthCm
|
||||
* @return lengthCm
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_LENGTH_CM)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public BigDecimal getLengthCm() {
|
||||
return lengthCm;
|
||||
}
|
||||
|
||||
|
||||
public void setLengthCm(BigDecimal lengthCm) {
|
||||
this.lengthCm = lengthCm;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this banana object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Banana banana = (Banana) o;
|
||||
return Objects.equals(this.lengthCm, banana.lengthCm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(lengthCm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Banana {\n");
|
||||
sb.append(" lengthCm: ").append(toIndentedString(lengthCm)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* BananaReq
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
BananaReq.JSON_PROPERTY_LENGTH_CM,
|
||||
BananaReq.JSON_PROPERTY_SWEET
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class BananaReq {
|
||||
public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm";
|
||||
private BigDecimal lengthCm;
|
||||
|
||||
public static final String JSON_PROPERTY_SWEET = "sweet";
|
||||
private Boolean sweet;
|
||||
|
||||
|
||||
public BananaReq lengthCm(BigDecimal lengthCm) {
|
||||
this.lengthCm = lengthCm;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get lengthCm
|
||||
* @return lengthCm
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_LENGTH_CM)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public BigDecimal getLengthCm() {
|
||||
return lengthCm;
|
||||
}
|
||||
|
||||
|
||||
public void setLengthCm(BigDecimal lengthCm) {
|
||||
this.lengthCm = lengthCm;
|
||||
}
|
||||
|
||||
|
||||
public BananaReq sweet(Boolean sweet) {
|
||||
this.sweet = sweet;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sweet
|
||||
* @return sweet
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_SWEET)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Boolean getSweet() {
|
||||
return sweet;
|
||||
}
|
||||
|
||||
|
||||
public void setSweet(Boolean sweet) {
|
||||
this.sweet = sweet;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this bananaReq object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
BananaReq bananaReq = (BananaReq) o;
|
||||
return Objects.equals(this.lengthCm, bananaReq.lengthCm) &&
|
||||
Objects.equals(this.sweet, bananaReq.sweet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(lengthCm, sweet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class BananaReq {\n");
|
||||
sb.append(" lengthCm: ").append(toIndentedString(lengthCm)).append("\n");
|
||||
sb.append(" sweet: ").append(toIndentedString(sweet)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* BasquePig
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
BasquePig.JSON_PROPERTY_CLASS_NAME
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class BasquePig {
|
||||
public static final String JSON_PROPERTY_CLASS_NAME = "className";
|
||||
private String className;
|
||||
|
||||
|
||||
public BasquePig className(String className) {
|
||||
this.className = className;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get className
|
||||
* @return className
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_CLASS_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
|
||||
public void setClassName(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this BasquePig object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
BasquePig basquePig = (BasquePig) o;
|
||||
return Objects.equals(this.className, basquePig.className);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(className);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class BasquePig {\n");
|
||||
sb.append(" className: ").append(toIndentedString(className)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,258 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Capitalization
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
Capitalization.JSON_PROPERTY_SMALL_CAMEL,
|
||||
Capitalization.JSON_PROPERTY_CAPITAL_CAMEL,
|
||||
Capitalization.JSON_PROPERTY_SMALL_SNAKE,
|
||||
Capitalization.JSON_PROPERTY_CAPITAL_SNAKE,
|
||||
Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS,
|
||||
Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Capitalization {
|
||||
public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel";
|
||||
private String smallCamel;
|
||||
|
||||
public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel";
|
||||
private String capitalCamel;
|
||||
|
||||
public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake";
|
||||
private String smallSnake;
|
||||
|
||||
public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake";
|
||||
private String capitalSnake;
|
||||
|
||||
public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points";
|
||||
private String scAETHFlowPoints;
|
||||
|
||||
public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME";
|
||||
private String ATT_NAME;
|
||||
|
||||
|
||||
public Capitalization smallCamel(String smallCamel) {
|
||||
this.smallCamel = smallCamel;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get smallCamel
|
||||
* @return smallCamel
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_SMALL_CAMEL)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSmallCamel() {
|
||||
return smallCamel;
|
||||
}
|
||||
|
||||
|
||||
public void setSmallCamel(String smallCamel) {
|
||||
this.smallCamel = smallCamel;
|
||||
}
|
||||
|
||||
|
||||
public Capitalization capitalCamel(String capitalCamel) {
|
||||
this.capitalCamel = capitalCamel;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get capitalCamel
|
||||
* @return capitalCamel
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getCapitalCamel() {
|
||||
return capitalCamel;
|
||||
}
|
||||
|
||||
|
||||
public void setCapitalCamel(String capitalCamel) {
|
||||
this.capitalCamel = capitalCamel;
|
||||
}
|
||||
|
||||
|
||||
public Capitalization smallSnake(String smallSnake) {
|
||||
this.smallSnake = smallSnake;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get smallSnake
|
||||
* @return smallSnake
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_SMALL_SNAKE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSmallSnake() {
|
||||
return smallSnake;
|
||||
}
|
||||
|
||||
|
||||
public void setSmallSnake(String smallSnake) {
|
||||
this.smallSnake = smallSnake;
|
||||
}
|
||||
|
||||
|
||||
public Capitalization capitalSnake(String capitalSnake) {
|
||||
this.capitalSnake = capitalSnake;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get capitalSnake
|
||||
* @return capitalSnake
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getCapitalSnake() {
|
||||
return capitalSnake;
|
||||
}
|
||||
|
||||
|
||||
public void setCapitalSnake(String capitalSnake) {
|
||||
this.capitalSnake = capitalSnake;
|
||||
}
|
||||
|
||||
|
||||
public Capitalization scAETHFlowPoints(String scAETHFlowPoints) {
|
||||
this.scAETHFlowPoints = scAETHFlowPoints;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get scAETHFlowPoints
|
||||
* @return scAETHFlowPoints
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getScAETHFlowPoints() {
|
||||
return scAETHFlowPoints;
|
||||
}
|
||||
|
||||
|
||||
public void setScAETHFlowPoints(String scAETHFlowPoints) {
|
||||
this.scAETHFlowPoints = scAETHFlowPoints;
|
||||
}
|
||||
|
||||
|
||||
public Capitalization ATT_NAME(String ATT_NAME) {
|
||||
this.ATT_NAME = ATT_NAME;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the pet
|
||||
* @return ATT_NAME
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Name of the pet ")
|
||||
@JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getATTNAME() {
|
||||
return ATT_NAME;
|
||||
}
|
||||
|
||||
|
||||
public void setATTNAME(String ATT_NAME) {
|
||||
this.ATT_NAME = ATT_NAME;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this Capitalization object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Capitalization capitalization = (Capitalization) o;
|
||||
return Objects.equals(this.smallCamel, capitalization.smallCamel) &&
|
||||
Objects.equals(this.capitalCamel, capitalization.capitalCamel) &&
|
||||
Objects.equals(this.smallSnake, capitalization.smallSnake) &&
|
||||
Objects.equals(this.capitalSnake, capitalization.capitalSnake) &&
|
||||
Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) &&
|
||||
Objects.equals(this.ATT_NAME, capitalization.ATT_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Capitalization {\n");
|
||||
sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n");
|
||||
sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n");
|
||||
sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n");
|
||||
sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n");
|
||||
sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n");
|
||||
sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.Animal;
|
||||
import org.openapitools.client.model.CatAllOf;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Cat
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
Cat.JSON_PROPERTY_DECLAWED
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true)
|
||||
|
||||
public class Cat extends Animal {
|
||||
public static final String JSON_PROPERTY_DECLAWED = "declawed";
|
||||
private Boolean declawed;
|
||||
|
||||
|
||||
public Cat declawed(Boolean declawed) {
|
||||
this.declawed = declawed;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get declawed
|
||||
* @return declawed
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_DECLAWED)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Boolean getDeclawed() {
|
||||
return declawed;
|
||||
}
|
||||
|
||||
|
||||
public void setDeclawed(Boolean declawed) {
|
||||
this.declawed = declawed;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this Cat object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Cat cat = (Cat) o;
|
||||
return Objects.equals(this.declawed, cat.declawed) &&
|
||||
super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(declawed, super.hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Cat {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append(" declawed: ").append(toIndentedString(declawed)).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 ");
|
||||
}
|
||||
|
||||
static {
|
||||
// Initialize and register the discriminator mappings.
|
||||
Map<String, Class<?>> mappings = new HashMap<String, Class<?>>();
|
||||
mappings.put("Cat", Cat.class);
|
||||
JSON.registerDiscriminator(Cat.class, "className", mappings);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* CatAllOf
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
CatAllOf.JSON_PROPERTY_DECLAWED
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class CatAllOf {
|
||||
public static final String JSON_PROPERTY_DECLAWED = "declawed";
|
||||
private Boolean declawed;
|
||||
|
||||
|
||||
public CatAllOf declawed(Boolean declawed) {
|
||||
this.declawed = declawed;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get declawed
|
||||
* @return declawed
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_DECLAWED)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Boolean getDeclawed() {
|
||||
return declawed;
|
||||
}
|
||||
|
||||
|
||||
public void setDeclawed(Boolean declawed) {
|
||||
this.declawed = declawed;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this Cat_allOf object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
CatAllOf catAllOf = (CatAllOf) o;
|
||||
return Objects.equals(this.declawed, catAllOf.declawed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(declawed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class CatAllOf {\n");
|
||||
sb.append(" declawed: ").append(toIndentedString(declawed)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Category
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
Category.JSON_PROPERTY_ID,
|
||||
Category.JSON_PROPERTY_NAME
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Category {
|
||||
public static final String JSON_PROPERTY_ID = "id";
|
||||
private Long id;
|
||||
|
||||
public static final String JSON_PROPERTY_NAME = "name";
|
||||
private String name = "default-name";
|
||||
|
||||
|
||||
public Category id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public Category name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this Category object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Category category = (Category) o;
|
||||
return Objects.equals(this.id, category.id) &&
|
||||
Objects.equals(this.name, category.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Category {\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.ChildCatAllOf;
|
||||
import org.openapitools.client.model.ParentPet;
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* ChildCat
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ChildCat.JSON_PROPERTY_NAME,
|
||||
ChildCat.JSON_PROPERTY_PET_TYPE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "pet_type", visible = true)
|
||||
|
||||
public class ChildCat extends ParentPet {
|
||||
public static final String JSON_PROPERTY_NAME = "name";
|
||||
private String name;
|
||||
|
||||
public static final String JSON_PROPERTY_PET_TYPE = "pet_type";
|
||||
private String petType = "ChildCat";
|
||||
|
||||
|
||||
public ChildCat name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public static final Set<String> PET_TYPE_VALUES = new HashSet<>(Arrays.asList(
|
||||
"ChildCat"
|
||||
));
|
||||
|
||||
public ChildCat petType(String petType) {
|
||||
if (!PET_TYPE_VALUES.contains(petType)) {
|
||||
throw new IllegalArgumentException(petType + " is invalid. Possible values for petType: " + String.join(", ", PET_TYPE_VALUES));
|
||||
}
|
||||
|
||||
this.petType = petType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get petType
|
||||
* @return petType
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_PET_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getPetType() {
|
||||
return petType;
|
||||
}
|
||||
|
||||
|
||||
public void setPetType(String petType) {
|
||||
if (!PET_TYPE_VALUES.contains(petType)) {
|
||||
throw new IllegalArgumentException(petType + " is invalid. Possible values for petType: " + String.join(", ", PET_TYPE_VALUES));
|
||||
}
|
||||
|
||||
this.petType = petType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this ChildCat object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ChildCat childCat = (ChildCat) o;
|
||||
return Objects.equals(this.name, childCat.name) &&
|
||||
Objects.equals(this.petType, childCat.petType) &&
|
||||
super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, petType, super.hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ChildCat {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" petType: ").append(toIndentedString(petType)).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 ");
|
||||
}
|
||||
|
||||
static {
|
||||
// Initialize and register the discriminator mappings.
|
||||
Map<String, Class<?>> mappings = new HashMap<String, Class<?>>();
|
||||
mappings.put("ChildCat", ChildCat.class);
|
||||
JSON.registerDiscriminator(ChildCat.class, "pet_type", mappings);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* ChildCatAllOf
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ChildCatAllOf.JSON_PROPERTY_NAME,
|
||||
ChildCatAllOf.JSON_PROPERTY_PET_TYPE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ChildCatAllOf {
|
||||
public static final String JSON_PROPERTY_NAME = "name";
|
||||
private String name;
|
||||
|
||||
public static final String JSON_PROPERTY_PET_TYPE = "pet_type";
|
||||
private String petType = "ChildCat";
|
||||
|
||||
|
||||
public ChildCatAllOf name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public static final Set<String> PET_TYPE_VALUES = new HashSet<>(Arrays.asList(
|
||||
"ChildCat"
|
||||
));
|
||||
|
||||
public ChildCatAllOf petType(String petType) {
|
||||
if (!PET_TYPE_VALUES.contains(petType)) {
|
||||
throw new IllegalArgumentException(petType + " is invalid. Possible values for petType: " + String.join(", ", PET_TYPE_VALUES));
|
||||
}
|
||||
|
||||
this.petType = petType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get petType
|
||||
* @return petType
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_PET_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getPetType() {
|
||||
return petType;
|
||||
}
|
||||
|
||||
|
||||
public void setPetType(String petType) {
|
||||
if (!PET_TYPE_VALUES.contains(petType)) {
|
||||
throw new IllegalArgumentException(petType + " is invalid. Possible values for petType: " + String.join(", ", PET_TYPE_VALUES));
|
||||
}
|
||||
|
||||
this.petType = petType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this ChildCat_allOf object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ChildCatAllOf childCatAllOf = (ChildCatAllOf) o;
|
||||
return Objects.equals(this.name, childCatAllOf.name) &&
|
||||
Objects.equals(this.petType, childCatAllOf.petType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, petType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ChildCatAllOf {\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" petType: ").append(toIndentedString(petType)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Model for testing model with \"_class\" property
|
||||
*/
|
||||
@ApiModel(description = "Model for testing model with \"_class\" property")
|
||||
@JsonPropertyOrder({
|
||||
ClassModel.JSON_PROPERTY_PROPERTY_CLASS
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ClassModel {
|
||||
public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class";
|
||||
private String propertyClass;
|
||||
|
||||
|
||||
public ClassModel propertyClass(String propertyClass) {
|
||||
this.propertyClass = propertyClass;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get propertyClass
|
||||
* @return propertyClass
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_PROPERTY_CLASS)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getPropertyClass() {
|
||||
return propertyClass;
|
||||
}
|
||||
|
||||
|
||||
public void setPropertyClass(String propertyClass) {
|
||||
this.propertyClass = propertyClass;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this ClassModel object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ClassModel classModel = (ClassModel) o;
|
||||
return Objects.equals(this.propertyClass, classModel.propertyClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(propertyClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ClassModel {\n");
|
||||
sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Client
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
Client.JSON_PROPERTY_CLIENT
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Client {
|
||||
public static final String JSON_PROPERTY_CLIENT = "client";
|
||||
private String client;
|
||||
|
||||
|
||||
public Client client(String client) {
|
||||
this.client = client;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get client
|
||||
* @return client
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_CLIENT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
||||
|
||||
public void setClient(String client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this Client object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Client client = (Client) o;
|
||||
return Objects.equals(this.client, client.client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Client {\n");
|
||||
sb.append(" client: ").append(toIndentedString(client)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.QuadrilateralInterface;
|
||||
import org.openapitools.client.model.ShapeInterface;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* ComplexQuadrilateral
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ComplexQuadrilateral.JSON_PROPERTY_SHAPE_TYPE,
|
||||
ComplexQuadrilateral.JSON_PROPERTY_QUADRILATERAL_TYPE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ComplexQuadrilateral {
|
||||
public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType";
|
||||
private String shapeType;
|
||||
|
||||
public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType";
|
||||
private String quadrilateralType;
|
||||
|
||||
|
||||
public ComplexQuadrilateral shapeType(String shapeType) {
|
||||
this.shapeType = shapeType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get shapeType
|
||||
* @return shapeType
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_SHAPE_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getShapeType() {
|
||||
return shapeType;
|
||||
}
|
||||
|
||||
|
||||
public void setShapeType(String shapeType) {
|
||||
this.shapeType = shapeType;
|
||||
}
|
||||
|
||||
|
||||
public ComplexQuadrilateral quadrilateralType(String quadrilateralType) {
|
||||
this.quadrilateralType = quadrilateralType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get quadrilateralType
|
||||
* @return quadrilateralType
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getQuadrilateralType() {
|
||||
return quadrilateralType;
|
||||
}
|
||||
|
||||
|
||||
public void setQuadrilateralType(String quadrilateralType) {
|
||||
this.quadrilateralType = quadrilateralType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this ComplexQuadrilateral object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ComplexQuadrilateral complexQuadrilateral = (ComplexQuadrilateral) o;
|
||||
return Objects.equals(this.shapeType, complexQuadrilateral.shapeType) &&
|
||||
Objects.equals(this.quadrilateralType, complexQuadrilateral.quadrilateralType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(shapeType, quadrilateralType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ComplexQuadrilateral {\n");
|
||||
sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n");
|
||||
sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* DanishPig
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
DanishPig.JSON_PROPERTY_CLASS_NAME
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class DanishPig {
|
||||
public static final String JSON_PROPERTY_CLASS_NAME = "className";
|
||||
private String className;
|
||||
|
||||
|
||||
public DanishPig className(String className) {
|
||||
this.className = className;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get className
|
||||
* @return className
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_CLASS_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
|
||||
public void setClassName(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this DanishPig object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
DanishPig danishPig = (DanishPig) o;
|
||||
return Objects.equals(this.className, danishPig.className);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(className);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class DanishPig {\n");
|
||||
sb.append(" className: ").append(toIndentedString(className)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.Animal;
|
||||
import org.openapitools.client.model.DogAllOf;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Dog
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
Dog.JSON_PROPERTY_BREED
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true)
|
||||
|
||||
public class Dog extends Animal {
|
||||
public static final String JSON_PROPERTY_BREED = "breed";
|
||||
private String breed;
|
||||
|
||||
|
||||
public Dog breed(String breed) {
|
||||
this.breed = breed;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get breed
|
||||
* @return breed
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_BREED)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getBreed() {
|
||||
return breed;
|
||||
}
|
||||
|
||||
|
||||
public void setBreed(String breed) {
|
||||
this.breed = breed;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this Dog object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Dog dog = (Dog) o;
|
||||
return Objects.equals(this.breed, dog.breed) &&
|
||||
super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(breed, super.hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Dog {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append(" breed: ").append(toIndentedString(breed)).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 ");
|
||||
}
|
||||
|
||||
static {
|
||||
// Initialize and register the discriminator mappings.
|
||||
Map<String, Class<?>> mappings = new HashMap<String, Class<?>>();
|
||||
mappings.put("Dog", Dog.class);
|
||||
JSON.registerDiscriminator(Dog.class, "className", mappings);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* DogAllOf
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
DogAllOf.JSON_PROPERTY_BREED
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class DogAllOf {
|
||||
public static final String JSON_PROPERTY_BREED = "breed";
|
||||
private String breed;
|
||||
|
||||
|
||||
public DogAllOf breed(String breed) {
|
||||
this.breed = breed;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get breed
|
||||
* @return breed
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_BREED)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getBreed() {
|
||||
return breed;
|
||||
}
|
||||
|
||||
|
||||
public void setBreed(String breed) {
|
||||
this.breed = breed;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this Dog_allOf object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
DogAllOf dogAllOf = (DogAllOf) o;
|
||||
return Objects.equals(this.breed, dogAllOf.breed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(breed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class DogAllOf {\n");
|
||||
sb.append(" breed: ").append(toIndentedString(breed)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,272 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonAnyGetter;
|
||||
import com.fasterxml.jackson.annotation.JsonAnySetter;
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.openapitools.client.model.Fruit;
|
||||
import org.openapitools.client.model.NullableShape;
|
||||
import org.openapitools.client.model.Shape;
|
||||
import org.openapitools.client.model.ShapeOrNull;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import java.util.NoSuchElementException;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Drawing
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
Drawing.JSON_PROPERTY_MAIN_SHAPE,
|
||||
Drawing.JSON_PROPERTY_SHAPE_OR_NULL,
|
||||
Drawing.JSON_PROPERTY_NULLABLE_SHAPE,
|
||||
Drawing.JSON_PROPERTY_SHAPES
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Drawing extends HashMap<String, Fruit> {
|
||||
public static final String JSON_PROPERTY_MAIN_SHAPE = "mainShape";
|
||||
private Shape mainShape = null;
|
||||
|
||||
public static final String JSON_PROPERTY_SHAPE_OR_NULL = "shapeOrNull";
|
||||
private ShapeOrNull shapeOrNull = null;
|
||||
|
||||
public static final String JSON_PROPERTY_NULLABLE_SHAPE = "nullableShape";
|
||||
private JsonNullable<NullableShape> nullableShape = JsonNullable.<NullableShape>of(null);
|
||||
|
||||
public static final String JSON_PROPERTY_SHAPES = "shapes";
|
||||
private List<Shape> shapes = null;
|
||||
|
||||
|
||||
public Drawing mainShape(Shape mainShape) {
|
||||
this.mainShape = mainShape;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mainShape
|
||||
* @return mainShape
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_MAIN_SHAPE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Shape getMainShape() {
|
||||
return mainShape;
|
||||
}
|
||||
|
||||
|
||||
public void setMainShape(Shape mainShape) {
|
||||
this.mainShape = mainShape;
|
||||
}
|
||||
|
||||
|
||||
public Drawing shapeOrNull(ShapeOrNull shapeOrNull) {
|
||||
this.shapeOrNull = shapeOrNull;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get shapeOrNull
|
||||
* @return shapeOrNull
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_SHAPE_OR_NULL)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public ShapeOrNull getShapeOrNull() {
|
||||
return shapeOrNull;
|
||||
}
|
||||
|
||||
|
||||
public void setShapeOrNull(ShapeOrNull shapeOrNull) {
|
||||
this.shapeOrNull = shapeOrNull;
|
||||
}
|
||||
|
||||
|
||||
public Drawing nullableShape(NullableShape nullableShape) {
|
||||
this.nullableShape = JsonNullable.<NullableShape>of(nullableShape);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get nullableShape
|
||||
* @return nullableShape
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonIgnore
|
||||
|
||||
public NullableShape getNullableShape() {
|
||||
return nullableShape.orElse(null);
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_NULLABLE_SHAPE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public JsonNullable<NullableShape> getNullableShape_JsonNullable() {
|
||||
return nullableShape;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_NULLABLE_SHAPE)
|
||||
public void setNullableShape_JsonNullable(JsonNullable<NullableShape> nullableShape) {
|
||||
this.nullableShape = nullableShape;
|
||||
}
|
||||
|
||||
public void setNullableShape(NullableShape nullableShape) {
|
||||
this.nullableShape = JsonNullable.<NullableShape>of(nullableShape);
|
||||
}
|
||||
|
||||
|
||||
public Drawing shapes(List<Shape> shapes) {
|
||||
this.shapes = shapes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Drawing addShapesItem(Shape shapesItem) {
|
||||
if (this.shapes == null) {
|
||||
this.shapes = new ArrayList<>();
|
||||
}
|
||||
this.shapes.add(shapesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get shapes
|
||||
* @return shapes
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_SHAPES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<Shape> getShapes() {
|
||||
return shapes;
|
||||
}
|
||||
|
||||
|
||||
public void setShapes(List<Shape> shapes) {
|
||||
this.shapes = shapes;
|
||||
}
|
||||
|
||||
/**
|
||||
* A container for additional, undeclared properties.
|
||||
* This is a holder for any undeclared properties as specified with
|
||||
* the 'additionalProperties' keyword in the OAS document.
|
||||
*/
|
||||
private Map<String, Fruit> additionalProperties;
|
||||
|
||||
/**
|
||||
* Set the additional (undeclared) property with the specified name and value.
|
||||
* If the property does not already exist, create it otherwise replace it.
|
||||
*/
|
||||
@JsonAnySetter
|
||||
public Drawing putAdditionalProperty(String key, Fruit value) {
|
||||
if (this.additionalProperties == null) {
|
||||
this.additionalProperties = new HashMap<String, Fruit>();
|
||||
}
|
||||
this.additionalProperties.put(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the additional (undeclared) property.
|
||||
*/
|
||||
@JsonAnyGetter
|
||||
public Map<String, Fruit> getAdditionalProperties() {
|
||||
return additionalProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the additional (undeclared) property with the specified name.
|
||||
*/
|
||||
public Fruit getAdditionalProperty(String key) {
|
||||
if (this.additionalProperties == null) {
|
||||
return null;
|
||||
}
|
||||
return this.additionalProperties.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this Drawing object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Drawing drawing = (Drawing) o;
|
||||
return Objects.equals(this.mainShape, drawing.mainShape) &&
|
||||
Objects.equals(this.shapeOrNull, drawing.shapeOrNull) &&
|
||||
Objects.equals(this.nullableShape, drawing.nullableShape) &&
|
||||
Objects.equals(this.shapes, drawing.shapes)&&
|
||||
Objects.equals(this.additionalProperties, drawing.additionalProperties) &&
|
||||
super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(mainShape, shapeOrNull, nullableShape, shapes, super.hashCode(), additionalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Drawing {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append(" mainShape: ").append(toIndentedString(mainShape)).append("\n");
|
||||
sb.append(" shapeOrNull: ").append(toIndentedString(shapeOrNull)).append("\n");
|
||||
sb.append(" nullableShape: ").append(toIndentedString(nullableShape)).append("\n");
|
||||
sb.append(" shapes: ").append(toIndentedString(shapes)).append("\n");
|
||||
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* EnumArrays
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
EnumArrays.JSON_PROPERTY_JUST_SYMBOL,
|
||||
EnumArrays.JSON_PROPERTY_ARRAY_ENUM
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class EnumArrays {
|
||||
/**
|
||||
* Gets or Sets justSymbol
|
||||
*/
|
||||
public enum JustSymbolEnum {
|
||||
GREATER_THAN_OR_EQUAL_TO(">="),
|
||||
|
||||
DOLLAR("$");
|
||||
|
||||
private String value;
|
||||
|
||||
JustSymbolEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static JustSymbolEnum fromValue(String value) {
|
||||
for (JustSymbolEnum b : JustSymbolEnum.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol";
|
||||
private JustSymbolEnum justSymbol;
|
||||
|
||||
/**
|
||||
* Gets or Sets arrayEnum
|
||||
*/
|
||||
public enum ArrayEnumEnum {
|
||||
FISH("fish"),
|
||||
|
||||
CRAB("crab");
|
||||
|
||||
private String value;
|
||||
|
||||
ArrayEnumEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static ArrayEnumEnum fromValue(String value) {
|
||||
for (ArrayEnumEnum b : ArrayEnumEnum.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum";
|
||||
private List<ArrayEnumEnum> arrayEnum = null;
|
||||
|
||||
|
||||
public EnumArrays justSymbol(JustSymbolEnum justSymbol) {
|
||||
this.justSymbol = justSymbol;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get justSymbol
|
||||
* @return justSymbol
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_JUST_SYMBOL)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public JustSymbolEnum getJustSymbol() {
|
||||
return justSymbol;
|
||||
}
|
||||
|
||||
|
||||
public void setJustSymbol(JustSymbolEnum justSymbol) {
|
||||
this.justSymbol = justSymbol;
|
||||
}
|
||||
|
||||
|
||||
public EnumArrays arrayEnum(List<ArrayEnumEnum> arrayEnum) {
|
||||
this.arrayEnum = arrayEnum;
|
||||
return this;
|
||||
}
|
||||
|
||||
public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
|
||||
if (this.arrayEnum == null) {
|
||||
this.arrayEnum = new ArrayList<>();
|
||||
}
|
||||
this.arrayEnum.add(arrayEnumItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayEnum
|
||||
* @return arrayEnum
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_ENUM)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<ArrayEnumEnum> getArrayEnum() {
|
||||
return arrayEnum;
|
||||
}
|
||||
|
||||
|
||||
public void setArrayEnum(List<ArrayEnumEnum> arrayEnum) {
|
||||
this.arrayEnum = arrayEnum;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this EnumArrays object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
EnumArrays enumArrays = (EnumArrays) o;
|
||||
return Objects.equals(this.justSymbol, enumArrays.justSymbol) &&
|
||||
Objects.equals(this.arrayEnum, enumArrays.arrayEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(justSymbol, arrayEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class EnumArrays {\n");
|
||||
sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n");
|
||||
sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
/**
|
||||
* Gets or Sets EnumClass
|
||||
*/
|
||||
public enum EnumClass {
|
||||
|
||||
_ABC("_abc"),
|
||||
|
||||
_EFG("-efg"),
|
||||
|
||||
_XYZ_("(xyz)");
|
||||
|
||||
private String value;
|
||||
|
||||
EnumClass(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static EnumClass fromValue(String value) {
|
||||
for (EnumClass b : EnumClass.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,478 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.OuterEnum;
|
||||
import org.openapitools.client.model.OuterEnumDefaultValue;
|
||||
import org.openapitools.client.model.OuterEnumInteger;
|
||||
import org.openapitools.client.model.OuterEnumIntegerDefaultValue;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import java.util.NoSuchElementException;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* EnumTest
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
EnumTest.JSON_PROPERTY_ENUM_STRING,
|
||||
EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED,
|
||||
EnumTest.JSON_PROPERTY_ENUM_INTEGER,
|
||||
EnumTest.JSON_PROPERTY_ENUM_NUMBER,
|
||||
EnumTest.JSON_PROPERTY_OUTER_ENUM,
|
||||
EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER,
|
||||
EnumTest.JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE,
|
||||
EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class EnumTest {
|
||||
/**
|
||||
* Gets or Sets enumString
|
||||
*/
|
||||
public enum EnumStringEnum {
|
||||
UPPER("UPPER"),
|
||||
|
||||
LOWER("lower"),
|
||||
|
||||
EMPTY("");
|
||||
|
||||
private String value;
|
||||
|
||||
EnumStringEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static EnumStringEnum fromValue(String value) {
|
||||
for (EnumStringEnum b : EnumStringEnum.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ENUM_STRING = "enum_string";
|
||||
private EnumStringEnum enumString;
|
||||
|
||||
/**
|
||||
* Gets or Sets enumStringRequired
|
||||
*/
|
||||
public enum EnumStringRequiredEnum {
|
||||
UPPER("UPPER"),
|
||||
|
||||
LOWER("lower"),
|
||||
|
||||
EMPTY("");
|
||||
|
||||
private String value;
|
||||
|
||||
EnumStringRequiredEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static EnumStringRequiredEnum fromValue(String value) {
|
||||
for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required";
|
||||
private EnumStringRequiredEnum enumStringRequired;
|
||||
|
||||
/**
|
||||
* Gets or Sets enumInteger
|
||||
*/
|
||||
public enum EnumIntegerEnum {
|
||||
NUMBER_1(1),
|
||||
|
||||
NUMBER_MINUS_1(-1);
|
||||
|
||||
private Integer value;
|
||||
|
||||
EnumIntegerEnum(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static EnumIntegerEnum fromValue(Integer value) {
|
||||
for (EnumIntegerEnum b : EnumIntegerEnum.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer";
|
||||
private EnumIntegerEnum enumInteger;
|
||||
|
||||
/**
|
||||
* Gets or Sets enumNumber
|
||||
*/
|
||||
public enum EnumNumberEnum {
|
||||
NUMBER_1_DOT_1(1.1),
|
||||
|
||||
NUMBER_MINUS_1_DOT_2(-1.2);
|
||||
|
||||
private Double value;
|
||||
|
||||
EnumNumberEnum(Double value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Double getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static EnumNumberEnum fromValue(Double value) {
|
||||
for (EnumNumberEnum b : EnumNumberEnum.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number";
|
||||
private EnumNumberEnum enumNumber;
|
||||
|
||||
public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum";
|
||||
private JsonNullable<OuterEnum> outerEnum = JsonNullable.<OuterEnum>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER = "outerEnumInteger";
|
||||
private OuterEnumInteger outerEnumInteger;
|
||||
|
||||
public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue";
|
||||
private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED;
|
||||
|
||||
public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue";
|
||||
private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0;
|
||||
|
||||
|
||||
public EnumTest enumString(EnumStringEnum enumString) {
|
||||
this.enumString = enumString;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get enumString
|
||||
* @return enumString
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_ENUM_STRING)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public EnumStringEnum getEnumString() {
|
||||
return enumString;
|
||||
}
|
||||
|
||||
|
||||
public void setEnumString(EnumStringEnum enumString) {
|
||||
this.enumString = enumString;
|
||||
}
|
||||
|
||||
|
||||
public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) {
|
||||
this.enumStringRequired = enumStringRequired;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get enumStringRequired
|
||||
* @return enumStringRequired
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public EnumStringRequiredEnum getEnumStringRequired() {
|
||||
return enumStringRequired;
|
||||
}
|
||||
|
||||
|
||||
public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) {
|
||||
this.enumStringRequired = enumStringRequired;
|
||||
}
|
||||
|
||||
|
||||
public EnumTest enumInteger(EnumIntegerEnum enumInteger) {
|
||||
this.enumInteger = enumInteger;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get enumInteger
|
||||
* @return enumInteger
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_ENUM_INTEGER)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public EnumIntegerEnum getEnumInteger() {
|
||||
return enumInteger;
|
||||
}
|
||||
|
||||
|
||||
public void setEnumInteger(EnumIntegerEnum enumInteger) {
|
||||
this.enumInteger = enumInteger;
|
||||
}
|
||||
|
||||
|
||||
public EnumTest enumNumber(EnumNumberEnum enumNumber) {
|
||||
this.enumNumber = enumNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get enumNumber
|
||||
* @return enumNumber
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_ENUM_NUMBER)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public EnumNumberEnum getEnumNumber() {
|
||||
return enumNumber;
|
||||
}
|
||||
|
||||
|
||||
public void setEnumNumber(EnumNumberEnum enumNumber) {
|
||||
this.enumNumber = enumNumber;
|
||||
}
|
||||
|
||||
|
||||
public EnumTest outerEnum(OuterEnum outerEnum) {
|
||||
this.outerEnum = JsonNullable.<OuterEnum>of(outerEnum);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get outerEnum
|
||||
* @return outerEnum
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonIgnore
|
||||
|
||||
public OuterEnum getOuterEnum() {
|
||||
return outerEnum.orElse(null);
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_OUTER_ENUM)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public JsonNullable<OuterEnum> getOuterEnum_JsonNullable() {
|
||||
return outerEnum;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_OUTER_ENUM)
|
||||
public void setOuterEnum_JsonNullable(JsonNullable<OuterEnum> outerEnum) {
|
||||
this.outerEnum = outerEnum;
|
||||
}
|
||||
|
||||
public void setOuterEnum(OuterEnum outerEnum) {
|
||||
this.outerEnum = JsonNullable.<OuterEnum>of(outerEnum);
|
||||
}
|
||||
|
||||
|
||||
public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) {
|
||||
this.outerEnumInteger = outerEnumInteger;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get outerEnumInteger
|
||||
* @return outerEnumInteger
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public OuterEnumInteger getOuterEnumInteger() {
|
||||
return outerEnumInteger;
|
||||
}
|
||||
|
||||
|
||||
public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) {
|
||||
this.outerEnumInteger = outerEnumInteger;
|
||||
}
|
||||
|
||||
|
||||
public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) {
|
||||
this.outerEnumDefaultValue = outerEnumDefaultValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get outerEnumDefaultValue
|
||||
* @return outerEnumDefaultValue
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public OuterEnumDefaultValue getOuterEnumDefaultValue() {
|
||||
return outerEnumDefaultValue;
|
||||
}
|
||||
|
||||
|
||||
public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) {
|
||||
this.outerEnumDefaultValue = outerEnumDefaultValue;
|
||||
}
|
||||
|
||||
|
||||
public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) {
|
||||
this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get outerEnumIntegerDefaultValue
|
||||
* @return outerEnumIntegerDefaultValue
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() {
|
||||
return outerEnumIntegerDefaultValue;
|
||||
}
|
||||
|
||||
|
||||
public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) {
|
||||
this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this Enum_Test object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
EnumTest enumTest = (EnumTest) o;
|
||||
return Objects.equals(this.enumString, enumTest.enumString) &&
|
||||
Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) &&
|
||||
Objects.equals(this.enumInteger, enumTest.enumInteger) &&
|
||||
Objects.equals(this.enumNumber, enumTest.enumNumber) &&
|
||||
Objects.equals(this.outerEnum, enumTest.outerEnum) &&
|
||||
Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) &&
|
||||
Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) &&
|
||||
Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum, outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class EnumTest {\n");
|
||||
sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n");
|
||||
sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n");
|
||||
sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n");
|
||||
sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n");
|
||||
sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n");
|
||||
sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n");
|
||||
sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n");
|
||||
sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.ShapeInterface;
|
||||
import org.openapitools.client.model.TriangleInterface;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* EquilateralTriangle
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
EquilateralTriangle.JSON_PROPERTY_SHAPE_TYPE,
|
||||
EquilateralTriangle.JSON_PROPERTY_TRIANGLE_TYPE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class EquilateralTriangle {
|
||||
public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType";
|
||||
private String shapeType;
|
||||
|
||||
public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType";
|
||||
private String triangleType;
|
||||
|
||||
|
||||
public EquilateralTriangle shapeType(String shapeType) {
|
||||
this.shapeType = shapeType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get shapeType
|
||||
* @return shapeType
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_SHAPE_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getShapeType() {
|
||||
return shapeType;
|
||||
}
|
||||
|
||||
|
||||
public void setShapeType(String shapeType) {
|
||||
this.shapeType = shapeType;
|
||||
}
|
||||
|
||||
|
||||
public EquilateralTriangle triangleType(String triangleType) {
|
||||
this.triangleType = triangleType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get triangleType
|
||||
* @return triangleType
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getTriangleType() {
|
||||
return triangleType;
|
||||
}
|
||||
|
||||
|
||||
public void setTriangleType(String triangleType) {
|
||||
this.triangleType = triangleType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this EquilateralTriangle object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
EquilateralTriangle equilateralTriangle = (EquilateralTriangle) o;
|
||||
return Objects.equals(this.shapeType, equilateralTriangle.shapeType) &&
|
||||
Objects.equals(this.triangleType, equilateralTriangle.triangleType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(shapeType, triangleType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class EquilateralTriangle {\n");
|
||||
sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n");
|
||||
sb.append(" triangleType: ").append(toIndentedString(triangleType)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* FileSchemaTestClass
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
FileSchemaTestClass.JSON_PROPERTY_FILE,
|
||||
FileSchemaTestClass.JSON_PROPERTY_FILES
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class FileSchemaTestClass {
|
||||
public static final String JSON_PROPERTY_FILE = "file";
|
||||
private java.io.File file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<java.io.File> files = null;
|
||||
|
||||
|
||||
public FileSchemaTestClass file(java.io.File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file
|
||||
* @return file
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public java.io.File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
public void setFile(java.io.File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
|
||||
public FileSchemaTestClass files(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FileSchemaTestClass addFilesItem(java.io.File filesItem) {
|
||||
if (this.files == null) {
|
||||
this.files = new ArrayList<>();
|
||||
}
|
||||
this.files.add(filesItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_FILES)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<java.io.File> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
|
||||
public void setFiles(List<java.io.File> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this FileSchemaTestClass object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
|
||||
return Objects.equals(this.file, fileSchemaTestClass.file) &&
|
||||
Objects.equals(this.files, fileSchemaTestClass.files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(file, files);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
sb.append(" file: ").append(toIndentedString(file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Foo
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
Foo.JSON_PROPERTY_BAR
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Foo {
|
||||
public static final String JSON_PROPERTY_BAR = "bar";
|
||||
private String bar = "bar";
|
||||
|
||||
|
||||
public Foo bar(String bar) {
|
||||
this.bar = bar;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get bar
|
||||
* @return bar
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_BAR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getBar() {
|
||||
return bar;
|
||||
}
|
||||
|
||||
|
||||
public void setBar(String bar) {
|
||||
this.bar = bar;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this Foo object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Foo foo = (Foo) o;
|
||||
return Objects.equals(this.bar, foo.bar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(bar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Foo {\n");
|
||||
sb.append(" bar: ").append(toIndentedString(bar)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,539 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.UUID;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* FormatTest
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
FormatTest.JSON_PROPERTY_INTEGER,
|
||||
FormatTest.JSON_PROPERTY_INT32,
|
||||
FormatTest.JSON_PROPERTY_INT64,
|
||||
FormatTest.JSON_PROPERTY_NUMBER,
|
||||
FormatTest.JSON_PROPERTY_FLOAT,
|
||||
FormatTest.JSON_PROPERTY_DOUBLE,
|
||||
FormatTest.JSON_PROPERTY_STRING,
|
||||
FormatTest.JSON_PROPERTY_BYTE,
|
||||
FormatTest.JSON_PROPERTY_BINARY,
|
||||
FormatTest.JSON_PROPERTY_DATE,
|
||||
FormatTest.JSON_PROPERTY_DATE_TIME,
|
||||
FormatTest.JSON_PROPERTY_UUID,
|
||||
FormatTest.JSON_PROPERTY_PASSWORD,
|
||||
FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS,
|
||||
FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class FormatTest {
|
||||
public static final String JSON_PROPERTY_INTEGER = "integer";
|
||||
private Integer integer;
|
||||
|
||||
public static final String JSON_PROPERTY_INT32 = "int32";
|
||||
private Integer int32;
|
||||
|
||||
public static final String JSON_PROPERTY_INT64 = "int64";
|
||||
private Long int64;
|
||||
|
||||
public static final String JSON_PROPERTY_NUMBER = "number";
|
||||
private BigDecimal number;
|
||||
|
||||
public static final String JSON_PROPERTY_FLOAT = "float";
|
||||
private Float _float;
|
||||
|
||||
public static final String JSON_PROPERTY_DOUBLE = "double";
|
||||
private Double _double;
|
||||
|
||||
public static final String JSON_PROPERTY_STRING = "string";
|
||||
private String string;
|
||||
|
||||
public static final String JSON_PROPERTY_BYTE = "byte";
|
||||
private byte[] _byte;
|
||||
|
||||
public static final String JSON_PROPERTY_BINARY = "binary";
|
||||
private File binary;
|
||||
|
||||
public static final String JSON_PROPERTY_DATE = "date";
|
||||
private LocalDate date;
|
||||
|
||||
public static final String JSON_PROPERTY_DATE_TIME = "dateTime";
|
||||
private OffsetDateTime dateTime;
|
||||
|
||||
public static final String JSON_PROPERTY_UUID = "uuid";
|
||||
private UUID uuid;
|
||||
|
||||
public static final String JSON_PROPERTY_PASSWORD = "password";
|
||||
private String password;
|
||||
|
||||
public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS = "pattern_with_digits";
|
||||
private String patternWithDigits;
|
||||
|
||||
public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER = "pattern_with_digits_and_delimiter";
|
||||
private String patternWithDigitsAndDelimiter;
|
||||
|
||||
|
||||
public FormatTest integer(Integer integer) {
|
||||
this.integer = integer;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get integer
|
||||
* minimum: 10
|
||||
* maximum: 100
|
||||
* @return integer
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_INTEGER)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Integer getInteger() {
|
||||
return integer;
|
||||
}
|
||||
|
||||
|
||||
public void setInteger(Integer integer) {
|
||||
this.integer = integer;
|
||||
}
|
||||
|
||||
|
||||
public FormatTest int32(Integer int32) {
|
||||
this.int32 = int32;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get int32
|
||||
* minimum: 20
|
||||
* maximum: 200
|
||||
* @return int32
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_INT32)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Integer getInt32() {
|
||||
return int32;
|
||||
}
|
||||
|
||||
|
||||
public void setInt32(Integer int32) {
|
||||
this.int32 = int32;
|
||||
}
|
||||
|
||||
|
||||
public FormatTest int64(Long int64) {
|
||||
this.int64 = int64;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get int64
|
||||
* @return int64
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_INT64)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Long getInt64() {
|
||||
return int64;
|
||||
}
|
||||
|
||||
|
||||
public void setInt64(Long int64) {
|
||||
this.int64 = int64;
|
||||
}
|
||||
|
||||
|
||||
public FormatTest number(BigDecimal number) {
|
||||
this.number = number;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get number
|
||||
* minimum: 32.1
|
||||
* maximum: 543.2
|
||||
* @return number
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_NUMBER)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public BigDecimal getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
|
||||
public void setNumber(BigDecimal number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
|
||||
public FormatTest _float(Float _float) {
|
||||
this._float = _float;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _float
|
||||
* minimum: 54.3
|
||||
* maximum: 987.6
|
||||
* @return _float
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_FLOAT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Float getFloat() {
|
||||
return _float;
|
||||
}
|
||||
|
||||
|
||||
public void setFloat(Float _float) {
|
||||
this._float = _float;
|
||||
}
|
||||
|
||||
|
||||
public FormatTest _double(Double _double) {
|
||||
this._double = _double;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _double
|
||||
* minimum: 67.8
|
||||
* maximum: 123.4
|
||||
* @return _double
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_DOUBLE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Double getDouble() {
|
||||
return _double;
|
||||
}
|
||||
|
||||
|
||||
public void setDouble(Double _double) {
|
||||
this._double = _double;
|
||||
}
|
||||
|
||||
|
||||
public FormatTest string(String string) {
|
||||
this.string = string;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get string
|
||||
* @return string
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_STRING)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getString() {
|
||||
return string;
|
||||
}
|
||||
|
||||
|
||||
public void setString(String string) {
|
||||
this.string = string;
|
||||
}
|
||||
|
||||
|
||||
public FormatTest _byte(byte[] _byte) {
|
||||
this._byte = _byte;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _byte
|
||||
* @return _byte
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_BYTE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public byte[] getByte() {
|
||||
return _byte;
|
||||
}
|
||||
|
||||
|
||||
public void setByte(byte[] _byte) {
|
||||
this._byte = _byte;
|
||||
}
|
||||
|
||||
|
||||
public FormatTest binary(File binary) {
|
||||
this.binary = binary;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get binary
|
||||
* @return binary
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_BINARY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public File getBinary() {
|
||||
return binary;
|
||||
}
|
||||
|
||||
|
||||
public void setBinary(File binary) {
|
||||
this.binary = binary;
|
||||
}
|
||||
|
||||
|
||||
public FormatTest date(LocalDate date) {
|
||||
this.date = date;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get date
|
||||
* @return date
|
||||
**/
|
||||
@ApiModelProperty(example = "Sun Feb 02 00:00:00 UTC 2020", required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_DATE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public LocalDate getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
public void setDate(LocalDate date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
|
||||
public FormatTest dateTime(OffsetDateTime dateTime) {
|
||||
this.dateTime = dateTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dateTime
|
||||
* @return dateTime
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(example = "2007-12-03T10:15:30+01:00", value = "")
|
||||
@JsonProperty(JSON_PROPERTY_DATE_TIME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public OffsetDateTime getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
|
||||
|
||||
public void setDateTime(OffsetDateTime dateTime) {
|
||||
this.dateTime = dateTime;
|
||||
}
|
||||
|
||||
|
||||
public FormatTest uuid(UUID uuid) {
|
||||
this.uuid = uuid;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get uuid
|
||||
* @return uuid
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "")
|
||||
@JsonProperty(JSON_PROPERTY_UUID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public UUID getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
|
||||
public void setUuid(UUID uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
||||
public FormatTest password(String password) {
|
||||
this.password = password;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get password
|
||||
* @return password
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_PASSWORD)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
|
||||
public FormatTest patternWithDigits(String patternWithDigits) {
|
||||
this.patternWithDigits = patternWithDigits;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A string that is a 10 digit number. Can have leading zeros.
|
||||
* @return patternWithDigits
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "A string that is a 10 digit number. Can have leading zeros.")
|
||||
@JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getPatternWithDigits() {
|
||||
return patternWithDigits;
|
||||
}
|
||||
|
||||
|
||||
public void setPatternWithDigits(String patternWithDigits) {
|
||||
this.patternWithDigits = patternWithDigits;
|
||||
}
|
||||
|
||||
|
||||
public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) {
|
||||
this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
|
||||
* @return patternWithDigitsAndDelimiter
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.")
|
||||
@JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getPatternWithDigitsAndDelimiter() {
|
||||
return patternWithDigitsAndDelimiter;
|
||||
}
|
||||
|
||||
|
||||
public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) {
|
||||
this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this format_test object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FormatTest formatTest = (FormatTest) o;
|
||||
return Objects.equals(this.integer, formatTest.integer) &&
|
||||
Objects.equals(this.int32, formatTest.int32) &&
|
||||
Objects.equals(this.int64, formatTest.int64) &&
|
||||
Objects.equals(this.number, formatTest.number) &&
|
||||
Objects.equals(this._float, formatTest._float) &&
|
||||
Objects.equals(this._double, formatTest._double) &&
|
||||
Objects.equals(this.string, formatTest.string) &&
|
||||
Arrays.equals(this._byte, formatTest._byte) &&
|
||||
Objects.equals(this.binary, formatTest.binary) &&
|
||||
Objects.equals(this.date, formatTest.date) &&
|
||||
Objects.equals(this.dateTime, formatTest.dateTime) &&
|
||||
Objects.equals(this.uuid, formatTest.uuid) &&
|
||||
Objects.equals(this.password, formatTest.password) &&
|
||||
Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) &&
|
||||
Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FormatTest {\n");
|
||||
sb.append(" integer: ").append(toIndentedString(integer)).append("\n");
|
||||
sb.append(" int32: ").append(toIndentedString(int32)).append("\n");
|
||||
sb.append(" int64: ").append(toIndentedString(int64)).append("\n");
|
||||
sb.append(" number: ").append(toIndentedString(number)).append("\n");
|
||||
sb.append(" _float: ").append(toIndentedString(_float)).append("\n");
|
||||
sb.append(" _double: ").append(toIndentedString(_double)).append("\n");
|
||||
sb.append(" string: ").append(toIndentedString(string)).append("\n");
|
||||
sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n");
|
||||
sb.append(" binary: ").append(toIndentedString(binary)).append("\n");
|
||||
sb.append(" date: ").append(toIndentedString(date)).append("\n");
|
||||
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
|
||||
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
|
||||
sb.append(" password: ").append(toIndentedString(password)).append("\n");
|
||||
sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n");
|
||||
sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,253 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Apple;
|
||||
import org.openapitools.client.model.Banana;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import javax.ws.rs.core.GenericType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.JsonToken;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.MapperFeature;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
|
||||
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonDeserialize(using = Fruit.FruitDeserializer.class)
|
||||
@JsonSerialize(using = Fruit.FruitSerializer.class)
|
||||
public class Fruit extends AbstractOpenApiSchema {
|
||||
private static final Logger log = Logger.getLogger(Fruit.class.getName());
|
||||
|
||||
public static class FruitSerializer extends StdSerializer<Fruit> {
|
||||
public FruitSerializer(Class<Fruit> t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
public FruitSerializer() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(Fruit value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
|
||||
jgen.writeObject(value.getActualInstance());
|
||||
}
|
||||
}
|
||||
|
||||
public static class FruitDeserializer extends StdDeserializer<Fruit> {
|
||||
public FruitDeserializer() {
|
||||
this(Fruit.class);
|
||||
}
|
||||
|
||||
public FruitDeserializer(Class<?> vc) {
|
||||
super(vc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
|
||||
JsonNode tree = jp.readValueAsTree();
|
||||
Object deserialized = null;
|
||||
boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS);
|
||||
int match = 0;
|
||||
JsonToken token = tree.traverse(jp.getCodec()).nextToken();
|
||||
// deserialize Apple
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (Apple.class.equals(Integer.class) || Apple.class.equals(Long.class) || Apple.class.equals(Float.class) || Apple.class.equals(Double.class) || Apple.class.equals(Boolean.class) || Apple.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((Apple.class.equals(Integer.class) || Apple.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((Apple.class.equals(Float.class) || Apple.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (Apple.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (Apple.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Apple.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'Apple'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'Apple'", e);
|
||||
}
|
||||
|
||||
// deserialize Banana
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (Banana.class.equals(Integer.class) || Banana.class.equals(Long.class) || Banana.class.equals(Float.class) || Banana.class.equals(Double.class) || Banana.class.equals(Boolean.class) || Banana.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((Banana.class.equals(Integer.class) || Banana.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((Banana.class.equals(Float.class) || Banana.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (Banana.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (Banana.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Banana.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'Banana'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'Banana'", e);
|
||||
}
|
||||
|
||||
if (match == 1) {
|
||||
Fruit ret = new Fruit();
|
||||
ret.setActualInstance(deserialized);
|
||||
return ret;
|
||||
}
|
||||
throw new IOException(String.format("Failed deserialization for Fruit: %d classes match result, expected 1", match));
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle deserialization of the 'null' value.
|
||||
*/
|
||||
@Override
|
||||
public Fruit getNullValue(DeserializationContext ctxt) throws JsonMappingException {
|
||||
throw new JsonMappingException(ctxt.getParser(), "Fruit cannot be null");
|
||||
}
|
||||
}
|
||||
|
||||
// store a list of schema names defined in oneOf
|
||||
public final static Map<String, GenericType> schemas = new HashMap<String, GenericType>();
|
||||
|
||||
public Fruit() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
}
|
||||
|
||||
public Fruit(Apple o) {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
public Fruit(Banana o) {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
static {
|
||||
schemas.put("Apple", new GenericType<Apple>() {
|
||||
});
|
||||
schemas.put("Banana", new GenericType<Banana>() {
|
||||
});
|
||||
JSON.registerDescendants(Fruit.class, Collections.unmodifiableMap(schemas));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
return Fruit.schemas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the instance that matches the oneOf child schema, check
|
||||
* the instance parameter is valid against the oneOf child schemas:
|
||||
* Apple, Banana
|
||||
*
|
||||
* It could be an instance of the 'oneOf' schemas.
|
||||
* The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf).
|
||||
*/
|
||||
@Override
|
||||
public void setActualInstance(Object instance) {
|
||||
if (JSON.isInstanceOf(Apple.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
if (JSON.isInstanceOf(Banana.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
throw new RuntimeException("Invalid instance type. Must be Apple, Banana");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance, which can be the following:
|
||||
* Apple, Banana
|
||||
*
|
||||
* @return The actual instance (Apple, Banana)
|
||||
*/
|
||||
@Override
|
||||
public Object getActualInstance() {
|
||||
return super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `Apple`. If the actual instanct is not `Apple`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `Apple`
|
||||
* @throws ClassCastException if the instance is not `Apple`
|
||||
*/
|
||||
public Apple getApple() throws ClassCastException {
|
||||
return (Apple)super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `Banana`. If the actual instanct is not `Banana`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `Banana`
|
||||
* @throws ClassCastException if the instance is not `Banana`
|
||||
*/
|
||||
public Banana getBanana() throws ClassCastException {
|
||||
return (Banana)super.getActualInstance();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,260 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.AppleReq;
|
||||
import org.openapitools.client.model.BananaReq;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import javax.ws.rs.core.GenericType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.JsonToken;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.MapperFeature;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
|
||||
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonDeserialize(using = FruitReq.FruitReqDeserializer.class)
|
||||
@JsonSerialize(using = FruitReq.FruitReqSerializer.class)
|
||||
public class FruitReq extends AbstractOpenApiSchema {
|
||||
private static final Logger log = Logger.getLogger(FruitReq.class.getName());
|
||||
|
||||
public static class FruitReqSerializer extends StdSerializer<FruitReq> {
|
||||
public FruitReqSerializer(Class<FruitReq> t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
public FruitReqSerializer() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(FruitReq value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
|
||||
jgen.writeObject(value.getActualInstance());
|
||||
}
|
||||
}
|
||||
|
||||
public static class FruitReqDeserializer extends StdDeserializer<FruitReq> {
|
||||
public FruitReqDeserializer() {
|
||||
this(FruitReq.class);
|
||||
}
|
||||
|
||||
public FruitReqDeserializer(Class<?> vc) {
|
||||
super(vc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
|
||||
JsonNode tree = jp.readValueAsTree();
|
||||
Object deserialized = null;
|
||||
boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS);
|
||||
int match = 0;
|
||||
JsonToken token = tree.traverse(jp.getCodec()).nextToken();
|
||||
// deserialize AppleReq
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (AppleReq.class.equals(Integer.class) || AppleReq.class.equals(Long.class) || AppleReq.class.equals(Float.class) || AppleReq.class.equals(Double.class) || AppleReq.class.equals(Boolean.class) || AppleReq.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((AppleReq.class.equals(Integer.class) || AppleReq.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((AppleReq.class.equals(Float.class) || AppleReq.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (AppleReq.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (AppleReq.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
attemptParsing |= (token == JsonToken.VALUE_NULL);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(AppleReq.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'AppleReq'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'AppleReq'", e);
|
||||
}
|
||||
|
||||
// deserialize BananaReq
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (BananaReq.class.equals(Integer.class) || BananaReq.class.equals(Long.class) || BananaReq.class.equals(Float.class) || BananaReq.class.equals(Double.class) || BananaReq.class.equals(Boolean.class) || BananaReq.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((BananaReq.class.equals(Integer.class) || BananaReq.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((BananaReq.class.equals(Float.class) || BananaReq.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (BananaReq.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (BananaReq.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
attemptParsing |= (token == JsonToken.VALUE_NULL);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(BananaReq.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'BananaReq'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'BananaReq'", e);
|
||||
}
|
||||
|
||||
if (match == 1) {
|
||||
FruitReq ret = new FruitReq();
|
||||
ret.setActualInstance(deserialized);
|
||||
return ret;
|
||||
}
|
||||
throw new IOException(String.format("Failed deserialization for FruitReq: %d classes match result, expected 1", match));
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle deserialization of the 'null' value.
|
||||
*/
|
||||
@Override
|
||||
public FruitReq getNullValue(DeserializationContext ctxt) throws JsonMappingException {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// store a list of schema names defined in oneOf
|
||||
public final static Map<String, GenericType> schemas = new HashMap<String, GenericType>();
|
||||
|
||||
public FruitReq() {
|
||||
super("oneOf", Boolean.TRUE);
|
||||
}
|
||||
|
||||
public FruitReq(AppleReq o) {
|
||||
super("oneOf", Boolean.TRUE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
public FruitReq(BananaReq o) {
|
||||
super("oneOf", Boolean.TRUE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
static {
|
||||
schemas.put("AppleReq", new GenericType<AppleReq>() {
|
||||
});
|
||||
schemas.put("BananaReq", new GenericType<BananaReq>() {
|
||||
});
|
||||
JSON.registerDescendants(FruitReq.class, Collections.unmodifiableMap(schemas));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
return FruitReq.schemas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the instance that matches the oneOf child schema, check
|
||||
* the instance parameter is valid against the oneOf child schemas:
|
||||
* AppleReq, BananaReq
|
||||
*
|
||||
* It could be an instance of the 'oneOf' schemas.
|
||||
* The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf).
|
||||
*/
|
||||
@Override
|
||||
public void setActualInstance(Object instance) {
|
||||
if (instance == null) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
if (JSON.isInstanceOf(AppleReq.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
if (JSON.isInstanceOf(BananaReq.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
throw new RuntimeException("Invalid instance type. Must be AppleReq, BananaReq");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance, which can be the following:
|
||||
* AppleReq, BananaReq
|
||||
*
|
||||
* @return The actual instance (AppleReq, BananaReq)
|
||||
*/
|
||||
@Override
|
||||
public Object getActualInstance() {
|
||||
return super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `AppleReq`. If the actual instanct is not `AppleReq`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `AppleReq`
|
||||
* @throws ClassCastException if the instance is not `AppleReq`
|
||||
*/
|
||||
public AppleReq getAppleReq() throws ClassCastException {
|
||||
return (AppleReq)super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `BananaReq`. If the actual instanct is not `BananaReq`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `BananaReq`
|
||||
* @throws ClassCastException if the instance is not `BananaReq`
|
||||
*/
|
||||
public BananaReq getBananaReq() throws ClassCastException {
|
||||
return (BananaReq)super.getActualInstance();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,213 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Apple;
|
||||
import org.openapitools.client.model.Banana;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
import javax.ws.rs.core.GenericType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
|
||||
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonDeserialize(using=GmFruit.GmFruitDeserializer.class)
|
||||
@JsonSerialize(using = GmFruit.GmFruitSerializer.class)
|
||||
public class GmFruit extends AbstractOpenApiSchema {
|
||||
private static final Logger log = Logger.getLogger(GmFruit.class.getName());
|
||||
|
||||
public static class GmFruitSerializer extends StdSerializer<GmFruit> {
|
||||
public GmFruitSerializer(Class<GmFruit> t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
public GmFruitSerializer() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(GmFruit value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
|
||||
jgen.writeObject(value.getActualInstance());
|
||||
}
|
||||
}
|
||||
|
||||
public static class GmFruitDeserializer extends StdDeserializer<GmFruit> {
|
||||
public GmFruitDeserializer() {
|
||||
this(GmFruit.class);
|
||||
}
|
||||
|
||||
public GmFruitDeserializer(Class<?> vc) {
|
||||
super(vc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
|
||||
JsonNode tree = jp.readValueAsTree();
|
||||
|
||||
Object deserialized = null;
|
||||
// deserialize Apple
|
||||
try {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Apple.class);
|
||||
GmFruit ret = new GmFruit();
|
||||
ret.setActualInstance(deserialized);
|
||||
return ret;
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue, log to help debugging
|
||||
log.log(Level.FINER, "Input data does not match 'GmFruit'", e);
|
||||
}
|
||||
|
||||
// deserialize Banana
|
||||
try {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Banana.class);
|
||||
GmFruit ret = new GmFruit();
|
||||
ret.setActualInstance(deserialized);
|
||||
return ret;
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue, log to help debugging
|
||||
log.log(Level.FINER, "Input data does not match 'GmFruit'", e);
|
||||
}
|
||||
|
||||
throw new IOException(String.format("Failed deserialization for GmFruit: no match found"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle deserialization of the 'null' value.
|
||||
*/
|
||||
@Override
|
||||
public GmFruit getNullValue(DeserializationContext ctxt) throws JsonMappingException {
|
||||
throw new JsonMappingException(ctxt.getParser(), "GmFruit cannot be null");
|
||||
}
|
||||
}
|
||||
|
||||
// store a list of schema names defined in anyOf
|
||||
public final static Map<String, GenericType> schemas = new HashMap<String, GenericType>();
|
||||
|
||||
public GmFruit() {
|
||||
super("anyOf", Boolean.FALSE);
|
||||
}
|
||||
|
||||
public GmFruit(Apple o) {
|
||||
super("anyOf", Boolean.FALSE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
public GmFruit(Banana o) {
|
||||
super("anyOf", Boolean.FALSE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
static {
|
||||
schemas.put("Apple", new GenericType<Apple>() {
|
||||
});
|
||||
schemas.put("Banana", new GenericType<Banana>() {
|
||||
});
|
||||
JSON.registerDescendants(GmFruit.class, Collections.unmodifiableMap(schemas));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
return GmFruit.schemas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the instance that matches the anyOf child schema, check
|
||||
* the instance parameter is valid against the anyOf child schemas:
|
||||
* Apple, Banana
|
||||
*
|
||||
* It could be an instance of the 'anyOf' schemas.
|
||||
* The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf).
|
||||
*/
|
||||
@Override
|
||||
public void setActualInstance(Object instance) {
|
||||
if (JSON.isInstanceOf(Apple.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
if (JSON.isInstanceOf(Banana.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
throw new RuntimeException("Invalid instance type. Must be Apple, Banana");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance, which can be the following:
|
||||
* Apple, Banana
|
||||
*
|
||||
* @return The actual instance (Apple, Banana)
|
||||
*/
|
||||
@Override
|
||||
public Object getActualInstance() {
|
||||
return super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `Apple`. If the actual instanct is not `Apple`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `Apple`
|
||||
* @throws ClassCastException if the instance is not `Apple`
|
||||
*/
|
||||
public Apple getApple() throws ClassCastException {
|
||||
return (Apple)super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `Banana`. If the actual instanct is not `Banana`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `Banana`
|
||||
* @throws ClassCastException if the instance is not `Banana`
|
||||
*/
|
||||
public Banana getBanana() throws ClassCastException {
|
||||
return (Banana)super.getActualInstance();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.ChildCat;
|
||||
import org.openapitools.client.model.ParentPet;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* GrandparentAnimal
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
GrandparentAnimal.JSON_PROPERTY_PET_TYPE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "pet_type", visible = true)
|
||||
@JsonSubTypes({
|
||||
@JsonSubTypes.Type(value = ChildCat.class, name = "ChildCat"),
|
||||
@JsonSubTypes.Type(value = ParentPet.class, name = "ParentPet"),
|
||||
})
|
||||
|
||||
public class GrandparentAnimal {
|
||||
public static final String JSON_PROPERTY_PET_TYPE = "pet_type";
|
||||
private String petType;
|
||||
|
||||
|
||||
public GrandparentAnimal petType(String petType) {
|
||||
this.petType = petType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get petType
|
||||
* @return petType
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_PET_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getPetType() {
|
||||
return petType;
|
||||
}
|
||||
|
||||
|
||||
public void setPetType(String petType) {
|
||||
this.petType = petType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this GrandparentAnimal object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
GrandparentAnimal grandparentAnimal = (GrandparentAnimal) o;
|
||||
return Objects.equals(this.petType, grandparentAnimal.petType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(petType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class GrandparentAnimal {\n");
|
||||
sb.append(" petType: ").append(toIndentedString(petType)).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 ");
|
||||
}
|
||||
|
||||
static {
|
||||
// Initialize and register the discriminator mappings.
|
||||
Map<String, Class<?>> mappings = new HashMap<String, Class<?>>();
|
||||
mappings.put("ChildCat", ChildCat.class);
|
||||
mappings.put("ParentPet", ParentPet.class);
|
||||
mappings.put("GrandparentAnimal", GrandparentAnimal.class);
|
||||
JSON.registerDiscriminator(GrandparentAnimal.class, "pet_type", mappings);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* HasOnlyReadOnly
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
HasOnlyReadOnly.JSON_PROPERTY_BAR,
|
||||
HasOnlyReadOnly.JSON_PROPERTY_FOO
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class HasOnlyReadOnly {
|
||||
public static final String JSON_PROPERTY_BAR = "bar";
|
||||
private String bar;
|
||||
|
||||
public static final String JSON_PROPERTY_FOO = "foo";
|
||||
private String foo;
|
||||
|
||||
|
||||
/**
|
||||
* Get bar
|
||||
* @return bar
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_BAR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getBar() {
|
||||
return bar;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get foo
|
||||
* @return foo
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_FOO)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getFoo() {
|
||||
return foo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this hasOnlyReadOnly object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o;
|
||||
return Objects.equals(this.bar, hasOnlyReadOnly.bar) &&
|
||||
Objects.equals(this.foo, hasOnlyReadOnly.foo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(bar, foo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class HasOnlyReadOnly {\n");
|
||||
sb.append(" bar: ").append(toIndentedString(bar)).append("\n");
|
||||
sb.append(" foo: ").append(toIndentedString(foo)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import java.util.NoSuchElementException;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
|
||||
*/
|
||||
@ApiModel(description = "Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.")
|
||||
@JsonPropertyOrder({
|
||||
HealthCheckResult.JSON_PROPERTY_NULLABLE_MESSAGE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class HealthCheckResult {
|
||||
public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage";
|
||||
private JsonNullable<String> nullableMessage = JsonNullable.<String>undefined();
|
||||
|
||||
|
||||
public HealthCheckResult nullableMessage(String nullableMessage) {
|
||||
this.nullableMessage = JsonNullable.<String>of(nullableMessage);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get nullableMessage
|
||||
* @return nullableMessage
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonIgnore
|
||||
|
||||
public String getNullableMessage() {
|
||||
return nullableMessage.orElse(null);
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public JsonNullable<String> getNullableMessage_JsonNullable() {
|
||||
return nullableMessage;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE)
|
||||
public void setNullableMessage_JsonNullable(JsonNullable<String> nullableMessage) {
|
||||
this.nullableMessage = nullableMessage;
|
||||
}
|
||||
|
||||
public void setNullableMessage(String nullableMessage) {
|
||||
this.nullableMessage = JsonNullable.<String>of(nullableMessage);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this HealthCheckResult object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
HealthCheckResult healthCheckResult = (HealthCheckResult) o;
|
||||
return Objects.equals(this.nullableMessage, healthCheckResult.nullableMessage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(nullableMessage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class HealthCheckResult {\n");
|
||||
sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* InlineObject
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
InlineObject.JSON_PROPERTY_NAME,
|
||||
InlineObject.JSON_PROPERTY_STATUS
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class InlineObject {
|
||||
public static final String JSON_PROPERTY_NAME = "name";
|
||||
private String name;
|
||||
|
||||
public static final String JSON_PROPERTY_STATUS = "status";
|
||||
private String status;
|
||||
|
||||
|
||||
public InlineObject name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updated name of the pet
|
||||
* @return name
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Updated name of the pet")
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public InlineObject status(String status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updated status of the pet
|
||||
* @return status
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Updated status of the pet")
|
||||
@JsonProperty(JSON_PROPERTY_STATUS)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this inline_object object is equal to o.
|
||||
*/
|
||||
@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.name, inlineObject.name) &&
|
||||
Objects.equals(this.status, inlineObject.status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class InlineObject {\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.File;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* InlineObject1
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
InlineObject1.JSON_PROPERTY_ADDITIONAL_METADATA,
|
||||
InlineObject1.JSON_PROPERTY_FILE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class InlineObject1 {
|
||||
public static final String JSON_PROPERTY_ADDITIONAL_METADATA = "additionalMetadata";
|
||||
private String additionalMetadata;
|
||||
|
||||
public static final String JSON_PROPERTY_FILE = "file";
|
||||
private File file;
|
||||
|
||||
|
||||
public InlineObject1 additionalMetadata(String additionalMetadata) {
|
||||
this.additionalMetadata = additionalMetadata;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional data to pass to server
|
||||
* @return additionalMetadata
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Additional data to pass to server")
|
||||
@JsonProperty(JSON_PROPERTY_ADDITIONAL_METADATA)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getAdditionalMetadata() {
|
||||
return additionalMetadata;
|
||||
}
|
||||
|
||||
|
||||
public void setAdditionalMetadata(String additionalMetadata) {
|
||||
this.additionalMetadata = additionalMetadata;
|
||||
}
|
||||
|
||||
|
||||
public InlineObject1 file(File file) {
|
||||
this.file = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* file to upload
|
||||
* @return file
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "file to upload")
|
||||
@JsonProperty(JSON_PROPERTY_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
public void setFile(File file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this inline_object_1 object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
InlineObject1 inlineObject1 = (InlineObject1) o;
|
||||
return Objects.equals(this.additionalMetadata, inlineObject1.additionalMetadata) &&
|
||||
Objects.equals(this.file, inlineObject1.file);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(additionalMetadata, file);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class InlineObject1 {\n");
|
||||
sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).append("\n");
|
||||
sb.append(" file: ").append(toIndentedString(file)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,220 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* InlineObject2
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
InlineObject2.JSON_PROPERTY_ENUM_FORM_STRING_ARRAY,
|
||||
InlineObject2.JSON_PROPERTY_ENUM_FORM_STRING
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class InlineObject2 {
|
||||
/**
|
||||
* Gets or Sets enumFormStringArray
|
||||
*/
|
||||
public enum EnumFormStringArrayEnum {
|
||||
GREATER_THAN(">"),
|
||||
|
||||
DOLLAR("$");
|
||||
|
||||
private String value;
|
||||
|
||||
EnumFormStringArrayEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static EnumFormStringArrayEnum fromValue(String value) {
|
||||
for (EnumFormStringArrayEnum b : EnumFormStringArrayEnum.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ENUM_FORM_STRING_ARRAY = "enum_form_string_array";
|
||||
private List<EnumFormStringArrayEnum> enumFormStringArray = null;
|
||||
|
||||
/**
|
||||
* Form parameter enum test (string)
|
||||
*/
|
||||
public enum EnumFormStringEnum {
|
||||
_ABC("_abc"),
|
||||
|
||||
_EFG("-efg"),
|
||||
|
||||
_XYZ_("(xyz)");
|
||||
|
||||
private String value;
|
||||
|
||||
EnumFormStringEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static EnumFormStringEnum fromValue(String value) {
|
||||
for (EnumFormStringEnum b : EnumFormStringEnum.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ENUM_FORM_STRING = "enum_form_string";
|
||||
private EnumFormStringEnum enumFormString = EnumFormStringEnum._EFG;
|
||||
|
||||
|
||||
public InlineObject2 enumFormStringArray(List<EnumFormStringArrayEnum> enumFormStringArray) {
|
||||
this.enumFormStringArray = enumFormStringArray;
|
||||
return this;
|
||||
}
|
||||
|
||||
public InlineObject2 addEnumFormStringArrayItem(EnumFormStringArrayEnum enumFormStringArrayItem) {
|
||||
if (this.enumFormStringArray == null) {
|
||||
this.enumFormStringArray = new ArrayList<>();
|
||||
}
|
||||
this.enumFormStringArray.add(enumFormStringArrayItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Form parameter enum test (string array)
|
||||
* @return enumFormStringArray
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Form parameter enum test (string array)")
|
||||
@JsonProperty(JSON_PROPERTY_ENUM_FORM_STRING_ARRAY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<EnumFormStringArrayEnum> getEnumFormStringArray() {
|
||||
return enumFormStringArray;
|
||||
}
|
||||
|
||||
|
||||
public void setEnumFormStringArray(List<EnumFormStringArrayEnum> enumFormStringArray) {
|
||||
this.enumFormStringArray = enumFormStringArray;
|
||||
}
|
||||
|
||||
|
||||
public InlineObject2 enumFormString(EnumFormStringEnum enumFormString) {
|
||||
this.enumFormString = enumFormString;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Form parameter enum test (string)
|
||||
* @return enumFormString
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Form parameter enum test (string)")
|
||||
@JsonProperty(JSON_PROPERTY_ENUM_FORM_STRING)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public EnumFormStringEnum getEnumFormString() {
|
||||
return enumFormString;
|
||||
}
|
||||
|
||||
|
||||
public void setEnumFormString(EnumFormStringEnum enumFormString) {
|
||||
this.enumFormString = enumFormString;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this inline_object_2 object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
InlineObject2 inlineObject2 = (InlineObject2) o;
|
||||
return Objects.equals(this.enumFormStringArray, inlineObject2.enumFormStringArray) &&
|
||||
Objects.equals(this.enumFormString, inlineObject2.enumFormString);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(enumFormStringArray, enumFormString);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class InlineObject2 {\n");
|
||||
sb.append(" enumFormStringArray: ").append(toIndentedString(enumFormStringArray)).append("\n");
|
||||
sb.append(" enumFormString: ").append(toIndentedString(enumFormString)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,507 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* InlineObject3
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
InlineObject3.JSON_PROPERTY_INTEGER,
|
||||
InlineObject3.JSON_PROPERTY_INT32,
|
||||
InlineObject3.JSON_PROPERTY_INT64,
|
||||
InlineObject3.JSON_PROPERTY_NUMBER,
|
||||
InlineObject3.JSON_PROPERTY_FLOAT,
|
||||
InlineObject3.JSON_PROPERTY_DOUBLE,
|
||||
InlineObject3.JSON_PROPERTY_STRING,
|
||||
InlineObject3.JSON_PROPERTY_PATTERN_WITHOUT_DELIMITER,
|
||||
InlineObject3.JSON_PROPERTY_BYTE,
|
||||
InlineObject3.JSON_PROPERTY_BINARY,
|
||||
InlineObject3.JSON_PROPERTY_DATE,
|
||||
InlineObject3.JSON_PROPERTY_DATE_TIME,
|
||||
InlineObject3.JSON_PROPERTY_PASSWORD,
|
||||
InlineObject3.JSON_PROPERTY_CALLBACK
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class InlineObject3 {
|
||||
public static final String JSON_PROPERTY_INTEGER = "integer";
|
||||
private Integer integer;
|
||||
|
||||
public static final String JSON_PROPERTY_INT32 = "int32";
|
||||
private Integer int32;
|
||||
|
||||
public static final String JSON_PROPERTY_INT64 = "int64";
|
||||
private Long int64;
|
||||
|
||||
public static final String JSON_PROPERTY_NUMBER = "number";
|
||||
private BigDecimal number;
|
||||
|
||||
public static final String JSON_PROPERTY_FLOAT = "float";
|
||||
private Float _float;
|
||||
|
||||
public static final String JSON_PROPERTY_DOUBLE = "double";
|
||||
private Double _double;
|
||||
|
||||
public static final String JSON_PROPERTY_STRING = "string";
|
||||
private String string;
|
||||
|
||||
public static final String JSON_PROPERTY_PATTERN_WITHOUT_DELIMITER = "pattern_without_delimiter";
|
||||
private String patternWithoutDelimiter;
|
||||
|
||||
public static final String JSON_PROPERTY_BYTE = "byte";
|
||||
private byte[] _byte;
|
||||
|
||||
public static final String JSON_PROPERTY_BINARY = "binary";
|
||||
private File binary;
|
||||
|
||||
public static final String JSON_PROPERTY_DATE = "date";
|
||||
private LocalDate date;
|
||||
|
||||
public static final String JSON_PROPERTY_DATE_TIME = "dateTime";
|
||||
private OffsetDateTime dateTime = OffsetDateTime.parse("2010-02-01T09:20:10.111110Z[UTC]", java.time.format.DateTimeFormatter.ISO_ZONED_DATE_TIME.withZone(java.time.ZoneId.systemDefault()));
|
||||
|
||||
public static final String JSON_PROPERTY_PASSWORD = "password";
|
||||
private String password;
|
||||
|
||||
public static final String JSON_PROPERTY_CALLBACK = "callback";
|
||||
private String callback;
|
||||
|
||||
|
||||
public InlineObject3 integer(Integer integer) {
|
||||
this.integer = integer;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* None
|
||||
* minimum: 10
|
||||
* maximum: 100
|
||||
* @return integer
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "None")
|
||||
@JsonProperty(JSON_PROPERTY_INTEGER)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Integer getInteger() {
|
||||
return integer;
|
||||
}
|
||||
|
||||
|
||||
public void setInteger(Integer integer) {
|
||||
this.integer = integer;
|
||||
}
|
||||
|
||||
|
||||
public InlineObject3 int32(Integer int32) {
|
||||
this.int32 = int32;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* None
|
||||
* minimum: 20
|
||||
* maximum: 200
|
||||
* @return int32
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "None")
|
||||
@JsonProperty(JSON_PROPERTY_INT32)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Integer getInt32() {
|
||||
return int32;
|
||||
}
|
||||
|
||||
|
||||
public void setInt32(Integer int32) {
|
||||
this.int32 = int32;
|
||||
}
|
||||
|
||||
|
||||
public InlineObject3 int64(Long int64) {
|
||||
this.int64 = int64;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* None
|
||||
* @return int64
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "None")
|
||||
@JsonProperty(JSON_PROPERTY_INT64)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Long getInt64() {
|
||||
return int64;
|
||||
}
|
||||
|
||||
|
||||
public void setInt64(Long int64) {
|
||||
this.int64 = int64;
|
||||
}
|
||||
|
||||
|
||||
public InlineObject3 number(BigDecimal number) {
|
||||
this.number = number;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* None
|
||||
* minimum: 32.1
|
||||
* maximum: 543.2
|
||||
* @return number
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "None")
|
||||
@JsonProperty(JSON_PROPERTY_NUMBER)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public BigDecimal getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
|
||||
public void setNumber(BigDecimal number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
|
||||
public InlineObject3 _float(Float _float) {
|
||||
this._float = _float;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* None
|
||||
* maximum: 987.6
|
||||
* @return _float
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "None")
|
||||
@JsonProperty(JSON_PROPERTY_FLOAT)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Float getFloat() {
|
||||
return _float;
|
||||
}
|
||||
|
||||
|
||||
public void setFloat(Float _float) {
|
||||
this._float = _float;
|
||||
}
|
||||
|
||||
|
||||
public InlineObject3 _double(Double _double) {
|
||||
this._double = _double;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* None
|
||||
* minimum: 67.8
|
||||
* maximum: 123.4
|
||||
* @return _double
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "None")
|
||||
@JsonProperty(JSON_PROPERTY_DOUBLE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public Double getDouble() {
|
||||
return _double;
|
||||
}
|
||||
|
||||
|
||||
public void setDouble(Double _double) {
|
||||
this._double = _double;
|
||||
}
|
||||
|
||||
|
||||
public InlineObject3 string(String string) {
|
||||
this.string = string;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* None
|
||||
* @return string
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "None")
|
||||
@JsonProperty(JSON_PROPERTY_STRING)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getString() {
|
||||
return string;
|
||||
}
|
||||
|
||||
|
||||
public void setString(String string) {
|
||||
this.string = string;
|
||||
}
|
||||
|
||||
|
||||
public InlineObject3 patternWithoutDelimiter(String patternWithoutDelimiter) {
|
||||
this.patternWithoutDelimiter = patternWithoutDelimiter;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* None
|
||||
* @return patternWithoutDelimiter
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "None")
|
||||
@JsonProperty(JSON_PROPERTY_PATTERN_WITHOUT_DELIMITER)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getPatternWithoutDelimiter() {
|
||||
return patternWithoutDelimiter;
|
||||
}
|
||||
|
||||
|
||||
public void setPatternWithoutDelimiter(String patternWithoutDelimiter) {
|
||||
this.patternWithoutDelimiter = patternWithoutDelimiter;
|
||||
}
|
||||
|
||||
|
||||
public InlineObject3 _byte(byte[] _byte) {
|
||||
this._byte = _byte;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* None
|
||||
* @return _byte
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "None")
|
||||
@JsonProperty(JSON_PROPERTY_BYTE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public byte[] getByte() {
|
||||
return _byte;
|
||||
}
|
||||
|
||||
|
||||
public void setByte(byte[] _byte) {
|
||||
this._byte = _byte;
|
||||
}
|
||||
|
||||
|
||||
public InlineObject3 binary(File binary) {
|
||||
this.binary = binary;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* None
|
||||
* @return binary
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "None")
|
||||
@JsonProperty(JSON_PROPERTY_BINARY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public File getBinary() {
|
||||
return binary;
|
||||
}
|
||||
|
||||
|
||||
public void setBinary(File binary) {
|
||||
this.binary = binary;
|
||||
}
|
||||
|
||||
|
||||
public InlineObject3 date(LocalDate date) {
|
||||
this.date = date;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* None
|
||||
* @return date
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "None")
|
||||
@JsonProperty(JSON_PROPERTY_DATE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public LocalDate getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
public void setDate(LocalDate date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
|
||||
public InlineObject3 dateTime(OffsetDateTime dateTime) {
|
||||
this.dateTime = dateTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* None
|
||||
* @return dateTime
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(example = "2020-02-02T20:20:20.222220Z", value = "None")
|
||||
@JsonProperty(JSON_PROPERTY_DATE_TIME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public OffsetDateTime getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
|
||||
|
||||
public void setDateTime(OffsetDateTime dateTime) {
|
||||
this.dateTime = dateTime;
|
||||
}
|
||||
|
||||
|
||||
public InlineObject3 password(String password) {
|
||||
this.password = password;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* None
|
||||
* @return password
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "None")
|
||||
@JsonProperty(JSON_PROPERTY_PASSWORD)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
|
||||
public InlineObject3 callback(String callback) {
|
||||
this.callback = callback;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* None
|
||||
* @return callback
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "None")
|
||||
@JsonProperty(JSON_PROPERTY_CALLBACK)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getCallback() {
|
||||
return callback;
|
||||
}
|
||||
|
||||
|
||||
public void setCallback(String callback) {
|
||||
this.callback = callback;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this inline_object_3 object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
InlineObject3 inlineObject3 = (InlineObject3) o;
|
||||
return Objects.equals(this.integer, inlineObject3.integer) &&
|
||||
Objects.equals(this.int32, inlineObject3.int32) &&
|
||||
Objects.equals(this.int64, inlineObject3.int64) &&
|
||||
Objects.equals(this.number, inlineObject3.number) &&
|
||||
Objects.equals(this._float, inlineObject3._float) &&
|
||||
Objects.equals(this._double, inlineObject3._double) &&
|
||||
Objects.equals(this.string, inlineObject3.string) &&
|
||||
Objects.equals(this.patternWithoutDelimiter, inlineObject3.patternWithoutDelimiter) &&
|
||||
Arrays.equals(this._byte, inlineObject3._byte) &&
|
||||
Objects.equals(this.binary, inlineObject3.binary) &&
|
||||
Objects.equals(this.date, inlineObject3.date) &&
|
||||
Objects.equals(this.dateTime, inlineObject3.dateTime) &&
|
||||
Objects.equals(this.password, inlineObject3.password) &&
|
||||
Objects.equals(this.callback, inlineObject3.callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(integer, int32, int64, number, _float, _double, string, patternWithoutDelimiter, Arrays.hashCode(_byte), binary, date, dateTime, password, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class InlineObject3 {\n");
|
||||
sb.append(" integer: ").append(toIndentedString(integer)).append("\n");
|
||||
sb.append(" int32: ").append(toIndentedString(int32)).append("\n");
|
||||
sb.append(" int64: ").append(toIndentedString(int64)).append("\n");
|
||||
sb.append(" number: ").append(toIndentedString(number)).append("\n");
|
||||
sb.append(" _float: ").append(toIndentedString(_float)).append("\n");
|
||||
sb.append(" _double: ").append(toIndentedString(_double)).append("\n");
|
||||
sb.append(" string: ").append(toIndentedString(string)).append("\n");
|
||||
sb.append(" patternWithoutDelimiter: ").append(toIndentedString(patternWithoutDelimiter)).append("\n");
|
||||
sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n");
|
||||
sb.append(" binary: ").append(toIndentedString(binary)).append("\n");
|
||||
sb.append(" date: ").append(toIndentedString(date)).append("\n");
|
||||
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
|
||||
sb.append(" password: ").append(toIndentedString(password)).append("\n");
|
||||
sb.append(" callback: ").append(toIndentedString(callback)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* InlineObject4
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
InlineObject4.JSON_PROPERTY_PARAM,
|
||||
InlineObject4.JSON_PROPERTY_PARAM2
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class InlineObject4 {
|
||||
public static final String JSON_PROPERTY_PARAM = "param";
|
||||
private String param;
|
||||
|
||||
public static final String JSON_PROPERTY_PARAM2 = "param2";
|
||||
private String param2;
|
||||
|
||||
|
||||
public InlineObject4 param(String param) {
|
||||
this.param = param;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* field1
|
||||
* @return param
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "field1")
|
||||
@JsonProperty(JSON_PROPERTY_PARAM)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getParam() {
|
||||
return param;
|
||||
}
|
||||
|
||||
|
||||
public void setParam(String param) {
|
||||
this.param = param;
|
||||
}
|
||||
|
||||
|
||||
public InlineObject4 param2(String param2) {
|
||||
this.param2 = param2;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* field2
|
||||
* @return param2
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "field2")
|
||||
@JsonProperty(JSON_PROPERTY_PARAM2)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getParam2() {
|
||||
return param2;
|
||||
}
|
||||
|
||||
|
||||
public void setParam2(String param2) {
|
||||
this.param2 = param2;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this inline_object_4 object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
InlineObject4 inlineObject4 = (InlineObject4) o;
|
||||
return Objects.equals(this.param, inlineObject4.param) &&
|
||||
Objects.equals(this.param2, inlineObject4.param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(param, param2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class InlineObject4 {\n");
|
||||
sb.append(" param: ").append(toIndentedString(param)).append("\n");
|
||||
sb.append(" param2: ").append(toIndentedString(param2)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.File;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* InlineObject5
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
InlineObject5.JSON_PROPERTY_ADDITIONAL_METADATA,
|
||||
InlineObject5.JSON_PROPERTY_REQUIRED_FILE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class InlineObject5 {
|
||||
public static final String JSON_PROPERTY_ADDITIONAL_METADATA = "additionalMetadata";
|
||||
private String additionalMetadata;
|
||||
|
||||
public static final String JSON_PROPERTY_REQUIRED_FILE = "requiredFile";
|
||||
private File requiredFile;
|
||||
|
||||
|
||||
public InlineObject5 additionalMetadata(String additionalMetadata) {
|
||||
this.additionalMetadata = additionalMetadata;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional data to pass to server
|
||||
* @return additionalMetadata
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Additional data to pass to server")
|
||||
@JsonProperty(JSON_PROPERTY_ADDITIONAL_METADATA)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getAdditionalMetadata() {
|
||||
return additionalMetadata;
|
||||
}
|
||||
|
||||
|
||||
public void setAdditionalMetadata(String additionalMetadata) {
|
||||
this.additionalMetadata = additionalMetadata;
|
||||
}
|
||||
|
||||
|
||||
public InlineObject5 requiredFile(File requiredFile) {
|
||||
this.requiredFile = requiredFile;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* file to upload
|
||||
* @return requiredFile
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "file to upload")
|
||||
@JsonProperty(JSON_PROPERTY_REQUIRED_FILE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public File getRequiredFile() {
|
||||
return requiredFile;
|
||||
}
|
||||
|
||||
|
||||
public void setRequiredFile(File requiredFile) {
|
||||
this.requiredFile = requiredFile;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this inline_object_5 object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
InlineObject5 inlineObject5 = (InlineObject5) o;
|
||||
return Objects.equals(this.additionalMetadata, inlineObject5.additionalMetadata) &&
|
||||
Objects.equals(this.requiredFile, inlineObject5.requiredFile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(additionalMetadata, requiredFile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class InlineObject5 {\n");
|
||||
sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).append("\n");
|
||||
sb.append(" requiredFile: ").append(toIndentedString(requiredFile)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.Foo;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* InlineResponseDefault
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
InlineResponseDefault.JSON_PROPERTY_STRING
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class InlineResponseDefault {
|
||||
public static final String JSON_PROPERTY_STRING = "string";
|
||||
private Foo string;
|
||||
|
||||
|
||||
public InlineResponseDefault string(Foo string) {
|
||||
this.string = string;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get string
|
||||
* @return string
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_STRING)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Foo getString() {
|
||||
return string;
|
||||
}
|
||||
|
||||
|
||||
public void setString(Foo string) {
|
||||
this.string = string;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this inline_response_default object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
InlineResponseDefault inlineResponseDefault = (InlineResponseDefault) o;
|
||||
return Objects.equals(this.string, inlineResponseDefault.string);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(string);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class InlineResponseDefault {\n");
|
||||
sb.append(" string: ").append(toIndentedString(string)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.ShapeInterface;
|
||||
import org.openapitools.client.model.TriangleInterface;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* IsoscelesTriangle
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
IsoscelesTriangle.JSON_PROPERTY_SHAPE_TYPE,
|
||||
IsoscelesTriangle.JSON_PROPERTY_TRIANGLE_TYPE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class IsoscelesTriangle {
|
||||
public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType";
|
||||
private String shapeType;
|
||||
|
||||
public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType";
|
||||
private String triangleType;
|
||||
|
||||
|
||||
public IsoscelesTriangle shapeType(String shapeType) {
|
||||
this.shapeType = shapeType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get shapeType
|
||||
* @return shapeType
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_SHAPE_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getShapeType() {
|
||||
return shapeType;
|
||||
}
|
||||
|
||||
|
||||
public void setShapeType(String shapeType) {
|
||||
this.shapeType = shapeType;
|
||||
}
|
||||
|
||||
|
||||
public IsoscelesTriangle triangleType(String triangleType) {
|
||||
this.triangleType = triangleType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get triangleType
|
||||
* @return triangleType
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getTriangleType() {
|
||||
return triangleType;
|
||||
}
|
||||
|
||||
|
||||
public void setTriangleType(String triangleType) {
|
||||
this.triangleType = triangleType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this IsoscelesTriangle object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
IsoscelesTriangle isoscelesTriangle = (IsoscelesTriangle) o;
|
||||
return Objects.equals(this.shapeType, isoscelesTriangle.shapeType) &&
|
||||
Objects.equals(this.triangleType, isoscelesTriangle.triangleType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(shapeType, triangleType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class IsoscelesTriangle {\n");
|
||||
sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n");
|
||||
sb.append(" triangleType: ").append(toIndentedString(triangleType)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,331 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.Pig;
|
||||
import org.openapitools.client.model.Whale;
|
||||
import org.openapitools.client.model.Zebra;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import javax.ws.rs.core.GenericType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.JsonToken;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.MapperFeature;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
|
||||
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonDeserialize(using = Mammal.MammalDeserializer.class)
|
||||
@JsonSerialize(using = Mammal.MammalSerializer.class)
|
||||
public class Mammal extends AbstractOpenApiSchema {
|
||||
private static final Logger log = Logger.getLogger(Mammal.class.getName());
|
||||
|
||||
public static class MammalSerializer extends StdSerializer<Mammal> {
|
||||
public MammalSerializer(Class<Mammal> t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
public MammalSerializer() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(Mammal value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
|
||||
jgen.writeObject(value.getActualInstance());
|
||||
}
|
||||
}
|
||||
|
||||
public static class MammalDeserializer extends StdDeserializer<Mammal> {
|
||||
public MammalDeserializer() {
|
||||
this(Mammal.class);
|
||||
}
|
||||
|
||||
public MammalDeserializer(Class<?> vc) {
|
||||
super(vc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
|
||||
JsonNode tree = jp.readValueAsTree();
|
||||
Object deserialized = null;
|
||||
Mammal newMammal = new Mammal();
|
||||
Map<String,Object> result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference<Map<String, Object>>() {});
|
||||
String discriminatorValue = (String)result2.get("className");
|
||||
switch (discriminatorValue) {
|
||||
case "Pig":
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Pig.class);
|
||||
newMammal.setActualInstance(deserialized);
|
||||
return newMammal;
|
||||
case "whale":
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Whale.class);
|
||||
newMammal.setActualInstance(deserialized);
|
||||
return newMammal;
|
||||
case "zebra":
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Zebra.class);
|
||||
newMammal.setActualInstance(deserialized);
|
||||
return newMammal;
|
||||
default:
|
||||
log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for Mammal. Possible values: Pig whale zebra", discriminatorValue));
|
||||
}
|
||||
|
||||
boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS);
|
||||
int match = 0;
|
||||
JsonToken token = tree.traverse(jp.getCodec()).nextToken();
|
||||
// deserialize Pig
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (Pig.class.equals(Integer.class) || Pig.class.equals(Long.class) || Pig.class.equals(Float.class) || Pig.class.equals(Double.class) || Pig.class.equals(Boolean.class) || Pig.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((Pig.class.equals(Integer.class) || Pig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((Pig.class.equals(Float.class) || Pig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (Pig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (Pig.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Pig.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'Pig'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'Pig'", e);
|
||||
}
|
||||
|
||||
// deserialize Whale
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (Whale.class.equals(Integer.class) || Whale.class.equals(Long.class) || Whale.class.equals(Float.class) || Whale.class.equals(Double.class) || Whale.class.equals(Boolean.class) || Whale.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((Whale.class.equals(Integer.class) || Whale.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((Whale.class.equals(Float.class) || Whale.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (Whale.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (Whale.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Whale.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'Whale'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'Whale'", e);
|
||||
}
|
||||
|
||||
// deserialize Zebra
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (Zebra.class.equals(Integer.class) || Zebra.class.equals(Long.class) || Zebra.class.equals(Float.class) || Zebra.class.equals(Double.class) || Zebra.class.equals(Boolean.class) || Zebra.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((Zebra.class.equals(Integer.class) || Zebra.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((Zebra.class.equals(Float.class) || Zebra.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (Zebra.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (Zebra.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Zebra.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'Zebra'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'Zebra'", e);
|
||||
}
|
||||
|
||||
if (match == 1) {
|
||||
Mammal ret = new Mammal();
|
||||
ret.setActualInstance(deserialized);
|
||||
return ret;
|
||||
}
|
||||
throw new IOException(String.format("Failed deserialization for Mammal: %d classes match result, expected 1", match));
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle deserialization of the 'null' value.
|
||||
*/
|
||||
@Override
|
||||
public Mammal getNullValue(DeserializationContext ctxt) throws JsonMappingException {
|
||||
throw new JsonMappingException(ctxt.getParser(), "Mammal cannot be null");
|
||||
}
|
||||
}
|
||||
|
||||
// store a list of schema names defined in oneOf
|
||||
public final static Map<String, GenericType> schemas = new HashMap<String, GenericType>();
|
||||
|
||||
public Mammal() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
}
|
||||
|
||||
public Mammal(Pig o) {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
public Mammal(Whale o) {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
public Mammal(Zebra o) {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
static {
|
||||
schemas.put("Pig", new GenericType<Pig>() {
|
||||
});
|
||||
schemas.put("Whale", new GenericType<Whale>() {
|
||||
});
|
||||
schemas.put("Zebra", new GenericType<Zebra>() {
|
||||
});
|
||||
JSON.registerDescendants(Mammal.class, Collections.unmodifiableMap(schemas));
|
||||
// Initialize and register the discriminator mappings.
|
||||
Map<String, Class<?>> mappings = new HashMap<String, Class<?>>();
|
||||
mappings.put("Pig", Pig.class);
|
||||
mappings.put("whale", Whale.class);
|
||||
mappings.put("zebra", Zebra.class);
|
||||
mappings.put("mammal", Mammal.class);
|
||||
JSON.registerDiscriminator(Mammal.class, "className", mappings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
return Mammal.schemas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the instance that matches the oneOf child schema, check
|
||||
* the instance parameter is valid against the oneOf child schemas:
|
||||
* Pig, Whale, Zebra
|
||||
*
|
||||
* It could be an instance of the 'oneOf' schemas.
|
||||
* The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf).
|
||||
*/
|
||||
@Override
|
||||
public void setActualInstance(Object instance) {
|
||||
if (JSON.isInstanceOf(Pig.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
if (JSON.isInstanceOf(Whale.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
if (JSON.isInstanceOf(Zebra.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
throw new RuntimeException("Invalid instance type. Must be Pig, Whale, Zebra");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance, which can be the following:
|
||||
* Pig, Whale, Zebra
|
||||
*
|
||||
* @return The actual instance (Pig, Whale, Zebra)
|
||||
*/
|
||||
@Override
|
||||
public Object getActualInstance() {
|
||||
return super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `Pig`. If the actual instanct is not `Pig`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `Pig`
|
||||
* @throws ClassCastException if the instance is not `Pig`
|
||||
*/
|
||||
public Pig getPig() throws ClassCastException {
|
||||
return (Pig)super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `Whale`. If the actual instanct is not `Whale`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `Whale`
|
||||
* @throws ClassCastException if the instance is not `Whale`
|
||||
*/
|
||||
public Whale getWhale() throws ClassCastException {
|
||||
return (Whale)super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `Zebra`. If the actual instanct is not `Zebra`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `Zebra`
|
||||
* @throws ClassCastException if the instance is not `Zebra`
|
||||
*/
|
||||
public Zebra getZebra() throws ClassCastException {
|
||||
return (Zebra)super.getActualInstance();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,236 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* MapTest
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING,
|
||||
MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING,
|
||||
MapTest.JSON_PROPERTY_DIRECT_MAP,
|
||||
MapTest.JSON_PROPERTY_INDIRECT_MAP
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class MapTest {
|
||||
public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string";
|
||||
private Map<String, Map<String, String>> mapMapOfString = null;
|
||||
|
||||
/**
|
||||
* Gets or Sets inner
|
||||
*/
|
||||
public enum InnerEnum {
|
||||
UPPER("UPPER"),
|
||||
|
||||
LOWER("lower");
|
||||
|
||||
private String value;
|
||||
|
||||
InnerEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static InnerEnum fromValue(String value) {
|
||||
for (InnerEnum b : InnerEnum.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string";
|
||||
private Map<String, InnerEnum> mapOfEnumString = null;
|
||||
|
||||
public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map";
|
||||
private Map<String, Boolean> directMap = null;
|
||||
|
||||
public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map";
|
||||
private Map<String, Boolean> indirectMap = null;
|
||||
|
||||
|
||||
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
|
||||
this.mapMapOfString = mapMapOfString;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mapMapOfString
|
||||
* @return mapMapOfString
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Map<String, Map<String, String>> getMapMapOfString() {
|
||||
return mapMapOfString;
|
||||
}
|
||||
|
||||
|
||||
public void setMapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
|
||||
this.mapMapOfString = mapMapOfString;
|
||||
}
|
||||
|
||||
|
||||
public MapTest mapOfEnumString(Map<String, InnerEnum> mapOfEnumString) {
|
||||
this.mapOfEnumString = mapOfEnumString;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mapOfEnumString
|
||||
* @return mapOfEnumString
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Map<String, InnerEnum> getMapOfEnumString() {
|
||||
return mapOfEnumString;
|
||||
}
|
||||
|
||||
|
||||
public void setMapOfEnumString(Map<String, InnerEnum> mapOfEnumString) {
|
||||
this.mapOfEnumString = mapOfEnumString;
|
||||
}
|
||||
|
||||
|
||||
public MapTest directMap(Map<String, Boolean> directMap) {
|
||||
this.directMap = directMap;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get directMap
|
||||
* @return directMap
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_DIRECT_MAP)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Map<String, Boolean> getDirectMap() {
|
||||
return directMap;
|
||||
}
|
||||
|
||||
|
||||
public void setDirectMap(Map<String, Boolean> directMap) {
|
||||
this.directMap = directMap;
|
||||
}
|
||||
|
||||
|
||||
public MapTest indirectMap(Map<String, Boolean> indirectMap) {
|
||||
this.indirectMap = indirectMap;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get indirectMap
|
||||
* @return indirectMap
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_INDIRECT_MAP)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Map<String, Boolean> getIndirectMap() {
|
||||
return indirectMap;
|
||||
}
|
||||
|
||||
|
||||
public void setIndirectMap(Map<String, Boolean> indirectMap) {
|
||||
this.indirectMap = indirectMap;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this MapTest object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
MapTest mapTest = (MapTest) o;
|
||||
return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
|
||||
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) &&
|
||||
Objects.equals(this.directMap, mapTest.directMap) &&
|
||||
Objects.equals(this.indirectMap, mapTest.indirectMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class MapTest {\n");
|
||||
sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
|
||||
sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
|
||||
sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n");
|
||||
sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import org.openapitools.client.model.Animal;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* MixedPropertiesAndAdditionalPropertiesClass
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID,
|
||||
MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME,
|
||||
MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
public static final String JSON_PROPERTY_UUID = "uuid";
|
||||
private UUID uuid;
|
||||
|
||||
public static final String JSON_PROPERTY_DATE_TIME = "dateTime";
|
||||
private OffsetDateTime dateTime;
|
||||
|
||||
public static final String JSON_PROPERTY_MAP = "map";
|
||||
private Map<String, Animal> map = null;
|
||||
|
||||
|
||||
public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) {
|
||||
this.uuid = uuid;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get uuid
|
||||
* @return uuid
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_UUID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public UUID getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
|
||||
public void setUuid(UUID uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
|
||||
public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) {
|
||||
this.dateTime = dateTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dateTime
|
||||
* @return dateTime
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_DATE_TIME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public OffsetDateTime getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
|
||||
|
||||
public void setDateTime(OffsetDateTime dateTime) {
|
||||
this.dateTime = dateTime;
|
||||
}
|
||||
|
||||
|
||||
public MixedPropertiesAndAdditionalPropertiesClass map(Map<String, Animal> map) {
|
||||
this.map = map;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get map
|
||||
* @return map
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_MAP)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Map<String, Animal> getMap() {
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
public void setMap(Map<String, Animal> map) {
|
||||
this.map = map;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this MixedPropertiesAndAdditionalPropertiesClass object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o;
|
||||
return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) &&
|
||||
Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) &&
|
||||
Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(uuid, dateTime, map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n");
|
||||
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
|
||||
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
|
||||
sb.append(" map: ").append(toIndentedString(map)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Model for testing model name starting with number
|
||||
*/
|
||||
@ApiModel(description = "Model for testing model name starting with number")
|
||||
@JsonPropertyOrder({
|
||||
Model200Response.JSON_PROPERTY_NAME,
|
||||
Model200Response.JSON_PROPERTY_PROPERTY_CLASS
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Model200Response {
|
||||
public static final String JSON_PROPERTY_NAME = "name";
|
||||
private Integer name;
|
||||
|
||||
public static final String JSON_PROPERTY_PROPERTY_CLASS = "class";
|
||||
private String propertyClass;
|
||||
|
||||
|
||||
public Model200Response name(Integer name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
public void setName(Integer name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public Model200Response propertyClass(String propertyClass) {
|
||||
this.propertyClass = propertyClass;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get propertyClass
|
||||
* @return propertyClass
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_PROPERTY_CLASS)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getPropertyClass() {
|
||||
return propertyClass;
|
||||
}
|
||||
|
||||
|
||||
public void setPropertyClass(String propertyClass) {
|
||||
this.propertyClass = propertyClass;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this 200_response object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Model200Response _200response = (Model200Response) o;
|
||||
return Objects.equals(this.name, _200response.name) &&
|
||||
Objects.equals(this.propertyClass, _200response.propertyClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, propertyClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Model200Response {\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* ModelApiResponse
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ModelApiResponse.JSON_PROPERTY_CODE,
|
||||
ModelApiResponse.JSON_PROPERTY_TYPE,
|
||||
ModelApiResponse.JSON_PROPERTY_MESSAGE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelApiResponse {
|
||||
public static final String JSON_PROPERTY_CODE = "code";
|
||||
private Integer code;
|
||||
|
||||
public static final String JSON_PROPERTY_TYPE = "type";
|
||||
private String type;
|
||||
|
||||
public static final String JSON_PROPERTY_MESSAGE = "message";
|
||||
private String message;
|
||||
|
||||
|
||||
public ModelApiResponse code(Integer code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get code
|
||||
* @return code
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_CODE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
|
||||
public void setCode(Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
|
||||
public ModelApiResponse type(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type
|
||||
* @return type
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
public ModelApiResponse message(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get message
|
||||
* @return message
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_MESSAGE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this ApiResponse object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelApiResponse _apiResponse = (ModelApiResponse) o;
|
||||
return Objects.equals(this.code, _apiResponse.code) &&
|
||||
Objects.equals(this.type, _apiResponse.type) &&
|
||||
Objects.equals(this.message, _apiResponse.message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(code, type, message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelApiResponse {\n");
|
||||
sb.append(" code: ").append(toIndentedString(code)).append("\n");
|
||||
sb.append(" type: ").append(toIndentedString(type)).append("\n");
|
||||
sb.append(" message: ").append(toIndentedString(message)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Model for testing reserved words
|
||||
*/
|
||||
@ApiModel(description = "Model for testing reserved words")
|
||||
@JsonPropertyOrder({
|
||||
ModelReturn.JSON_PROPERTY_RETURN
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelReturn {
|
||||
public static final String JSON_PROPERTY_RETURN = "return";
|
||||
private Integer _return;
|
||||
|
||||
|
||||
public ModelReturn _return(Integer _return) {
|
||||
this._return = _return;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _return
|
||||
* @return _return
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_RETURN)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Integer getReturn() {
|
||||
return _return;
|
||||
}
|
||||
|
||||
|
||||
public void setReturn(Integer _return) {
|
||||
this._return = _return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this Return object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelReturn _return = (ModelReturn) o;
|
||||
return Objects.equals(this._return, _return._return);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(_return);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelReturn {\n");
|
||||
sb.append(" _return: ").append(toIndentedString(_return)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Model for testing model name same as property name
|
||||
*/
|
||||
@ApiModel(description = "Model for testing model name same as property name")
|
||||
@JsonPropertyOrder({
|
||||
Name.JSON_PROPERTY_NAME,
|
||||
Name.JSON_PROPERTY_SNAKE_CASE,
|
||||
Name.JSON_PROPERTY_PROPERTY,
|
||||
Name.JSON_PROPERTY_123NUMBER
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Name {
|
||||
public static final String JSON_PROPERTY_NAME = "name";
|
||||
private Integer name;
|
||||
|
||||
public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case";
|
||||
private Integer snakeCase;
|
||||
|
||||
public static final String JSON_PROPERTY_PROPERTY = "property";
|
||||
private String property;
|
||||
|
||||
public static final String JSON_PROPERTY_123NUMBER = "123Number";
|
||||
private Integer _123number;
|
||||
|
||||
|
||||
public Name name(Integer name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
public void setName(Integer name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get snakeCase
|
||||
* @return snakeCase
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_SNAKE_CASE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Integer getSnakeCase() {
|
||||
return snakeCase;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public Name property(String property) {
|
||||
this.property = property;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get property
|
||||
* @return property
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_PROPERTY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getProperty() {
|
||||
return property;
|
||||
}
|
||||
|
||||
|
||||
public void setProperty(String property) {
|
||||
this.property = property;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get _123number
|
||||
* @return _123number
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_123NUMBER)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Integer get123number() {
|
||||
return _123number;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this Name object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Name name = (Name) o;
|
||||
return Objects.equals(this.name, name.name) &&
|
||||
Objects.equals(this.snakeCase, name.snakeCase) &&
|
||||
Objects.equals(this.property, name.property) &&
|
||||
Objects.equals(this._123number, name._123number);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, snakeCase, property, _123number);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Name {\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n");
|
||||
sb.append(" property: ").append(toIndentedString(property)).append("\n");
|
||||
sb.append(" _123number: ").append(toIndentedString(_123number)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,625 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonAnyGetter;
|
||||
import com.fasterxml.jackson.annotation.JsonAnySetter;
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import java.util.NoSuchElementException;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* NullableClass
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
NullableClass.JSON_PROPERTY_INTEGER_PROP,
|
||||
NullableClass.JSON_PROPERTY_NUMBER_PROP,
|
||||
NullableClass.JSON_PROPERTY_BOOLEAN_PROP,
|
||||
NullableClass.JSON_PROPERTY_STRING_PROP,
|
||||
NullableClass.JSON_PROPERTY_DATE_PROP,
|
||||
NullableClass.JSON_PROPERTY_DATETIME_PROP,
|
||||
NullableClass.JSON_PROPERTY_ARRAY_NULLABLE_PROP,
|
||||
NullableClass.JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP,
|
||||
NullableClass.JSON_PROPERTY_ARRAY_ITEMS_NULLABLE,
|
||||
NullableClass.JSON_PROPERTY_OBJECT_NULLABLE_PROP,
|
||||
NullableClass.JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP,
|
||||
NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class NullableClass extends HashMap<String, Object> {
|
||||
public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop";
|
||||
private JsonNullable<Integer> integerProp = JsonNullable.<Integer>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_NUMBER_PROP = "number_prop";
|
||||
private JsonNullable<BigDecimal> numberProp = JsonNullable.<BigDecimal>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_BOOLEAN_PROP = "boolean_prop";
|
||||
private JsonNullable<Boolean> booleanProp = JsonNullable.<Boolean>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_STRING_PROP = "string_prop";
|
||||
private JsonNullable<String> stringProp = JsonNullable.<String>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_DATE_PROP = "date_prop";
|
||||
private JsonNullable<LocalDate> dateProp = JsonNullable.<LocalDate>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_DATETIME_PROP = "datetime_prop";
|
||||
private JsonNullable<OffsetDateTime> datetimeProp = JsonNullable.<OffsetDateTime>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_NULLABLE_PROP = "array_nullable_prop";
|
||||
private JsonNullable<List<Object>> arrayNullableProp = JsonNullable.<List<Object>>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP = "array_and_items_nullable_prop";
|
||||
private JsonNullable<List<Object>> arrayAndItemsNullableProp = JsonNullable.<List<Object>>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable";
|
||||
private List<Object> arrayItemsNullable = null;
|
||||
|
||||
public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop";
|
||||
private JsonNullable<Map<String, Object>> objectNullableProp = JsonNullable.<Map<String, Object>>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP = "object_and_items_nullable_prop";
|
||||
private JsonNullable<Map<String, Object>> objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_OBJECT_ITEMS_NULLABLE = "object_items_nullable";
|
||||
private Map<String, Object> objectItemsNullable = null;
|
||||
|
||||
|
||||
public NullableClass integerProp(Integer integerProp) {
|
||||
this.integerProp = JsonNullable.<Integer>of(integerProp);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get integerProp
|
||||
* @return integerProp
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonIgnore
|
||||
|
||||
public Integer getIntegerProp() {
|
||||
return integerProp.orElse(null);
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_INTEGER_PROP)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public JsonNullable<Integer> getIntegerProp_JsonNullable() {
|
||||
return integerProp;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_INTEGER_PROP)
|
||||
public void setIntegerProp_JsonNullable(JsonNullable<Integer> integerProp) {
|
||||
this.integerProp = integerProp;
|
||||
}
|
||||
|
||||
public void setIntegerProp(Integer integerProp) {
|
||||
this.integerProp = JsonNullable.<Integer>of(integerProp);
|
||||
}
|
||||
|
||||
|
||||
public NullableClass numberProp(BigDecimal numberProp) {
|
||||
this.numberProp = JsonNullable.<BigDecimal>of(numberProp);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get numberProp
|
||||
* @return numberProp
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonIgnore
|
||||
|
||||
public BigDecimal getNumberProp() {
|
||||
return numberProp.orElse(null);
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_NUMBER_PROP)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public JsonNullable<BigDecimal> getNumberProp_JsonNullable() {
|
||||
return numberProp;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_NUMBER_PROP)
|
||||
public void setNumberProp_JsonNullable(JsonNullable<BigDecimal> numberProp) {
|
||||
this.numberProp = numberProp;
|
||||
}
|
||||
|
||||
public void setNumberProp(BigDecimal numberProp) {
|
||||
this.numberProp = JsonNullable.<BigDecimal>of(numberProp);
|
||||
}
|
||||
|
||||
|
||||
public NullableClass booleanProp(Boolean booleanProp) {
|
||||
this.booleanProp = JsonNullable.<Boolean>of(booleanProp);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get booleanProp
|
||||
* @return booleanProp
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonIgnore
|
||||
|
||||
public Boolean getBooleanProp() {
|
||||
return booleanProp.orElse(null);
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_BOOLEAN_PROP)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public JsonNullable<Boolean> getBooleanProp_JsonNullable() {
|
||||
return booleanProp;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_BOOLEAN_PROP)
|
||||
public void setBooleanProp_JsonNullable(JsonNullable<Boolean> booleanProp) {
|
||||
this.booleanProp = booleanProp;
|
||||
}
|
||||
|
||||
public void setBooleanProp(Boolean booleanProp) {
|
||||
this.booleanProp = JsonNullable.<Boolean>of(booleanProp);
|
||||
}
|
||||
|
||||
|
||||
public NullableClass stringProp(String stringProp) {
|
||||
this.stringProp = JsonNullable.<String>of(stringProp);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get stringProp
|
||||
* @return stringProp
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonIgnore
|
||||
|
||||
public String getStringProp() {
|
||||
return stringProp.orElse(null);
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_STRING_PROP)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public JsonNullable<String> getStringProp_JsonNullable() {
|
||||
return stringProp;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_STRING_PROP)
|
||||
public void setStringProp_JsonNullable(JsonNullable<String> stringProp) {
|
||||
this.stringProp = stringProp;
|
||||
}
|
||||
|
||||
public void setStringProp(String stringProp) {
|
||||
this.stringProp = JsonNullable.<String>of(stringProp);
|
||||
}
|
||||
|
||||
|
||||
public NullableClass dateProp(LocalDate dateProp) {
|
||||
this.dateProp = JsonNullable.<LocalDate>of(dateProp);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dateProp
|
||||
* @return dateProp
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonIgnore
|
||||
|
||||
public LocalDate getDateProp() {
|
||||
return dateProp.orElse(null);
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_DATE_PROP)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public JsonNullable<LocalDate> getDateProp_JsonNullable() {
|
||||
return dateProp;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_DATE_PROP)
|
||||
public void setDateProp_JsonNullable(JsonNullable<LocalDate> dateProp) {
|
||||
this.dateProp = dateProp;
|
||||
}
|
||||
|
||||
public void setDateProp(LocalDate dateProp) {
|
||||
this.dateProp = JsonNullable.<LocalDate>of(dateProp);
|
||||
}
|
||||
|
||||
|
||||
public NullableClass datetimeProp(OffsetDateTime datetimeProp) {
|
||||
this.datetimeProp = JsonNullable.<OffsetDateTime>of(datetimeProp);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get datetimeProp
|
||||
* @return datetimeProp
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonIgnore
|
||||
|
||||
public OffsetDateTime getDatetimeProp() {
|
||||
return datetimeProp.orElse(null);
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_DATETIME_PROP)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public JsonNullable<OffsetDateTime> getDatetimeProp_JsonNullable() {
|
||||
return datetimeProp;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_DATETIME_PROP)
|
||||
public void setDatetimeProp_JsonNullable(JsonNullable<OffsetDateTime> datetimeProp) {
|
||||
this.datetimeProp = datetimeProp;
|
||||
}
|
||||
|
||||
public void setDatetimeProp(OffsetDateTime datetimeProp) {
|
||||
this.datetimeProp = JsonNullable.<OffsetDateTime>of(datetimeProp);
|
||||
}
|
||||
|
||||
|
||||
public NullableClass arrayNullableProp(List<Object> arrayNullableProp) {
|
||||
this.arrayNullableProp = JsonNullable.<List<Object>>of(arrayNullableProp);
|
||||
return this;
|
||||
}
|
||||
|
||||
public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) {
|
||||
if (this.arrayNullableProp == null || !this.arrayNullableProp.isPresent()) {
|
||||
this.arrayNullableProp = JsonNullable.<List<Object>>of(new ArrayList<>());
|
||||
}
|
||||
try {
|
||||
this.arrayNullableProp.get().add(arrayNullablePropItem);
|
||||
} catch (java.util.NoSuchElementException e) {
|
||||
// this can never happen, as we make sure above that the value is present
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayNullableProp
|
||||
* @return arrayNullableProp
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonIgnore
|
||||
|
||||
public List<Object> getArrayNullableProp() {
|
||||
return arrayNullableProp.orElse(null);
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public JsonNullable<List<Object>> getArrayNullableProp_JsonNullable() {
|
||||
return arrayNullableProp;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP)
|
||||
public void setArrayNullableProp_JsonNullable(JsonNullable<List<Object>> arrayNullableProp) {
|
||||
this.arrayNullableProp = arrayNullableProp;
|
||||
}
|
||||
|
||||
public void setArrayNullableProp(List<Object> arrayNullableProp) {
|
||||
this.arrayNullableProp = JsonNullable.<List<Object>>of(arrayNullableProp);
|
||||
}
|
||||
|
||||
|
||||
public NullableClass arrayAndItemsNullableProp(List<Object> arrayAndItemsNullableProp) {
|
||||
this.arrayAndItemsNullableProp = JsonNullable.<List<Object>>of(arrayAndItemsNullableProp);
|
||||
return this;
|
||||
}
|
||||
|
||||
public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) {
|
||||
if (this.arrayAndItemsNullableProp == null || !this.arrayAndItemsNullableProp.isPresent()) {
|
||||
this.arrayAndItemsNullableProp = JsonNullable.<List<Object>>of(new ArrayList<>());
|
||||
}
|
||||
try {
|
||||
this.arrayAndItemsNullableProp.get().add(arrayAndItemsNullablePropItem);
|
||||
} catch (java.util.NoSuchElementException e) {
|
||||
// this can never happen, as we make sure above that the value is present
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayAndItemsNullableProp
|
||||
* @return arrayAndItemsNullableProp
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonIgnore
|
||||
|
||||
public List<Object> getArrayAndItemsNullableProp() {
|
||||
return arrayAndItemsNullableProp.orElse(null);
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public JsonNullable<List<Object>> getArrayAndItemsNullableProp_JsonNullable() {
|
||||
return arrayAndItemsNullableProp;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP)
|
||||
public void setArrayAndItemsNullableProp_JsonNullable(JsonNullable<List<Object>> arrayAndItemsNullableProp) {
|
||||
this.arrayAndItemsNullableProp = arrayAndItemsNullableProp;
|
||||
}
|
||||
|
||||
public void setArrayAndItemsNullableProp(List<Object> arrayAndItemsNullableProp) {
|
||||
this.arrayAndItemsNullableProp = JsonNullable.<List<Object>>of(arrayAndItemsNullableProp);
|
||||
}
|
||||
|
||||
|
||||
public NullableClass arrayItemsNullable(List<Object> arrayItemsNullable) {
|
||||
this.arrayItemsNullable = arrayItemsNullable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) {
|
||||
if (this.arrayItemsNullable == null) {
|
||||
this.arrayItemsNullable = new ArrayList<>();
|
||||
}
|
||||
this.arrayItemsNullable.add(arrayItemsNullableItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayItemsNullable
|
||||
* @return arrayItemsNullable
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<Object> getArrayItemsNullable() {
|
||||
return arrayItemsNullable;
|
||||
}
|
||||
|
||||
|
||||
public void setArrayItemsNullable(List<Object> arrayItemsNullable) {
|
||||
this.arrayItemsNullable = arrayItemsNullable;
|
||||
}
|
||||
|
||||
|
||||
public NullableClass objectNullableProp(Map<String, Object> objectNullableProp) {
|
||||
this.objectNullableProp = JsonNullable.<Map<String, Object>>of(objectNullableProp);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get objectNullableProp
|
||||
* @return objectNullableProp
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonIgnore
|
||||
|
||||
public Map<String, Object> getObjectNullableProp() {
|
||||
return objectNullableProp.orElse(null);
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public JsonNullable<Map<String, Object>> getObjectNullableProp_JsonNullable() {
|
||||
return objectNullableProp;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP)
|
||||
public void setObjectNullableProp_JsonNullable(JsonNullable<Map<String, Object>> objectNullableProp) {
|
||||
this.objectNullableProp = objectNullableProp;
|
||||
}
|
||||
|
||||
public void setObjectNullableProp(Map<String, Object> objectNullableProp) {
|
||||
this.objectNullableProp = JsonNullable.<Map<String, Object>>of(objectNullableProp);
|
||||
}
|
||||
|
||||
|
||||
public NullableClass objectAndItemsNullableProp(Map<String, Object> objectAndItemsNullableProp) {
|
||||
this.objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>of(objectAndItemsNullableProp);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get objectAndItemsNullableProp
|
||||
* @return objectAndItemsNullableProp
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonIgnore
|
||||
|
||||
public Map<String, Object> getObjectAndItemsNullableProp() {
|
||||
return objectAndItemsNullableProp.orElse(null);
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP)
|
||||
@JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public JsonNullable<Map<String, Object>> getObjectAndItemsNullableProp_JsonNullable() {
|
||||
return objectAndItemsNullableProp;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP)
|
||||
public void setObjectAndItemsNullableProp_JsonNullable(JsonNullable<Map<String, Object>> objectAndItemsNullableProp) {
|
||||
this.objectAndItemsNullableProp = objectAndItemsNullableProp;
|
||||
}
|
||||
|
||||
public void setObjectAndItemsNullableProp(Map<String, Object> objectAndItemsNullableProp) {
|
||||
this.objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>of(objectAndItemsNullableProp);
|
||||
}
|
||||
|
||||
|
||||
public NullableClass objectItemsNullable(Map<String, Object> objectItemsNullable) {
|
||||
this.objectItemsNullable = objectItemsNullable;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get objectItemsNullable
|
||||
* @return objectItemsNullable
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE)
|
||||
@JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Map<String, Object> getObjectItemsNullable() {
|
||||
return objectItemsNullable;
|
||||
}
|
||||
|
||||
|
||||
public void setObjectItemsNullable(Map<String, Object> objectItemsNullable) {
|
||||
this.objectItemsNullable = objectItemsNullable;
|
||||
}
|
||||
|
||||
/**
|
||||
* A container for additional, undeclared properties.
|
||||
* This is a holder for any undeclared properties as specified with
|
||||
* the 'additionalProperties' keyword in the OAS document.
|
||||
*/
|
||||
private Map<String, Object> additionalProperties;
|
||||
|
||||
/**
|
||||
* Set the additional (undeclared) property with the specified name and value.
|
||||
* If the property does not already exist, create it otherwise replace it.
|
||||
*/
|
||||
@JsonAnySetter
|
||||
public NullableClass putAdditionalProperty(String key, Object value) {
|
||||
if (this.additionalProperties == null) {
|
||||
this.additionalProperties = new HashMap<String, Object>();
|
||||
}
|
||||
this.additionalProperties.put(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the additional (undeclared) property.
|
||||
*/
|
||||
@JsonAnyGetter
|
||||
public Map<String, Object> getAdditionalProperties() {
|
||||
return additionalProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the additional (undeclared) property with the specified name.
|
||||
*/
|
||||
public Object getAdditionalProperty(String key) {
|
||||
if (this.additionalProperties == null) {
|
||||
return null;
|
||||
}
|
||||
return this.additionalProperties.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this NullableClass object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
NullableClass nullableClass = (NullableClass) o;
|
||||
return Objects.equals(this.integerProp, nullableClass.integerProp) &&
|
||||
Objects.equals(this.numberProp, nullableClass.numberProp) &&
|
||||
Objects.equals(this.booleanProp, nullableClass.booleanProp) &&
|
||||
Objects.equals(this.stringProp, nullableClass.stringProp) &&
|
||||
Objects.equals(this.dateProp, nullableClass.dateProp) &&
|
||||
Objects.equals(this.datetimeProp, nullableClass.datetimeProp) &&
|
||||
Objects.equals(this.arrayNullableProp, nullableClass.arrayNullableProp) &&
|
||||
Objects.equals(this.arrayAndItemsNullableProp, nullableClass.arrayAndItemsNullableProp) &&
|
||||
Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) &&
|
||||
Objects.equals(this.objectNullableProp, nullableClass.objectNullableProp) &&
|
||||
Objects.equals(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) &&
|
||||
Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable)&&
|
||||
Objects.equals(this.additionalProperties, nullableClass.additionalProperties) &&
|
||||
super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(integerProp, numberProp, booleanProp, stringProp, dateProp, datetimeProp, arrayNullableProp, arrayAndItemsNullableProp, arrayItemsNullable, objectNullableProp, objectAndItemsNullableProp, objectItemsNullable, super.hashCode(), additionalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class NullableClass {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n");
|
||||
sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n");
|
||||
sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n");
|
||||
sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n");
|
||||
sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n");
|
||||
sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n");
|
||||
sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n");
|
||||
sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n");
|
||||
sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n");
|
||||
sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n");
|
||||
sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n");
|
||||
sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n");
|
||||
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,283 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.Quadrilateral;
|
||||
import org.openapitools.client.model.Triangle;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import javax.ws.rs.core.GenericType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.JsonToken;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.MapperFeature;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
|
||||
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonDeserialize(using = NullableShape.NullableShapeDeserializer.class)
|
||||
@JsonSerialize(using = NullableShape.NullableShapeSerializer.class)
|
||||
public class NullableShape extends AbstractOpenApiSchema {
|
||||
private static final Logger log = Logger.getLogger(NullableShape.class.getName());
|
||||
|
||||
public static class NullableShapeSerializer extends StdSerializer<NullableShape> {
|
||||
public NullableShapeSerializer(Class<NullableShape> t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
public NullableShapeSerializer() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(NullableShape value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
|
||||
jgen.writeObject(value.getActualInstance());
|
||||
}
|
||||
}
|
||||
|
||||
public static class NullableShapeDeserializer extends StdDeserializer<NullableShape> {
|
||||
public NullableShapeDeserializer() {
|
||||
this(NullableShape.class);
|
||||
}
|
||||
|
||||
public NullableShapeDeserializer(Class<?> vc) {
|
||||
super(vc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
|
||||
JsonNode tree = jp.readValueAsTree();
|
||||
Object deserialized = null;
|
||||
NullableShape newNullableShape = new NullableShape();
|
||||
Map<String,Object> result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference<Map<String, Object>>() {});
|
||||
String discriminatorValue = (String)result2.get("shapeType");
|
||||
switch (discriminatorValue) {
|
||||
case "Quadrilateral":
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class);
|
||||
newNullableShape.setActualInstance(deserialized);
|
||||
return newNullableShape;
|
||||
case "Triangle":
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class);
|
||||
newNullableShape.setActualInstance(deserialized);
|
||||
return newNullableShape;
|
||||
default:
|
||||
log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for NullableShape. Possible values: Quadrilateral Triangle", discriminatorValue));
|
||||
}
|
||||
|
||||
boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS);
|
||||
int match = 0;
|
||||
JsonToken token = tree.traverse(jp.getCodec()).nextToken();
|
||||
// deserialize Quadrilateral
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
attemptParsing |= (token == JsonToken.VALUE_NULL);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'Quadrilateral'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'Quadrilateral'", e);
|
||||
}
|
||||
|
||||
// deserialize Triangle
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
attemptParsing |= (token == JsonToken.VALUE_NULL);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'Triangle'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'Triangle'", e);
|
||||
}
|
||||
|
||||
if (match == 1) {
|
||||
NullableShape ret = new NullableShape();
|
||||
ret.setActualInstance(deserialized);
|
||||
return ret;
|
||||
}
|
||||
throw new IOException(String.format("Failed deserialization for NullableShape: %d classes match result, expected 1", match));
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle deserialization of the 'null' value.
|
||||
*/
|
||||
@Override
|
||||
public NullableShape getNullValue(DeserializationContext ctxt) throws JsonMappingException {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// store a list of schema names defined in oneOf
|
||||
public final static Map<String, GenericType> schemas = new HashMap<String, GenericType>();
|
||||
|
||||
public NullableShape() {
|
||||
super("oneOf", Boolean.TRUE);
|
||||
}
|
||||
|
||||
public NullableShape(Quadrilateral o) {
|
||||
super("oneOf", Boolean.TRUE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
public NullableShape(Triangle o) {
|
||||
super("oneOf", Boolean.TRUE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
static {
|
||||
schemas.put("Quadrilateral", new GenericType<Quadrilateral>() {
|
||||
});
|
||||
schemas.put("Triangle", new GenericType<Triangle>() {
|
||||
});
|
||||
JSON.registerDescendants(NullableShape.class, Collections.unmodifiableMap(schemas));
|
||||
// Initialize and register the discriminator mappings.
|
||||
Map<String, Class<?>> mappings = new HashMap<String, Class<?>>();
|
||||
mappings.put("Quadrilateral", Quadrilateral.class);
|
||||
mappings.put("Triangle", Triangle.class);
|
||||
mappings.put("NullableShape", NullableShape.class);
|
||||
JSON.registerDiscriminator(NullableShape.class, "shapeType", mappings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
return NullableShape.schemas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the instance that matches the oneOf child schema, check
|
||||
* the instance parameter is valid against the oneOf child schemas:
|
||||
* Quadrilateral, Triangle
|
||||
*
|
||||
* It could be an instance of the 'oneOf' schemas.
|
||||
* The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf).
|
||||
*/
|
||||
@Override
|
||||
public void setActualInstance(Object instance) {
|
||||
if (instance == null) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
if (JSON.isInstanceOf(Triangle.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
throw new RuntimeException("Invalid instance type. Must be Quadrilateral, Triangle");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance, which can be the following:
|
||||
* Quadrilateral, Triangle
|
||||
*
|
||||
* @return The actual instance (Quadrilateral, Triangle)
|
||||
*/
|
||||
@Override
|
||||
public Object getActualInstance() {
|
||||
return super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `Quadrilateral`. If the actual instanct is not `Quadrilateral`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `Quadrilateral`
|
||||
* @throws ClassCastException if the instance is not `Quadrilateral`
|
||||
*/
|
||||
public Quadrilateral getQuadrilateral() throws ClassCastException {
|
||||
return (Quadrilateral)super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `Triangle`. If the actual instanct is not `Triangle`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `Triangle`
|
||||
* @throws ClassCastException if the instance is not `Triangle`
|
||||
*/
|
||||
public Triangle getTriangle() throws ClassCastException {
|
||||
return (Triangle)super.getActualInstance();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* NumberOnly
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
NumberOnly.JSON_PROPERTY_JUST_NUMBER
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class NumberOnly {
|
||||
public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber";
|
||||
private BigDecimal justNumber;
|
||||
|
||||
|
||||
public NumberOnly justNumber(BigDecimal justNumber) {
|
||||
this.justNumber = justNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get justNumber
|
||||
* @return justNumber
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_JUST_NUMBER)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public BigDecimal getJustNumber() {
|
||||
return justNumber;
|
||||
}
|
||||
|
||||
|
||||
public void setJustNumber(BigDecimal justNumber) {
|
||||
this.justNumber = justNumber;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this NumberOnly object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
NumberOnly numberOnly = (NumberOnly) o;
|
||||
return Objects.equals(this.justNumber, numberOnly.justNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(justNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class NumberOnly {\n");
|
||||
sb.append(" justNumber: ").append(toIndentedString(justNumber)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,296 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.time.OffsetDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Order
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
Order.JSON_PROPERTY_ID,
|
||||
Order.JSON_PROPERTY_PET_ID,
|
||||
Order.JSON_PROPERTY_QUANTITY,
|
||||
Order.JSON_PROPERTY_SHIP_DATE,
|
||||
Order.JSON_PROPERTY_STATUS,
|
||||
Order.JSON_PROPERTY_COMPLETE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Order {
|
||||
public static final String JSON_PROPERTY_ID = "id";
|
||||
private Long id;
|
||||
|
||||
public static final String JSON_PROPERTY_PET_ID = "petId";
|
||||
private Long petId;
|
||||
|
||||
public static final String JSON_PROPERTY_QUANTITY = "quantity";
|
||||
private Integer quantity;
|
||||
|
||||
public static final String JSON_PROPERTY_SHIP_DATE = "shipDate";
|
||||
private OffsetDateTime shipDate;
|
||||
|
||||
/**
|
||||
* Order Status
|
||||
*/
|
||||
public enum StatusEnum {
|
||||
PLACED("placed"),
|
||||
|
||||
APPROVED("approved"),
|
||||
|
||||
DELIVERED("delivered");
|
||||
|
||||
private String value;
|
||||
|
||||
StatusEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static StatusEnum fromValue(String value) {
|
||||
for (StatusEnum b : StatusEnum.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_STATUS = "status";
|
||||
private StatusEnum status;
|
||||
|
||||
public static final String JSON_PROPERTY_COMPLETE = "complete";
|
||||
private Boolean complete = false;
|
||||
|
||||
|
||||
public Order id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public Order petId(Long petId) {
|
||||
this.petId = petId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get petId
|
||||
* @return petId
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_PET_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
}
|
||||
|
||||
|
||||
public void setPetId(Long petId) {
|
||||
this.petId = petId;
|
||||
}
|
||||
|
||||
|
||||
public Order quantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get quantity
|
||||
* @return quantity
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_QUANTITY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
|
||||
public void setQuantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
|
||||
public Order shipDate(OffsetDateTime shipDate) {
|
||||
this.shipDate = shipDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get shipDate
|
||||
* @return shipDate
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(example = "2020-02-02T20:20:20.000222Z", value = "")
|
||||
@JsonProperty(JSON_PROPERTY_SHIP_DATE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public OffsetDateTime getShipDate() {
|
||||
return shipDate;
|
||||
}
|
||||
|
||||
|
||||
public void setShipDate(OffsetDateTime shipDate) {
|
||||
this.shipDate = shipDate;
|
||||
}
|
||||
|
||||
|
||||
public Order status(StatusEnum status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Order Status
|
||||
* @return status
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Order Status")
|
||||
@JsonProperty(JSON_PROPERTY_STATUS)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
public void setStatus(StatusEnum status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
public Order complete(Boolean complete) {
|
||||
this.complete = complete;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get complete
|
||||
* @return complete
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_COMPLETE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Boolean getComplete() {
|
||||
return complete;
|
||||
}
|
||||
|
||||
|
||||
public void setComplete(Boolean complete) {
|
||||
this.complete = complete;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this Order object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Order order = (Order) o;
|
||||
return Objects.equals(this.id, order.id) &&
|
||||
Objects.equals(this.petId, order.petId) &&
|
||||
Objects.equals(this.quantity, order.quantity) &&
|
||||
Objects.equals(this.shipDate, order.shipDate) &&
|
||||
Objects.equals(this.status, order.status) &&
|
||||
Objects.equals(this.complete, order.complete);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, petId, quantity, shipDate, status, complete);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Order {\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" petId: ").append(toIndentedString(petId)).append("\n");
|
||||
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
|
||||
sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
||||
sb.append(" complete: ").append(toIndentedString(complete)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* OuterComposite
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
OuterComposite.JSON_PROPERTY_MY_NUMBER,
|
||||
OuterComposite.JSON_PROPERTY_MY_STRING,
|
||||
OuterComposite.JSON_PROPERTY_MY_BOOLEAN
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class OuterComposite {
|
||||
public static final String JSON_PROPERTY_MY_NUMBER = "my_number";
|
||||
private BigDecimal myNumber;
|
||||
|
||||
public static final String JSON_PROPERTY_MY_STRING = "my_string";
|
||||
private String myString;
|
||||
|
||||
public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean";
|
||||
private Boolean myBoolean;
|
||||
|
||||
|
||||
public OuterComposite myNumber(BigDecimal myNumber) {
|
||||
this.myNumber = myNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get myNumber
|
||||
* @return myNumber
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_MY_NUMBER)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public BigDecimal getMyNumber() {
|
||||
return myNumber;
|
||||
}
|
||||
|
||||
|
||||
public void setMyNumber(BigDecimal myNumber) {
|
||||
this.myNumber = myNumber;
|
||||
}
|
||||
|
||||
|
||||
public OuterComposite myString(String myString) {
|
||||
this.myString = myString;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get myString
|
||||
* @return myString
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_MY_STRING)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getMyString() {
|
||||
return myString;
|
||||
}
|
||||
|
||||
|
||||
public void setMyString(String myString) {
|
||||
this.myString = myString;
|
||||
}
|
||||
|
||||
|
||||
public OuterComposite myBoolean(Boolean myBoolean) {
|
||||
this.myBoolean = myBoolean;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get myBoolean
|
||||
* @return myBoolean
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_MY_BOOLEAN)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Boolean getMyBoolean() {
|
||||
return myBoolean;
|
||||
}
|
||||
|
||||
|
||||
public void setMyBoolean(Boolean myBoolean) {
|
||||
this.myBoolean = myBoolean;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this OuterComposite object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
OuterComposite outerComposite = (OuterComposite) o;
|
||||
return Objects.equals(this.myNumber, outerComposite.myNumber) &&
|
||||
Objects.equals(this.myString, outerComposite.myString) &&
|
||||
Objects.equals(this.myBoolean, outerComposite.myBoolean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(myNumber, myString, myBoolean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class OuterComposite {\n");
|
||||
sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n");
|
||||
sb.append(" myString: ").append(toIndentedString(myString)).append("\n");
|
||||
sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
/**
|
||||
* Gets or Sets OuterEnum
|
||||
*/
|
||||
public enum OuterEnum {
|
||||
|
||||
PLACED("placed"),
|
||||
|
||||
APPROVED("approved"),
|
||||
|
||||
DELIVERED("delivered");
|
||||
|
||||
private String value;
|
||||
|
||||
OuterEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static OuterEnum fromValue(String value) {
|
||||
for (OuterEnum b : OuterEnum.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
/**
|
||||
* Gets or Sets OuterEnumDefaultValue
|
||||
*/
|
||||
public enum OuterEnumDefaultValue {
|
||||
|
||||
PLACED("placed"),
|
||||
|
||||
APPROVED("approved"),
|
||||
|
||||
DELIVERED("delivered");
|
||||
|
||||
private String value;
|
||||
|
||||
OuterEnumDefaultValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static OuterEnumDefaultValue fromValue(String value) {
|
||||
for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
/**
|
||||
* Gets or Sets OuterEnumInteger
|
||||
*/
|
||||
public enum OuterEnumInteger {
|
||||
|
||||
NUMBER_0(0),
|
||||
|
||||
NUMBER_1(1),
|
||||
|
||||
NUMBER_2(2);
|
||||
|
||||
private Integer value;
|
||||
|
||||
OuterEnumInteger(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static OuterEnumInteger fromValue(Integer value) {
|
||||
for (OuterEnumInteger b : OuterEnumInteger.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
/**
|
||||
* Gets or Sets OuterEnumIntegerDefaultValue
|
||||
*/
|
||||
public enum OuterEnumIntegerDefaultValue {
|
||||
|
||||
NUMBER_0(0),
|
||||
|
||||
NUMBER_1(1),
|
||||
|
||||
NUMBER_2(2);
|
||||
|
||||
private Integer value;
|
||||
|
||||
OuterEnumIntegerDefaultValue(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static OuterEnumIntegerDefaultValue fromValue(Integer value) {
|
||||
for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.ChildCat;
|
||||
import org.openapitools.client.model.GrandparentAnimal;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* ParentPet
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "pet_type", visible = true)
|
||||
@JsonSubTypes({
|
||||
@JsonSubTypes.Type(value = ChildCat.class, name = "ChildCat"),
|
||||
})
|
||||
|
||||
public class ParentPet extends GrandparentAnimal {
|
||||
|
||||
/**
|
||||
* Return true if this ParentPet object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
return super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(super.hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ParentPet {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).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 ");
|
||||
}
|
||||
|
||||
static {
|
||||
// Initialize and register the discriminator mappings.
|
||||
Map<String, Class<?>> mappings = new HashMap<String, Class<?>>();
|
||||
mappings.put("ChildCat", ChildCat.class);
|
||||
mappings.put("ParentPet", ParentPet.class);
|
||||
JSON.registerDiscriminator(ParentPet.class, "pet_type", mappings);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,310 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.client.model.Category;
|
||||
import org.openapitools.client.model.Tag;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Pet
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
Pet.JSON_PROPERTY_ID,
|
||||
Pet.JSON_PROPERTY_CATEGORY,
|
||||
Pet.JSON_PROPERTY_NAME,
|
||||
Pet.JSON_PROPERTY_PHOTO_URLS,
|
||||
Pet.JSON_PROPERTY_TAGS,
|
||||
Pet.JSON_PROPERTY_STATUS
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Pet {
|
||||
public static final String JSON_PROPERTY_ID = "id";
|
||||
private Long id;
|
||||
|
||||
public static final String JSON_PROPERTY_CATEGORY = "category";
|
||||
private Category category;
|
||||
|
||||
public static final String JSON_PROPERTY_NAME = "name";
|
||||
private String name;
|
||||
|
||||
public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls";
|
||||
private List<String> photoUrls = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_TAGS = "tags";
|
||||
private List<Tag> tags = null;
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
*/
|
||||
public enum StatusEnum {
|
||||
AVAILABLE("available"),
|
||||
|
||||
PENDING("pending"),
|
||||
|
||||
SOLD("sold");
|
||||
|
||||
private String value;
|
||||
|
||||
StatusEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static StatusEnum fromValue(String value) {
|
||||
for (StatusEnum b : StatusEnum.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_STATUS = "status";
|
||||
private StatusEnum status;
|
||||
|
||||
|
||||
public Pet id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public Pet category(Category category) {
|
||||
this.category = category;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get category
|
||||
* @return category
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_CATEGORY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
|
||||
public void setCategory(Category category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
|
||||
public Pet name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public Pet photoUrls(List<String> photoUrls) {
|
||||
this.photoUrls = photoUrls;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Pet addPhotoUrlsItem(String photoUrlsItem) {
|
||||
this.photoUrls.add(photoUrlsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get photoUrls
|
||||
* @return photoUrls
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_PHOTO_URLS)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
|
||||
|
||||
public void setPhotoUrls(List<String> photoUrls) {
|
||||
this.photoUrls = photoUrls;
|
||||
}
|
||||
|
||||
|
||||
public Pet tags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Pet addTagsItem(Tag tagsItem) {
|
||||
if (this.tags == null) {
|
||||
this.tags = new ArrayList<>();
|
||||
}
|
||||
this.tags.add(tagsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tags
|
||||
* @return tags
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_TAGS)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
|
||||
public void setTags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
|
||||
public Pet status(StatusEnum status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
* @return status
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "pet status in the store")
|
||||
@JsonProperty(JSON_PROPERTY_STATUS)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
public void setStatus(StatusEnum status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this Pet object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Pet pet = (Pet) o;
|
||||
return Objects.equals(this.id, pet.id) &&
|
||||
Objects.equals(this.category, pet.category) &&
|
||||
Objects.equals(this.name, pet.name) &&
|
||||
Objects.equals(this.photoUrls, pet.photoUrls) &&
|
||||
Objects.equals(this.tags, pet.tags) &&
|
||||
Objects.equals(this.status, pet.status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, category, name, photoUrls, tags, status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Pet {\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" category: ").append(toIndentedString(category)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
|
||||
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,276 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.BasquePig;
|
||||
import org.openapitools.client.model.DanishPig;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import javax.ws.rs.core.GenericType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.JsonToken;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.MapperFeature;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
|
||||
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonDeserialize(using = Pig.PigDeserializer.class)
|
||||
@JsonSerialize(using = Pig.PigSerializer.class)
|
||||
public class Pig extends AbstractOpenApiSchema {
|
||||
private static final Logger log = Logger.getLogger(Pig.class.getName());
|
||||
|
||||
public static class PigSerializer extends StdSerializer<Pig> {
|
||||
public PigSerializer(Class<Pig> t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
public PigSerializer() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(Pig value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
|
||||
jgen.writeObject(value.getActualInstance());
|
||||
}
|
||||
}
|
||||
|
||||
public static class PigDeserializer extends StdDeserializer<Pig> {
|
||||
public PigDeserializer() {
|
||||
this(Pig.class);
|
||||
}
|
||||
|
||||
public PigDeserializer(Class<?> vc) {
|
||||
super(vc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
|
||||
JsonNode tree = jp.readValueAsTree();
|
||||
Object deserialized = null;
|
||||
Pig newPig = new Pig();
|
||||
Map<String,Object> result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference<Map<String, Object>>() {});
|
||||
String discriminatorValue = (String)result2.get("className");
|
||||
switch (discriminatorValue) {
|
||||
case "BasquePig":
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(BasquePig.class);
|
||||
newPig.setActualInstance(deserialized);
|
||||
return newPig;
|
||||
case "DanishPig":
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(DanishPig.class);
|
||||
newPig.setActualInstance(deserialized);
|
||||
return newPig;
|
||||
default:
|
||||
log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for Pig. Possible values: BasquePig DanishPig", discriminatorValue));
|
||||
}
|
||||
|
||||
boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS);
|
||||
int match = 0;
|
||||
JsonToken token = tree.traverse(jp.getCodec()).nextToken();
|
||||
// deserialize BasquePig
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (BasquePig.class.equals(Integer.class) || BasquePig.class.equals(Long.class) || BasquePig.class.equals(Float.class) || BasquePig.class.equals(Double.class) || BasquePig.class.equals(Boolean.class) || BasquePig.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((BasquePig.class.equals(Integer.class) || BasquePig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((BasquePig.class.equals(Float.class) || BasquePig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (BasquePig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (BasquePig.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(BasquePig.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'BasquePig'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'BasquePig'", e);
|
||||
}
|
||||
|
||||
// deserialize DanishPig
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (DanishPig.class.equals(Integer.class) || DanishPig.class.equals(Long.class) || DanishPig.class.equals(Float.class) || DanishPig.class.equals(Double.class) || DanishPig.class.equals(Boolean.class) || DanishPig.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((DanishPig.class.equals(Integer.class) || DanishPig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((DanishPig.class.equals(Float.class) || DanishPig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (DanishPig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (DanishPig.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(DanishPig.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'DanishPig'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'DanishPig'", e);
|
||||
}
|
||||
|
||||
if (match == 1) {
|
||||
Pig ret = new Pig();
|
||||
ret.setActualInstance(deserialized);
|
||||
return ret;
|
||||
}
|
||||
throw new IOException(String.format("Failed deserialization for Pig: %d classes match result, expected 1", match));
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle deserialization of the 'null' value.
|
||||
*/
|
||||
@Override
|
||||
public Pig getNullValue(DeserializationContext ctxt) throws JsonMappingException {
|
||||
throw new JsonMappingException(ctxt.getParser(), "Pig cannot be null");
|
||||
}
|
||||
}
|
||||
|
||||
// store a list of schema names defined in oneOf
|
||||
public final static Map<String, GenericType> schemas = new HashMap<String, GenericType>();
|
||||
|
||||
public Pig() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
}
|
||||
|
||||
public Pig(BasquePig o) {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
public Pig(DanishPig o) {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
static {
|
||||
schemas.put("BasquePig", new GenericType<BasquePig>() {
|
||||
});
|
||||
schemas.put("DanishPig", new GenericType<DanishPig>() {
|
||||
});
|
||||
JSON.registerDescendants(Pig.class, Collections.unmodifiableMap(schemas));
|
||||
// Initialize and register the discriminator mappings.
|
||||
Map<String, Class<?>> mappings = new HashMap<String, Class<?>>();
|
||||
mappings.put("BasquePig", BasquePig.class);
|
||||
mappings.put("DanishPig", DanishPig.class);
|
||||
mappings.put("Pig", Pig.class);
|
||||
JSON.registerDiscriminator(Pig.class, "className", mappings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
return Pig.schemas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the instance that matches the oneOf child schema, check
|
||||
* the instance parameter is valid against the oneOf child schemas:
|
||||
* BasquePig, DanishPig
|
||||
*
|
||||
* It could be an instance of the 'oneOf' schemas.
|
||||
* The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf).
|
||||
*/
|
||||
@Override
|
||||
public void setActualInstance(Object instance) {
|
||||
if (JSON.isInstanceOf(BasquePig.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
if (JSON.isInstanceOf(DanishPig.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
throw new RuntimeException("Invalid instance type. Must be BasquePig, DanishPig");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance, which can be the following:
|
||||
* BasquePig, DanishPig
|
||||
*
|
||||
* @return The actual instance (BasquePig, DanishPig)
|
||||
*/
|
||||
@Override
|
||||
public Object getActualInstance() {
|
||||
return super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `BasquePig`. If the actual instanct is not `BasquePig`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `BasquePig`
|
||||
* @throws ClassCastException if the instance is not `BasquePig`
|
||||
*/
|
||||
public BasquePig getBasquePig() throws ClassCastException {
|
||||
return (BasquePig)super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `DanishPig`. If the actual instanct is not `DanishPig`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `DanishPig`
|
||||
* @throws ClassCastException if the instance is not `DanishPig`
|
||||
*/
|
||||
public DanishPig getDanishPig() throws ClassCastException {
|
||||
return (DanishPig)super.getActualInstance();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,276 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.ComplexQuadrilateral;
|
||||
import org.openapitools.client.model.SimpleQuadrilateral;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import javax.ws.rs.core.GenericType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.JsonToken;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.MapperFeature;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
|
||||
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonDeserialize(using = Quadrilateral.QuadrilateralDeserializer.class)
|
||||
@JsonSerialize(using = Quadrilateral.QuadrilateralSerializer.class)
|
||||
public class Quadrilateral extends AbstractOpenApiSchema {
|
||||
private static final Logger log = Logger.getLogger(Quadrilateral.class.getName());
|
||||
|
||||
public static class QuadrilateralSerializer extends StdSerializer<Quadrilateral> {
|
||||
public QuadrilateralSerializer(Class<Quadrilateral> t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
public QuadrilateralSerializer() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(Quadrilateral value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
|
||||
jgen.writeObject(value.getActualInstance());
|
||||
}
|
||||
}
|
||||
|
||||
public static class QuadrilateralDeserializer extends StdDeserializer<Quadrilateral> {
|
||||
public QuadrilateralDeserializer() {
|
||||
this(Quadrilateral.class);
|
||||
}
|
||||
|
||||
public QuadrilateralDeserializer(Class<?> vc) {
|
||||
super(vc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
|
||||
JsonNode tree = jp.readValueAsTree();
|
||||
Object deserialized = null;
|
||||
Quadrilateral newQuadrilateral = new Quadrilateral();
|
||||
Map<String,Object> result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference<Map<String, Object>>() {});
|
||||
String discriminatorValue = (String)result2.get("quadrilateralType");
|
||||
switch (discriminatorValue) {
|
||||
case "ComplexQuadrilateral":
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(ComplexQuadrilateral.class);
|
||||
newQuadrilateral.setActualInstance(deserialized);
|
||||
return newQuadrilateral;
|
||||
case "SimpleQuadrilateral":
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(SimpleQuadrilateral.class);
|
||||
newQuadrilateral.setActualInstance(deserialized);
|
||||
return newQuadrilateral;
|
||||
default:
|
||||
log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for Quadrilateral. Possible values: ComplexQuadrilateral SimpleQuadrilateral", discriminatorValue));
|
||||
}
|
||||
|
||||
boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS);
|
||||
int match = 0;
|
||||
JsonToken token = tree.traverse(jp.getCodec()).nextToken();
|
||||
// deserialize ComplexQuadrilateral
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (ComplexQuadrilateral.class.equals(Integer.class) || ComplexQuadrilateral.class.equals(Long.class) || ComplexQuadrilateral.class.equals(Float.class) || ComplexQuadrilateral.class.equals(Double.class) || ComplexQuadrilateral.class.equals(Boolean.class) || ComplexQuadrilateral.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((ComplexQuadrilateral.class.equals(Integer.class) || ComplexQuadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((ComplexQuadrilateral.class.equals(Float.class) || ComplexQuadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (ComplexQuadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (ComplexQuadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(ComplexQuadrilateral.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'ComplexQuadrilateral'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'ComplexQuadrilateral'", e);
|
||||
}
|
||||
|
||||
// deserialize SimpleQuadrilateral
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (SimpleQuadrilateral.class.equals(Integer.class) || SimpleQuadrilateral.class.equals(Long.class) || SimpleQuadrilateral.class.equals(Float.class) || SimpleQuadrilateral.class.equals(Double.class) || SimpleQuadrilateral.class.equals(Boolean.class) || SimpleQuadrilateral.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((SimpleQuadrilateral.class.equals(Integer.class) || SimpleQuadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((SimpleQuadrilateral.class.equals(Float.class) || SimpleQuadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (SimpleQuadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (SimpleQuadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(SimpleQuadrilateral.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'SimpleQuadrilateral'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'SimpleQuadrilateral'", e);
|
||||
}
|
||||
|
||||
if (match == 1) {
|
||||
Quadrilateral ret = new Quadrilateral();
|
||||
ret.setActualInstance(deserialized);
|
||||
return ret;
|
||||
}
|
||||
throw new IOException(String.format("Failed deserialization for Quadrilateral: %d classes match result, expected 1", match));
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle deserialization of the 'null' value.
|
||||
*/
|
||||
@Override
|
||||
public Quadrilateral getNullValue(DeserializationContext ctxt) throws JsonMappingException {
|
||||
throw new JsonMappingException(ctxt.getParser(), "Quadrilateral cannot be null");
|
||||
}
|
||||
}
|
||||
|
||||
// store a list of schema names defined in oneOf
|
||||
public final static Map<String, GenericType> schemas = new HashMap<String, GenericType>();
|
||||
|
||||
public Quadrilateral() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
}
|
||||
|
||||
public Quadrilateral(ComplexQuadrilateral o) {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
public Quadrilateral(SimpleQuadrilateral o) {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
static {
|
||||
schemas.put("ComplexQuadrilateral", new GenericType<ComplexQuadrilateral>() {
|
||||
});
|
||||
schemas.put("SimpleQuadrilateral", new GenericType<SimpleQuadrilateral>() {
|
||||
});
|
||||
JSON.registerDescendants(Quadrilateral.class, Collections.unmodifiableMap(schemas));
|
||||
// Initialize and register the discriminator mappings.
|
||||
Map<String, Class<?>> mappings = new HashMap<String, Class<?>>();
|
||||
mappings.put("ComplexQuadrilateral", ComplexQuadrilateral.class);
|
||||
mappings.put("SimpleQuadrilateral", SimpleQuadrilateral.class);
|
||||
mappings.put("Quadrilateral", Quadrilateral.class);
|
||||
JSON.registerDiscriminator(Quadrilateral.class, "quadrilateralType", mappings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
return Quadrilateral.schemas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the instance that matches the oneOf child schema, check
|
||||
* the instance parameter is valid against the oneOf child schemas:
|
||||
* ComplexQuadrilateral, SimpleQuadrilateral
|
||||
*
|
||||
* It could be an instance of the 'oneOf' schemas.
|
||||
* The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf).
|
||||
*/
|
||||
@Override
|
||||
public void setActualInstance(Object instance) {
|
||||
if (JSON.isInstanceOf(ComplexQuadrilateral.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
if (JSON.isInstanceOf(SimpleQuadrilateral.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
throw new RuntimeException("Invalid instance type. Must be ComplexQuadrilateral, SimpleQuadrilateral");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance, which can be the following:
|
||||
* ComplexQuadrilateral, SimpleQuadrilateral
|
||||
*
|
||||
* @return The actual instance (ComplexQuadrilateral, SimpleQuadrilateral)
|
||||
*/
|
||||
@Override
|
||||
public Object getActualInstance() {
|
||||
return super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `ComplexQuadrilateral`. If the actual instanct is not `ComplexQuadrilateral`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `ComplexQuadrilateral`
|
||||
* @throws ClassCastException if the instance is not `ComplexQuadrilateral`
|
||||
*/
|
||||
public ComplexQuadrilateral getComplexQuadrilateral() throws ClassCastException {
|
||||
return (ComplexQuadrilateral)super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `SimpleQuadrilateral`. If the actual instanct is not `SimpleQuadrilateral`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `SimpleQuadrilateral`
|
||||
* @throws ClassCastException if the instance is not `SimpleQuadrilateral`
|
||||
*/
|
||||
public SimpleQuadrilateral getSimpleQuadrilateral() throws ClassCastException {
|
||||
return (SimpleQuadrilateral)super.getActualInstance();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* QuadrilateralInterface
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
QuadrilateralInterface.JSON_PROPERTY_QUADRILATERAL_TYPE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class QuadrilateralInterface {
|
||||
public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType";
|
||||
private String quadrilateralType;
|
||||
|
||||
|
||||
public QuadrilateralInterface quadrilateralType(String quadrilateralType) {
|
||||
this.quadrilateralType = quadrilateralType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get quadrilateralType
|
||||
* @return quadrilateralType
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getQuadrilateralType() {
|
||||
return quadrilateralType;
|
||||
}
|
||||
|
||||
|
||||
public void setQuadrilateralType(String quadrilateralType) {
|
||||
this.quadrilateralType = quadrilateralType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this QuadrilateralInterface object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
QuadrilateralInterface quadrilateralInterface = (QuadrilateralInterface) o;
|
||||
return Objects.equals(this.quadrilateralType, quadrilateralInterface.quadrilateralType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(quadrilateralType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class QuadrilateralInterface {\n");
|
||||
sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* ReadOnlyFirst
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ReadOnlyFirst.JSON_PROPERTY_BAR,
|
||||
ReadOnlyFirst.JSON_PROPERTY_BAZ
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ReadOnlyFirst {
|
||||
public static final String JSON_PROPERTY_BAR = "bar";
|
||||
private String bar;
|
||||
|
||||
public static final String JSON_PROPERTY_BAZ = "baz";
|
||||
private String baz;
|
||||
|
||||
|
||||
/**
|
||||
* Get bar
|
||||
* @return bar
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_BAR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getBar() {
|
||||
return bar;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public ReadOnlyFirst baz(String baz) {
|
||||
this.baz = baz;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get baz
|
||||
* @return baz
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_BAZ)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getBaz() {
|
||||
return baz;
|
||||
}
|
||||
|
||||
|
||||
public void setBaz(String baz) {
|
||||
this.baz = baz;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this ReadOnlyFirst object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o;
|
||||
return Objects.equals(this.bar, readOnlyFirst.bar) &&
|
||||
Objects.equals(this.baz, readOnlyFirst.baz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(bar, baz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ReadOnlyFirst {\n");
|
||||
sb.append(" bar: ").append(toIndentedString(bar)).append("\n");
|
||||
sb.append(" baz: ").append(toIndentedString(baz)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.ShapeInterface;
|
||||
import org.openapitools.client.model.TriangleInterface;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* ScaleneTriangle
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ScaleneTriangle.JSON_PROPERTY_SHAPE_TYPE,
|
||||
ScaleneTriangle.JSON_PROPERTY_TRIANGLE_TYPE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ScaleneTriangle {
|
||||
public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType";
|
||||
private String shapeType;
|
||||
|
||||
public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType";
|
||||
private String triangleType;
|
||||
|
||||
|
||||
public ScaleneTriangle shapeType(String shapeType) {
|
||||
this.shapeType = shapeType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get shapeType
|
||||
* @return shapeType
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_SHAPE_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getShapeType() {
|
||||
return shapeType;
|
||||
}
|
||||
|
||||
|
||||
public void setShapeType(String shapeType) {
|
||||
this.shapeType = shapeType;
|
||||
}
|
||||
|
||||
|
||||
public ScaleneTriangle triangleType(String triangleType) {
|
||||
this.triangleType = triangleType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get triangleType
|
||||
* @return triangleType
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getTriangleType() {
|
||||
return triangleType;
|
||||
}
|
||||
|
||||
|
||||
public void setTriangleType(String triangleType) {
|
||||
this.triangleType = triangleType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this ScaleneTriangle object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ScaleneTriangle scaleneTriangle = (ScaleneTriangle) o;
|
||||
return Objects.equals(this.shapeType, scaleneTriangle.shapeType) &&
|
||||
Objects.equals(this.triangleType, scaleneTriangle.triangleType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(shapeType, triangleType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ScaleneTriangle {\n");
|
||||
sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n");
|
||||
sb.append(" triangleType: ").append(toIndentedString(triangleType)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,276 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.Quadrilateral;
|
||||
import org.openapitools.client.model.Triangle;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import javax.ws.rs.core.GenericType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.JsonToken;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.MapperFeature;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
|
||||
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonDeserialize(using = Shape.ShapeDeserializer.class)
|
||||
@JsonSerialize(using = Shape.ShapeSerializer.class)
|
||||
public class Shape extends AbstractOpenApiSchema {
|
||||
private static final Logger log = Logger.getLogger(Shape.class.getName());
|
||||
|
||||
public static class ShapeSerializer extends StdSerializer<Shape> {
|
||||
public ShapeSerializer(Class<Shape> t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
public ShapeSerializer() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(Shape value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
|
||||
jgen.writeObject(value.getActualInstance());
|
||||
}
|
||||
}
|
||||
|
||||
public static class ShapeDeserializer extends StdDeserializer<Shape> {
|
||||
public ShapeDeserializer() {
|
||||
this(Shape.class);
|
||||
}
|
||||
|
||||
public ShapeDeserializer(Class<?> vc) {
|
||||
super(vc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
|
||||
JsonNode tree = jp.readValueAsTree();
|
||||
Object deserialized = null;
|
||||
Shape newShape = new Shape();
|
||||
Map<String,Object> result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference<Map<String, Object>>() {});
|
||||
String discriminatorValue = (String)result2.get("shapeType");
|
||||
switch (discriminatorValue) {
|
||||
case "Quadrilateral":
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class);
|
||||
newShape.setActualInstance(deserialized);
|
||||
return newShape;
|
||||
case "Triangle":
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class);
|
||||
newShape.setActualInstance(deserialized);
|
||||
return newShape;
|
||||
default:
|
||||
log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for Shape. Possible values: Quadrilateral Triangle", discriminatorValue));
|
||||
}
|
||||
|
||||
boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS);
|
||||
int match = 0;
|
||||
JsonToken token = tree.traverse(jp.getCodec()).nextToken();
|
||||
// deserialize Quadrilateral
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'Quadrilateral'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'Quadrilateral'", e);
|
||||
}
|
||||
|
||||
// deserialize Triangle
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'Triangle'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'Triangle'", e);
|
||||
}
|
||||
|
||||
if (match == 1) {
|
||||
Shape ret = new Shape();
|
||||
ret.setActualInstance(deserialized);
|
||||
return ret;
|
||||
}
|
||||
throw new IOException(String.format("Failed deserialization for Shape: %d classes match result, expected 1", match));
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle deserialization of the 'null' value.
|
||||
*/
|
||||
@Override
|
||||
public Shape getNullValue(DeserializationContext ctxt) throws JsonMappingException {
|
||||
throw new JsonMappingException(ctxt.getParser(), "Shape cannot be null");
|
||||
}
|
||||
}
|
||||
|
||||
// store a list of schema names defined in oneOf
|
||||
public final static Map<String, GenericType> schemas = new HashMap<String, GenericType>();
|
||||
|
||||
public Shape() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
}
|
||||
|
||||
public Shape(Quadrilateral o) {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
public Shape(Triangle o) {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
static {
|
||||
schemas.put("Quadrilateral", new GenericType<Quadrilateral>() {
|
||||
});
|
||||
schemas.put("Triangle", new GenericType<Triangle>() {
|
||||
});
|
||||
JSON.registerDescendants(Shape.class, Collections.unmodifiableMap(schemas));
|
||||
// Initialize and register the discriminator mappings.
|
||||
Map<String, Class<?>> mappings = new HashMap<String, Class<?>>();
|
||||
mappings.put("Quadrilateral", Quadrilateral.class);
|
||||
mappings.put("Triangle", Triangle.class);
|
||||
mappings.put("Shape", Shape.class);
|
||||
JSON.registerDiscriminator(Shape.class, "shapeType", mappings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
return Shape.schemas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the instance that matches the oneOf child schema, check
|
||||
* the instance parameter is valid against the oneOf child schemas:
|
||||
* Quadrilateral, Triangle
|
||||
*
|
||||
* It could be an instance of the 'oneOf' schemas.
|
||||
* The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf).
|
||||
*/
|
||||
@Override
|
||||
public void setActualInstance(Object instance) {
|
||||
if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
if (JSON.isInstanceOf(Triangle.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
throw new RuntimeException("Invalid instance type. Must be Quadrilateral, Triangle");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance, which can be the following:
|
||||
* Quadrilateral, Triangle
|
||||
*
|
||||
* @return The actual instance (Quadrilateral, Triangle)
|
||||
*/
|
||||
@Override
|
||||
public Object getActualInstance() {
|
||||
return super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `Quadrilateral`. If the actual instanct is not `Quadrilateral`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `Quadrilateral`
|
||||
* @throws ClassCastException if the instance is not `Quadrilateral`
|
||||
*/
|
||||
public Quadrilateral getQuadrilateral() throws ClassCastException {
|
||||
return (Quadrilateral)super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `Triangle`. If the actual instanct is not `Triangle`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `Triangle`
|
||||
* @throws ClassCastException if the instance is not `Triangle`
|
||||
*/
|
||||
public Triangle getTriangle() throws ClassCastException {
|
||||
return (Triangle)super.getActualInstance();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* ShapeInterface
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ShapeInterface.JSON_PROPERTY_SHAPE_TYPE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ShapeInterface {
|
||||
public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType";
|
||||
private String shapeType;
|
||||
|
||||
|
||||
public ShapeInterface shapeType(String shapeType) {
|
||||
this.shapeType = shapeType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get shapeType
|
||||
* @return shapeType
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_SHAPE_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getShapeType() {
|
||||
return shapeType;
|
||||
}
|
||||
|
||||
|
||||
public void setShapeType(String shapeType) {
|
||||
this.shapeType = shapeType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this ShapeInterface object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ShapeInterface shapeInterface = (ShapeInterface) o;
|
||||
return Objects.equals(this.shapeType, shapeInterface.shapeType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(shapeType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ShapeInterface {\n");
|
||||
sb.append(" shapeType: ").append(toIndentedString(shapeType)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,283 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.Quadrilateral;
|
||||
import org.openapitools.client.model.Triangle;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import javax.ws.rs.core.GenericType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.JsonToken;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.MapperFeature;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
|
||||
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonDeserialize(using = ShapeOrNull.ShapeOrNullDeserializer.class)
|
||||
@JsonSerialize(using = ShapeOrNull.ShapeOrNullSerializer.class)
|
||||
public class ShapeOrNull extends AbstractOpenApiSchema {
|
||||
private static final Logger log = Logger.getLogger(ShapeOrNull.class.getName());
|
||||
|
||||
public static class ShapeOrNullSerializer extends StdSerializer<ShapeOrNull> {
|
||||
public ShapeOrNullSerializer(Class<ShapeOrNull> t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
public ShapeOrNullSerializer() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ShapeOrNull value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
|
||||
jgen.writeObject(value.getActualInstance());
|
||||
}
|
||||
}
|
||||
|
||||
public static class ShapeOrNullDeserializer extends StdDeserializer<ShapeOrNull> {
|
||||
public ShapeOrNullDeserializer() {
|
||||
this(ShapeOrNull.class);
|
||||
}
|
||||
|
||||
public ShapeOrNullDeserializer(Class<?> vc) {
|
||||
super(vc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
|
||||
JsonNode tree = jp.readValueAsTree();
|
||||
Object deserialized = null;
|
||||
ShapeOrNull newShapeOrNull = new ShapeOrNull();
|
||||
Map<String,Object> result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference<Map<String, Object>>() {});
|
||||
String discriminatorValue = (String)result2.get("shapeType");
|
||||
switch (discriminatorValue) {
|
||||
case "Quadrilateral":
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class);
|
||||
newShapeOrNull.setActualInstance(deserialized);
|
||||
return newShapeOrNull;
|
||||
case "Triangle":
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class);
|
||||
newShapeOrNull.setActualInstance(deserialized);
|
||||
return newShapeOrNull;
|
||||
default:
|
||||
log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for ShapeOrNull. Possible values: Quadrilateral Triangle", discriminatorValue));
|
||||
}
|
||||
|
||||
boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS);
|
||||
int match = 0;
|
||||
JsonToken token = tree.traverse(jp.getCodec()).nextToken();
|
||||
// deserialize Quadrilateral
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
attemptParsing |= (token == JsonToken.VALUE_NULL);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Quadrilateral.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'Quadrilateral'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'Quadrilateral'", e);
|
||||
}
|
||||
|
||||
// deserialize Triangle
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
attemptParsing |= (token == JsonToken.VALUE_NULL);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(Triangle.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'Triangle'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'Triangle'", e);
|
||||
}
|
||||
|
||||
if (match == 1) {
|
||||
ShapeOrNull ret = new ShapeOrNull();
|
||||
ret.setActualInstance(deserialized);
|
||||
return ret;
|
||||
}
|
||||
throw new IOException(String.format("Failed deserialization for ShapeOrNull: %d classes match result, expected 1", match));
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle deserialization of the 'null' value.
|
||||
*/
|
||||
@Override
|
||||
public ShapeOrNull getNullValue(DeserializationContext ctxt) throws JsonMappingException {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// store a list of schema names defined in oneOf
|
||||
public final static Map<String, GenericType> schemas = new HashMap<String, GenericType>();
|
||||
|
||||
public ShapeOrNull() {
|
||||
super("oneOf", Boolean.TRUE);
|
||||
}
|
||||
|
||||
public ShapeOrNull(Quadrilateral o) {
|
||||
super("oneOf", Boolean.TRUE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
public ShapeOrNull(Triangle o) {
|
||||
super("oneOf", Boolean.TRUE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
static {
|
||||
schemas.put("Quadrilateral", new GenericType<Quadrilateral>() {
|
||||
});
|
||||
schemas.put("Triangle", new GenericType<Triangle>() {
|
||||
});
|
||||
JSON.registerDescendants(ShapeOrNull.class, Collections.unmodifiableMap(schemas));
|
||||
// Initialize and register the discriminator mappings.
|
||||
Map<String, Class<?>> mappings = new HashMap<String, Class<?>>();
|
||||
mappings.put("Quadrilateral", Quadrilateral.class);
|
||||
mappings.put("Triangle", Triangle.class);
|
||||
mappings.put("ShapeOrNull", ShapeOrNull.class);
|
||||
JSON.registerDiscriminator(ShapeOrNull.class, "shapeType", mappings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
return ShapeOrNull.schemas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the instance that matches the oneOf child schema, check
|
||||
* the instance parameter is valid against the oneOf child schemas:
|
||||
* Quadrilateral, Triangle
|
||||
*
|
||||
* It could be an instance of the 'oneOf' schemas.
|
||||
* The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf).
|
||||
*/
|
||||
@Override
|
||||
public void setActualInstance(Object instance) {
|
||||
if (instance == null) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
if (JSON.isInstanceOf(Triangle.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
throw new RuntimeException("Invalid instance type. Must be Quadrilateral, Triangle");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance, which can be the following:
|
||||
* Quadrilateral, Triangle
|
||||
*
|
||||
* @return The actual instance (Quadrilateral, Triangle)
|
||||
*/
|
||||
@Override
|
||||
public Object getActualInstance() {
|
||||
return super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `Quadrilateral`. If the actual instanct is not `Quadrilateral`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `Quadrilateral`
|
||||
* @throws ClassCastException if the instance is not `Quadrilateral`
|
||||
*/
|
||||
public Quadrilateral getQuadrilateral() throws ClassCastException {
|
||||
return (Quadrilateral)super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `Triangle`. If the actual instanct is not `Triangle`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `Triangle`
|
||||
* @throws ClassCastException if the instance is not `Triangle`
|
||||
*/
|
||||
public Triangle getTriangle() throws ClassCastException {
|
||||
return (Triangle)super.getActualInstance();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.QuadrilateralInterface;
|
||||
import org.openapitools.client.model.ShapeInterface;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* SimpleQuadrilateral
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
SimpleQuadrilateral.JSON_PROPERTY_SHAPE_TYPE,
|
||||
SimpleQuadrilateral.JSON_PROPERTY_QUADRILATERAL_TYPE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class SimpleQuadrilateral {
|
||||
public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType";
|
||||
private String shapeType;
|
||||
|
||||
public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType";
|
||||
private String quadrilateralType;
|
||||
|
||||
|
||||
public SimpleQuadrilateral shapeType(String shapeType) {
|
||||
this.shapeType = shapeType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get shapeType
|
||||
* @return shapeType
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_SHAPE_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getShapeType() {
|
||||
return shapeType;
|
||||
}
|
||||
|
||||
|
||||
public void setShapeType(String shapeType) {
|
||||
this.shapeType = shapeType;
|
||||
}
|
||||
|
||||
|
||||
public SimpleQuadrilateral quadrilateralType(String quadrilateralType) {
|
||||
this.quadrilateralType = quadrilateralType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get quadrilateralType
|
||||
* @return quadrilateralType
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getQuadrilateralType() {
|
||||
return quadrilateralType;
|
||||
}
|
||||
|
||||
|
||||
public void setQuadrilateralType(String quadrilateralType) {
|
||||
this.quadrilateralType = quadrilateralType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this SimpleQuadrilateral object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
SimpleQuadrilateral simpleQuadrilateral = (SimpleQuadrilateral) o;
|
||||
return Objects.equals(this.shapeType, simpleQuadrilateral.shapeType) &&
|
||||
Objects.equals(this.quadrilateralType, simpleQuadrilateral.quadrilateralType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(shapeType, quadrilateralType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class SimpleQuadrilateral {\n");
|
||||
sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n");
|
||||
sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* SpecialModelName
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class SpecialModelName {
|
||||
public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]";
|
||||
private Long $specialPropertyName;
|
||||
|
||||
|
||||
public SpecialModelName $specialPropertyName(Long $specialPropertyName) {
|
||||
this.$specialPropertyName = $specialPropertyName;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get $specialPropertyName
|
||||
* @return $specialPropertyName
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Long get$SpecialPropertyName() {
|
||||
return $specialPropertyName;
|
||||
}
|
||||
|
||||
|
||||
public void set$SpecialPropertyName(Long $specialPropertyName) {
|
||||
this.$specialPropertyName = $specialPropertyName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this _special_model.name_ object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
SpecialModelName specialModelName = (SpecialModelName) o;
|
||||
return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash($specialPropertyName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class SpecialModelName {\n");
|
||||
sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Tag
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
Tag.JSON_PROPERTY_ID,
|
||||
Tag.JSON_PROPERTY_NAME
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Tag {
|
||||
public static final String JSON_PROPERTY_ID = "id";
|
||||
private Long id;
|
||||
|
||||
public static final String JSON_PROPERTY_NAME = "name";
|
||||
private String name;
|
||||
|
||||
|
||||
public Tag id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public Tag name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this Tag object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Tag tag = (Tag) o;
|
||||
return Objects.equals(this.id, tag.id) &&
|
||||
Objects.equals(this.name, tag.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Tag {\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,331 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.openapitools.client.model.EquilateralTriangle;
|
||||
import org.openapitools.client.model.IsoscelesTriangle;
|
||||
import org.openapitools.client.model.ScaleneTriangle;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import javax.ws.rs.core.GenericType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.JsonToken;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.MapperFeature;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
|
||||
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonDeserialize(using = Triangle.TriangleDeserializer.class)
|
||||
@JsonSerialize(using = Triangle.TriangleSerializer.class)
|
||||
public class Triangle extends AbstractOpenApiSchema {
|
||||
private static final Logger log = Logger.getLogger(Triangle.class.getName());
|
||||
|
||||
public static class TriangleSerializer extends StdSerializer<Triangle> {
|
||||
public TriangleSerializer(Class<Triangle> t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
public TriangleSerializer() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(Triangle value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
|
||||
jgen.writeObject(value.getActualInstance());
|
||||
}
|
||||
}
|
||||
|
||||
public static class TriangleDeserializer extends StdDeserializer<Triangle> {
|
||||
public TriangleDeserializer() {
|
||||
this(Triangle.class);
|
||||
}
|
||||
|
||||
public TriangleDeserializer(Class<?> vc) {
|
||||
super(vc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
|
||||
JsonNode tree = jp.readValueAsTree();
|
||||
Object deserialized = null;
|
||||
Triangle newTriangle = new Triangle();
|
||||
Map<String,Object> result2 = tree.traverse(jp.getCodec()).readValueAs(new TypeReference<Map<String, Object>>() {});
|
||||
String discriminatorValue = (String)result2.get("triangleType");
|
||||
switch (discriminatorValue) {
|
||||
case "EquilateralTriangle":
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(EquilateralTriangle.class);
|
||||
newTriangle.setActualInstance(deserialized);
|
||||
return newTriangle;
|
||||
case "IsoscelesTriangle":
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(IsoscelesTriangle.class);
|
||||
newTriangle.setActualInstance(deserialized);
|
||||
return newTriangle;
|
||||
case "ScaleneTriangle":
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(ScaleneTriangle.class);
|
||||
newTriangle.setActualInstance(deserialized);
|
||||
return newTriangle;
|
||||
default:
|
||||
log.log(Level.WARNING, String.format("Failed to lookup discriminator value `%s` for Triangle. Possible values: EquilateralTriangle IsoscelesTriangle ScaleneTriangle", discriminatorValue));
|
||||
}
|
||||
|
||||
boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS);
|
||||
int match = 0;
|
||||
JsonToken token = tree.traverse(jp.getCodec()).nextToken();
|
||||
// deserialize EquilateralTriangle
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (EquilateralTriangle.class.equals(Integer.class) || EquilateralTriangle.class.equals(Long.class) || EquilateralTriangle.class.equals(Float.class) || EquilateralTriangle.class.equals(Double.class) || EquilateralTriangle.class.equals(Boolean.class) || EquilateralTriangle.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((EquilateralTriangle.class.equals(Integer.class) || EquilateralTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((EquilateralTriangle.class.equals(Float.class) || EquilateralTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (EquilateralTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (EquilateralTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(EquilateralTriangle.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'EquilateralTriangle'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'EquilateralTriangle'", e);
|
||||
}
|
||||
|
||||
// deserialize IsoscelesTriangle
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (IsoscelesTriangle.class.equals(Integer.class) || IsoscelesTriangle.class.equals(Long.class) || IsoscelesTriangle.class.equals(Float.class) || IsoscelesTriangle.class.equals(Double.class) || IsoscelesTriangle.class.equals(Boolean.class) || IsoscelesTriangle.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((IsoscelesTriangle.class.equals(Integer.class) || IsoscelesTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((IsoscelesTriangle.class.equals(Float.class) || IsoscelesTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (IsoscelesTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (IsoscelesTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(IsoscelesTriangle.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'IsoscelesTriangle'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'IsoscelesTriangle'", e);
|
||||
}
|
||||
|
||||
// deserialize ScaleneTriangle
|
||||
try {
|
||||
boolean attemptParsing = true;
|
||||
// ensure that we respect type coercion as set on the client ObjectMapper
|
||||
if (ScaleneTriangle.class.equals(Integer.class) || ScaleneTriangle.class.equals(Long.class) || ScaleneTriangle.class.equals(Float.class) || ScaleneTriangle.class.equals(Double.class) || ScaleneTriangle.class.equals(Boolean.class) || ScaleneTriangle.class.equals(String.class)) {
|
||||
attemptParsing = typeCoercion;
|
||||
if (!attemptParsing) {
|
||||
attemptParsing |= ((ScaleneTriangle.class.equals(Integer.class) || ScaleneTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
|
||||
attemptParsing |= ((ScaleneTriangle.class.equals(Float.class) || ScaleneTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
|
||||
attemptParsing |= (ScaleneTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
|
||||
attemptParsing |= (ScaleneTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING);
|
||||
}
|
||||
}
|
||||
if (attemptParsing) {
|
||||
deserialized = tree.traverse(jp.getCodec()).readValueAs(ScaleneTriangle.class);
|
||||
// TODO: there is no validation against JSON schema constraints
|
||||
// (min, max, enum, pattern...), this does not perform a strict JSON
|
||||
// validation, which means the 'match' count may be higher than it should be.
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema 'ScaleneTriangle'");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
log.log(Level.FINER, "Input data does not match schema 'ScaleneTriangle'", e);
|
||||
}
|
||||
|
||||
if (match == 1) {
|
||||
Triangle ret = new Triangle();
|
||||
ret.setActualInstance(deserialized);
|
||||
return ret;
|
||||
}
|
||||
throw new IOException(String.format("Failed deserialization for Triangle: %d classes match result, expected 1", match));
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle deserialization of the 'null' value.
|
||||
*/
|
||||
@Override
|
||||
public Triangle getNullValue(DeserializationContext ctxt) throws JsonMappingException {
|
||||
throw new JsonMappingException(ctxt.getParser(), "Triangle cannot be null");
|
||||
}
|
||||
}
|
||||
|
||||
// store a list of schema names defined in oneOf
|
||||
public final static Map<String, GenericType> schemas = new HashMap<String, GenericType>();
|
||||
|
||||
public Triangle() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
}
|
||||
|
||||
public Triangle(EquilateralTriangle o) {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
public Triangle(IsoscelesTriangle o) {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
public Triangle(ScaleneTriangle o) {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
setActualInstance(o);
|
||||
}
|
||||
|
||||
static {
|
||||
schemas.put("EquilateralTriangle", new GenericType<EquilateralTriangle>() {
|
||||
});
|
||||
schemas.put("IsoscelesTriangle", new GenericType<IsoscelesTriangle>() {
|
||||
});
|
||||
schemas.put("ScaleneTriangle", new GenericType<ScaleneTriangle>() {
|
||||
});
|
||||
JSON.registerDescendants(Triangle.class, Collections.unmodifiableMap(schemas));
|
||||
// Initialize and register the discriminator mappings.
|
||||
Map<String, Class<?>> mappings = new HashMap<String, Class<?>>();
|
||||
mappings.put("EquilateralTriangle", EquilateralTriangle.class);
|
||||
mappings.put("IsoscelesTriangle", IsoscelesTriangle.class);
|
||||
mappings.put("ScaleneTriangle", ScaleneTriangle.class);
|
||||
mappings.put("Triangle", Triangle.class);
|
||||
JSON.registerDiscriminator(Triangle.class, "triangleType", mappings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
return Triangle.schemas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the instance that matches the oneOf child schema, check
|
||||
* the instance parameter is valid against the oneOf child schemas:
|
||||
* EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle
|
||||
*
|
||||
* It could be an instance of the 'oneOf' schemas.
|
||||
* The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf).
|
||||
*/
|
||||
@Override
|
||||
public void setActualInstance(Object instance) {
|
||||
if (JSON.isInstanceOf(EquilateralTriangle.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
if (JSON.isInstanceOf(IsoscelesTriangle.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
if (JSON.isInstanceOf(ScaleneTriangle.class, instance, new HashSet<Class<?>>())) {
|
||||
super.setActualInstance(instance);
|
||||
return;
|
||||
}
|
||||
|
||||
throw new RuntimeException("Invalid instance type. Must be EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance, which can be the following:
|
||||
* EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle
|
||||
*
|
||||
* @return The actual instance (EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle)
|
||||
*/
|
||||
@Override
|
||||
public Object getActualInstance() {
|
||||
return super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `EquilateralTriangle`. If the actual instanct is not `EquilateralTriangle`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `EquilateralTriangle`
|
||||
* @throws ClassCastException if the instance is not `EquilateralTriangle`
|
||||
*/
|
||||
public EquilateralTriangle getEquilateralTriangle() throws ClassCastException {
|
||||
return (EquilateralTriangle)super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `IsoscelesTriangle`. If the actual instanct is not `IsoscelesTriangle`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `IsoscelesTriangle`
|
||||
* @throws ClassCastException if the instance is not `IsoscelesTriangle`
|
||||
*/
|
||||
public IsoscelesTriangle getIsoscelesTriangle() throws ClassCastException {
|
||||
return (IsoscelesTriangle)super.getActualInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual instance of `ScaleneTriangle`. If the actual instanct is not `ScaleneTriangle`,
|
||||
* the ClassCastException will be thrown.
|
||||
*
|
||||
* @return The actual instance of `ScaleneTriangle`
|
||||
* @throws ClassCastException if the instance is not `ScaleneTriangle`
|
||||
*/
|
||||
public ScaleneTriangle getScaleneTriangle() throws ClassCastException {
|
||||
return (ScaleneTriangle)super.getActualInstance();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* TriangleInterface
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
TriangleInterface.JSON_PROPERTY_TRIANGLE_TYPE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class TriangleInterface {
|
||||
public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType";
|
||||
private String triangleType;
|
||||
|
||||
|
||||
public TriangleInterface triangleType(String triangleType) {
|
||||
this.triangleType = triangleType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get triangleType
|
||||
* @return triangleType
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getTriangleType() {
|
||||
return triangleType;
|
||||
}
|
||||
|
||||
|
||||
public void setTriangleType(String triangleType) {
|
||||
this.triangleType = triangleType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this TriangleInterface object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
TriangleInterface triangleInterface = (TriangleInterface) o;
|
||||
return Objects.equals(this.triangleType, triangleInterface.triangleType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(triangleType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class TriangleInterface {\n");
|
||||
sb.append(" triangleType: ").append(toIndentedString(triangleType)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,471 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import java.util.NoSuchElementException;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* User
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
User.JSON_PROPERTY_ID,
|
||||
User.JSON_PROPERTY_USERNAME,
|
||||
User.JSON_PROPERTY_FIRST_NAME,
|
||||
User.JSON_PROPERTY_LAST_NAME,
|
||||
User.JSON_PROPERTY_EMAIL,
|
||||
User.JSON_PROPERTY_PASSWORD,
|
||||
User.JSON_PROPERTY_PHONE,
|
||||
User.JSON_PROPERTY_USER_STATUS,
|
||||
User.JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS,
|
||||
User.JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE,
|
||||
User.JSON_PROPERTY_ANY_TYPE_PROP,
|
||||
User.JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class User {
|
||||
public static final String JSON_PROPERTY_ID = "id";
|
||||
private Long id;
|
||||
|
||||
public static final String JSON_PROPERTY_USERNAME = "username";
|
||||
private String username;
|
||||
|
||||
public static final String JSON_PROPERTY_FIRST_NAME = "firstName";
|
||||
private String firstName;
|
||||
|
||||
public static final String JSON_PROPERTY_LAST_NAME = "lastName";
|
||||
private String lastName;
|
||||
|
||||
public static final String JSON_PROPERTY_EMAIL = "email";
|
||||
private String email;
|
||||
|
||||
public static final String JSON_PROPERTY_PASSWORD = "password";
|
||||
private String password;
|
||||
|
||||
public static final String JSON_PROPERTY_PHONE = "phone";
|
||||
private String phone;
|
||||
|
||||
public static final String JSON_PROPERTY_USER_STATUS = "userStatus";
|
||||
private Integer userStatus;
|
||||
|
||||
public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS = "objectWithNoDeclaredProps";
|
||||
private Object objectWithNoDeclaredProps;
|
||||
|
||||
public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE = "objectWithNoDeclaredPropsNullable";
|
||||
private JsonNullable<Object> objectWithNoDeclaredPropsNullable = JsonNullable.<Object>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_ANY_TYPE_PROP = "anyTypeProp";
|
||||
private JsonNullable<Object> anyTypeProp = JsonNullable.<Object>of(null);
|
||||
|
||||
public static final String JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE = "anyTypePropNullable";
|
||||
private JsonNullable<Object> anyTypePropNullable = JsonNullable.<Object>of(null);
|
||||
|
||||
|
||||
public User id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_ID)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public User username(String username) {
|
||||
this.username = username;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get username
|
||||
* @return username
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_USERNAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
|
||||
public User firstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get firstName
|
||||
* @return firstName
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_FIRST_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
|
||||
public User lastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get lastName
|
||||
* @return lastName
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_LAST_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
|
||||
public User email(String email) {
|
||||
this.email = email;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get email
|
||||
* @return email
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_EMAIL)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
|
||||
public User password(String password) {
|
||||
this.password = password;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get password
|
||||
* @return password
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_PASSWORD)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
|
||||
public User phone(String phone) {
|
||||
this.phone = phone;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get phone
|
||||
* @return phone
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_PHONE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
|
||||
public User userStatus(Integer userStatus) {
|
||||
this.userStatus = userStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* User Status
|
||||
* @return userStatus
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "User Status")
|
||||
@JsonProperty(JSON_PROPERTY_USER_STATUS)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
}
|
||||
|
||||
|
||||
public void setUserStatus(Integer userStatus) {
|
||||
this.userStatus = userStatus;
|
||||
}
|
||||
|
||||
|
||||
public User objectWithNoDeclaredProps(Object objectWithNoDeclaredProps) {
|
||||
this.objectWithNoDeclaredProps = objectWithNoDeclaredProps;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.
|
||||
* @return objectWithNoDeclaredProps
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value.")
|
||||
@JsonProperty(JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Object getObjectWithNoDeclaredProps() {
|
||||
return objectWithNoDeclaredProps;
|
||||
}
|
||||
|
||||
|
||||
public void setObjectWithNoDeclaredProps(Object objectWithNoDeclaredProps) {
|
||||
this.objectWithNoDeclaredProps = objectWithNoDeclaredProps;
|
||||
}
|
||||
|
||||
|
||||
public User objectWithNoDeclaredPropsNullable(Object objectWithNoDeclaredPropsNullable) {
|
||||
this.objectWithNoDeclaredPropsNullable = JsonNullable.<Object>of(objectWithNoDeclaredPropsNullable);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.
|
||||
* @return objectWithNoDeclaredPropsNullable
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "test code generation for nullable objects. Value must be a map of strings to values or the 'null' value.")
|
||||
@JsonIgnore
|
||||
|
||||
public Object getObjectWithNoDeclaredPropsNullable() {
|
||||
return objectWithNoDeclaredPropsNullable.orElse(null);
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public JsonNullable<Object> getObjectWithNoDeclaredPropsNullable_JsonNullable() {
|
||||
return objectWithNoDeclaredPropsNullable;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE)
|
||||
public void setObjectWithNoDeclaredPropsNullable_JsonNullable(JsonNullable<Object> objectWithNoDeclaredPropsNullable) {
|
||||
this.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable;
|
||||
}
|
||||
|
||||
public void setObjectWithNoDeclaredPropsNullable(Object objectWithNoDeclaredPropsNullable) {
|
||||
this.objectWithNoDeclaredPropsNullable = JsonNullable.<Object>of(objectWithNoDeclaredPropsNullable);
|
||||
}
|
||||
|
||||
|
||||
public User anyTypeProp(Object anyTypeProp) {
|
||||
this.anyTypeProp = JsonNullable.<Object>of(anyTypeProp);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389
|
||||
* @return anyTypeProp
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389")
|
||||
@JsonIgnore
|
||||
|
||||
public Object getAnyTypeProp() {
|
||||
return anyTypeProp.orElse(null);
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public JsonNullable<Object> getAnyTypeProp_JsonNullable() {
|
||||
return anyTypeProp;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP)
|
||||
public void setAnyTypeProp_JsonNullable(JsonNullable<Object> anyTypeProp) {
|
||||
this.anyTypeProp = anyTypeProp;
|
||||
}
|
||||
|
||||
public void setAnyTypeProp(Object anyTypeProp) {
|
||||
this.anyTypeProp = JsonNullable.<Object>of(anyTypeProp);
|
||||
}
|
||||
|
||||
|
||||
public User anyTypePropNullable(Object anyTypePropNullable) {
|
||||
this.anyTypePropNullable = JsonNullable.<Object>of(anyTypePropNullable);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.
|
||||
* @return anyTypePropNullable
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values.")
|
||||
@JsonIgnore
|
||||
|
||||
public Object getAnyTypePropNullable() {
|
||||
return anyTypePropNullable.orElse(null);
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public JsonNullable<Object> getAnyTypePropNullable_JsonNullable() {
|
||||
return anyTypePropNullable;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE)
|
||||
public void setAnyTypePropNullable_JsonNullable(JsonNullable<Object> anyTypePropNullable) {
|
||||
this.anyTypePropNullable = anyTypePropNullable;
|
||||
}
|
||||
|
||||
public void setAnyTypePropNullable(Object anyTypePropNullable) {
|
||||
this.anyTypePropNullable = JsonNullable.<Object>of(anyTypePropNullable);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this User object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
User user = (User) o;
|
||||
return Objects.equals(this.id, user.id) &&
|
||||
Objects.equals(this.username, user.username) &&
|
||||
Objects.equals(this.firstName, user.firstName) &&
|
||||
Objects.equals(this.lastName, user.lastName) &&
|
||||
Objects.equals(this.email, user.email) &&
|
||||
Objects.equals(this.password, user.password) &&
|
||||
Objects.equals(this.phone, user.phone) &&
|
||||
Objects.equals(this.userStatus, user.userStatus) &&
|
||||
Objects.equals(this.objectWithNoDeclaredProps, user.objectWithNoDeclaredProps) &&
|
||||
Objects.equals(this.objectWithNoDeclaredPropsNullable, user.objectWithNoDeclaredPropsNullable) &&
|
||||
Objects.equals(this.anyTypeProp, user.anyTypeProp) &&
|
||||
Objects.equals(this.anyTypePropNullable, user.anyTypePropNullable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus, objectWithNoDeclaredProps, objectWithNoDeclaredPropsNullable, anyTypeProp, anyTypePropNullable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class User {\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" username: ").append(toIndentedString(username)).append("\n");
|
||||
sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n");
|
||||
sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n");
|
||||
sb.append(" email: ").append(toIndentedString(email)).append("\n");
|
||||
sb.append(" password: ").append(toIndentedString(password)).append("\n");
|
||||
sb.append(" phone: ").append(toIndentedString(phone)).append("\n");
|
||||
sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n");
|
||||
sb.append(" objectWithNoDeclaredProps: ").append(toIndentedString(objectWithNoDeclaredProps)).append("\n");
|
||||
sb.append(" objectWithNoDeclaredPropsNullable: ").append(toIndentedString(objectWithNoDeclaredPropsNullable)).append("\n");
|
||||
sb.append(" anyTypeProp: ").append(toIndentedString(anyTypeProp)).append("\n");
|
||||
sb.append(" anyTypePropNullable: ").append(toIndentedString(anyTypePropNullable)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Whale
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
Whale.JSON_PROPERTY_HAS_BALEEN,
|
||||
Whale.JSON_PROPERTY_HAS_TEETH,
|
||||
Whale.JSON_PROPERTY_CLASS_NAME
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Whale {
|
||||
public static final String JSON_PROPERTY_HAS_BALEEN = "hasBaleen";
|
||||
private Boolean hasBaleen;
|
||||
|
||||
public static final String JSON_PROPERTY_HAS_TEETH = "hasTeeth";
|
||||
private Boolean hasTeeth;
|
||||
|
||||
public static final String JSON_PROPERTY_CLASS_NAME = "className";
|
||||
private String className;
|
||||
|
||||
|
||||
public Whale hasBaleen(Boolean hasBaleen) {
|
||||
this.hasBaleen = hasBaleen;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get hasBaleen
|
||||
* @return hasBaleen
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_HAS_BALEEN)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Boolean getHasBaleen() {
|
||||
return hasBaleen;
|
||||
}
|
||||
|
||||
|
||||
public void setHasBaleen(Boolean hasBaleen) {
|
||||
this.hasBaleen = hasBaleen;
|
||||
}
|
||||
|
||||
|
||||
public Whale hasTeeth(Boolean hasTeeth) {
|
||||
this.hasTeeth = hasTeeth;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get hasTeeth
|
||||
* @return hasTeeth
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_HAS_TEETH)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Boolean getHasTeeth() {
|
||||
return hasTeeth;
|
||||
}
|
||||
|
||||
|
||||
public void setHasTeeth(Boolean hasTeeth) {
|
||||
this.hasTeeth = hasTeeth;
|
||||
}
|
||||
|
||||
|
||||
public Whale className(String className) {
|
||||
this.className = className;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get className
|
||||
* @return className
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_CLASS_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
|
||||
public void setClassName(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this whale object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Whale whale = (Whale) o;
|
||||
return Objects.equals(this.hasBaleen, whale.hasBaleen) &&
|
||||
Objects.equals(this.hasTeeth, whale.hasTeeth) &&
|
||||
Objects.equals(this.className, whale.className);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(hasBaleen, hasTeeth, className);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Whale {\n");
|
||||
sb.append(" hasBaleen: ").append(toIndentedString(hasBaleen)).append("\n");
|
||||
sb.append(" hasTeeth: ").append(toIndentedString(hasTeeth)).append("\n");
|
||||
sb.append(" className: ").append(toIndentedString(className)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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.Map;
|
||||
import java.util.HashMap;
|
||||
import com.fasterxml.jackson.annotation.JsonAnyGetter;
|
||||
import com.fasterxml.jackson.annotation.JsonAnySetter;
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Zebra
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
Zebra.JSON_PROPERTY_TYPE,
|
||||
Zebra.JSON_PROPERTY_CLASS_NAME
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class Zebra extends HashMap<String, Object> {
|
||||
/**
|
||||
* Gets or Sets type
|
||||
*/
|
||||
public enum TypeEnum {
|
||||
PLAINS("plains"),
|
||||
|
||||
MOUNTAIN("mountain"),
|
||||
|
||||
GREVYS("grevys");
|
||||
|
||||
private String value;
|
||||
|
||||
TypeEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static TypeEnum fromValue(String value) {
|
||||
for (TypeEnum b : TypeEnum.values()) {
|
||||
if (b.value.equals(value)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + value + "'");
|
||||
}
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_TYPE = "type";
|
||||
private TypeEnum type;
|
||||
|
||||
public static final String JSON_PROPERTY_CLASS_NAME = "className";
|
||||
private String className;
|
||||
|
||||
|
||||
public Zebra type(TypeEnum type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type
|
||||
* @return type
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public TypeEnum getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
public void setType(TypeEnum type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
public Zebra className(String className) {
|
||||
this.className = className;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get className
|
||||
* @return className
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty(JSON_PROPERTY_CLASS_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
|
||||
public void setClassName(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
/**
|
||||
* A container for additional, undeclared properties.
|
||||
* This is a holder for any undeclared properties as specified with
|
||||
* the 'additionalProperties' keyword in the OAS document.
|
||||
*/
|
||||
private Map<String, Object> additionalProperties;
|
||||
|
||||
/**
|
||||
* Set the additional (undeclared) property with the specified name and value.
|
||||
* If the property does not already exist, create it otherwise replace it.
|
||||
*/
|
||||
@JsonAnySetter
|
||||
public Zebra putAdditionalProperty(String key, Object value) {
|
||||
if (this.additionalProperties == null) {
|
||||
this.additionalProperties = new HashMap<String, Object>();
|
||||
}
|
||||
this.additionalProperties.put(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the additional (undeclared) property.
|
||||
*/
|
||||
@JsonAnyGetter
|
||||
public Map<String, Object> getAdditionalProperties() {
|
||||
return additionalProperties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the additional (undeclared) property with the specified name.
|
||||
*/
|
||||
public Object getAdditionalProperty(String key) {
|
||||
if (this.additionalProperties == null) {
|
||||
return null;
|
||||
}
|
||||
return this.additionalProperties.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this zebra object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Zebra zebra = (Zebra) o;
|
||||
return Objects.equals(this.type, zebra.type) &&
|
||||
Objects.equals(this.className, zebra.className)&&
|
||||
Objects.equals(this.additionalProperties, zebra.additionalProperties) &&
|
||||
super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(type, className, super.hashCode(), additionalProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Zebra {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append(" type: ").append(toIndentedString(type)).append("\n");
|
||||
sb.append(" className: ").append(toIndentedString(className)).append("\n");
|
||||
sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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.api;
|
||||
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.model.Client;
|
||||
import org.junit.Test;
|
||||
import org.junit.Ignore;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* API tests for AnotherFakeApi
|
||||
*/
|
||||
@Ignore
|
||||
public class AnotherFakeApiTest {
|
||||
|
||||
private final AnotherFakeApi api = new AnotherFakeApi();
|
||||
|
||||
|
||||
/**
|
||||
* To test special tags
|
||||
*
|
||||
* To test special tags and operation ID starting with number
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void call123testSpecialTagsTest() throws ApiException {
|
||||
Client client = null;
|
||||
Client response =
|
||||
api.call123testSpecialTags(client);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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: \" \\
|
||||
*
|
||||
* 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.api;
|
||||
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.model.InlineResponseDefault;
|
||||
import org.junit.Test;
|
||||
import org.junit.Ignore;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* API tests for DefaultApi
|
||||
*/
|
||||
@Ignore
|
||||
public class DefaultApiTest {
|
||||
|
||||
private final DefaultApi api = new DefaultApi();
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void fooGetTest() throws ApiException {
|
||||
InlineResponseDefault response =
|
||||
api.fooGet();
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,338 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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.api;
|
||||
|
||||
import org.openapitools.client.ApiException;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.openapitools.client.model.HealthCheckResult;
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.openapitools.client.model.OuterComposite;
|
||||
import org.openapitools.client.model.OuterEnum;
|
||||
import org.openapitools.client.model.User;
|
||||
import org.junit.Test;
|
||||
import org.junit.Ignore;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* API tests for FakeApi
|
||||
*/
|
||||
@Ignore
|
||||
public class FakeApiTest {
|
||||
|
||||
private final FakeApi api = new FakeApi();
|
||||
|
||||
|
||||
/**
|
||||
* Health check endpoint
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void fakeHealthGetTest() throws ApiException {
|
||||
HealthCheckResult response =
|
||||
api.fakeHealthGet();
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Test serialization of outer boolean types
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void fakeOuterBooleanSerializeTest() throws ApiException {
|
||||
Boolean body = null;
|
||||
Boolean response =
|
||||
api.fakeOuterBooleanSerialize(body);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Test serialization of object with outer number type
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void fakeOuterCompositeSerializeTest() throws ApiException {
|
||||
OuterComposite outerComposite = null;
|
||||
OuterComposite response =
|
||||
api.fakeOuterCompositeSerialize(outerComposite);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Test serialization of outer number types
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void fakeOuterNumberSerializeTest() throws ApiException {
|
||||
BigDecimal body = null;
|
||||
BigDecimal response =
|
||||
api.fakeOuterNumberSerialize(body);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Test serialization of outer string types
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void fakeOuterStringSerializeTest() throws ApiException {
|
||||
String body = null;
|
||||
String response =
|
||||
api.fakeOuterStringSerialize(body);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of Enums
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void getArrayOfEnumsTest() throws ApiException {
|
||||
List<OuterEnum> response =
|
||||
api.getArrayOfEnums();
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testBodyWithFileSchemaTest() throws ApiException {
|
||||
FileSchemaTestClass fileSchemaTestClass = null;
|
||||
|
||||
api.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testBodyWithQueryParamsTest() throws ApiException {
|
||||
String query = null;
|
||||
User user = null;
|
||||
|
||||
api.testBodyWithQueryParams(query, user);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
* To test \"client\" model
|
||||
*
|
||||
* To test \"client\" model
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testClientModelTest() throws ApiException {
|
||||
Client client = null;
|
||||
Client response =
|
||||
api.testClientModel(client);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
*
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testEndpointParametersTest() throws ApiException {
|
||||
BigDecimal number = null;
|
||||
Double _double = null;
|
||||
String patternWithoutDelimiter = null;
|
||||
byte[] _byte = null;
|
||||
Integer integer = null;
|
||||
Integer int32 = null;
|
||||
Long int64 = null;
|
||||
Float _float = null;
|
||||
String string = null;
|
||||
File binary = null;
|
||||
LocalDate date = null;
|
||||
OffsetDateTime dateTime = null;
|
||||
String password = null;
|
||||
String paramCallback = null;
|
||||
|
||||
api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
* To test enum parameters
|
||||
*
|
||||
* To test enum parameters
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testEnumParametersTest() throws ApiException {
|
||||
List<String> enumHeaderStringArray = null;
|
||||
String enumHeaderString = null;
|
||||
List<String> enumQueryStringArray = null;
|
||||
String enumQueryString = null;
|
||||
Integer enumQueryInteger = null;
|
||||
Double enumQueryDouble = null;
|
||||
List<String> enumFormStringArray = null;
|
||||
String enumFormString = null;
|
||||
|
||||
api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake endpoint to test group parameters (optional)
|
||||
*
|
||||
* Fake endpoint to test group parameters (optional)
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testGroupParametersTest() throws ApiException {
|
||||
Integer requiredStringGroup = null;
|
||||
Boolean requiredBooleanGroup = null;
|
||||
Long requiredInt64Group = null;
|
||||
Integer stringGroup = null;
|
||||
Boolean booleanGroup = null;
|
||||
Long int64Group = null;
|
||||
|
||||
FakeApi.APItestGroupParametersRequest request = FakeApi.APItestGroupParametersRequest.newBuilder()
|
||||
.requiredStringGroup(requiredStringGroup)
|
||||
.requiredBooleanGroup(requiredBooleanGroup)
|
||||
.requiredInt64Group(requiredInt64Group)
|
||||
.stringGroup(stringGroup)
|
||||
.booleanGroup(booleanGroup)
|
||||
.int64Group(int64Group)
|
||||
.build();
|
||||
|
||||
api.testGroupParameters(request);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
* test inline additionalProperties
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testInlineAdditionalPropertiesTest() throws ApiException {
|
||||
Map<String, String> requestBody = null;
|
||||
|
||||
api.testInlineAdditionalProperties(requestBody);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
* test json serialization of form data
|
||||
*
|
||||
*
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testJsonFormDataTest() throws ApiException {
|
||||
String param = null;
|
||||
String param2 = null;
|
||||
|
||||
api.testJsonFormData(param, param2);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* To test the collection format in query parameters
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testQueryParameterCollectionFormatTest() throws ApiException {
|
||||
List<String> pipe = null;
|
||||
List<String> ioutil = null;
|
||||
List<String> http = null;
|
||||
List<String> url = null;
|
||||
List<String> context = null;
|
||||
|
||||
api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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: \" \\
|
||||
*
|
||||
* 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.api;
|
||||
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.model.Client;
|
||||
import org.junit.Test;
|
||||
import org.junit.Ignore;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* API tests for FakeClassnameTags123Api
|
||||
*/
|
||||
@Ignore
|
||||
public class FakeClassnameTags123ApiTest {
|
||||
|
||||
private final FakeClassnameTags123Api api = new FakeClassnameTags123Api();
|
||||
|
||||
|
||||
/**
|
||||
* To test class name in snake case
|
||||
*
|
||||
* To test class name in snake case
|
||||
*
|
||||
* @throws ApiException
|
||||
* if the Api call fails
|
||||
*/
|
||||
@Test
|
||||
public void testClassnameTest() throws ApiException {
|
||||
Client client = null;
|
||||
Client response =
|
||||
api.testClassname(client);
|
||||
|
||||
// TODO: test validations
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user