Merge remote-tracking branch 'origin/master' into 6.3.x

This commit is contained in:
William Cheng
2022-11-01 17:42:59 +08:00
1972 changed files with 36976 additions and 6630 deletions

View File

@@ -13,7 +13,7 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.3.+'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0'
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0'
}
}
@@ -65,7 +65,7 @@ if(hasProperty('target') && target == 'android') {
task.from variant.javaCompile.destinationDir
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
artifacts.add('archives', task);
artifacts.add('archives', task)
}
}
@@ -106,21 +106,21 @@ ext {
}
dependencies {
implementation 'io.swagger:swagger-annotations:1.6.5'
implementation 'io.swagger:swagger-annotations:1.6.8'
implementation "com.google.code.findbugs:jsr305:3.0.2"
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3'
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0'
implementation 'com.google.code.gson:gson:2.9.1'
implementation 'io.gsonfire:gson-fire:1.8.5'
implementation 'javax.ws.rs:jsr311-api:1.1.1'
implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1'
implementation 'org.openapitools:jackson-databind-nullable:0.2.3'
implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1'
implementation 'org.openapitools:jackson-databind-nullable:0.2.4'
implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.1'
testImplementation 'org.mockito:mockito-core:3.12.4'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.1'
}
javadoc {

View File

@@ -10,19 +10,20 @@ lazy val root = (project in file(".")).
resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq(
"io.swagger" % "swagger-annotations" % "1.6.5",
"com.squareup.okhttp3" % "okhttp" % "4.9.3",
"com.squareup.okhttp3" % "logging-interceptor" % "4.9.3",
"com.google.code.gson" % "gson" % "2.9.0",
"com.squareup.okhttp3" % "okhttp" % "4.10.0",
"com.squareup.okhttp3" % "logging-interceptor" % "4.10.0",
"com.google.code.gson" % "gson" % "2.9.1",
"org.apache.commons" % "commons-lang3" % "3.12.0",
"javax.ws.rs" % "jsr311-api" % "1.1.1",
"javax.ws.rs" % "javax.ws.rs-api" % "2.1.1",
"org.openapitools" % "jackson-databind-nullable" % "0.2.3",
"org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1",
"org.openapitools" % "jackson-databind-nullable" % "0.2.4",
"org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2",
"io.gsonfire" % "gson-fire" % "1.8.5" % "compile",
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
"com.google.code.findbugs" % "jsr305" % "3.0.2" % "compile",
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
"org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"
"org.junit.jupiter" % "junit-jupiter-api" % "5.9.1" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test",
"org.mockito" % "mockito-core" % "3.12.4" % "test"
)
)

View File

@@ -50,7 +50,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
<executions>
<execution>
<id>enforce-maven</id>
@@ -93,6 +93,7 @@
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
@@ -109,7 +110,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
<executions>
<execution>
<goals>
@@ -123,7 +124,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
<executions>
<execution>
<id>add_sources</id>
@@ -154,7 +155,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.2</version>
<version>3.4.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
@@ -177,7 +178,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
@@ -291,7 +292,7 @@
<dependency>
<groupId>org.apache.oltu.oauth2</groupId>
<artifactId>org.apache.oltu.oauth2.client</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
@@ -345,17 +346,17 @@
<maven.compiler.target>${java.version}</maven.compiler.target>
<gson-fire-version>1.8.5</gson-fire-version>
<swagger-core-version>1.6.5</swagger-core-version>
<okhttp-version>4.9.3</okhttp-version>
<gson-version>2.9.0</gson-version>
<okhttp-version>4.10.0</okhttp-version>
<gson-version>2.9.1</gson-version>
<commons-lang3-version>3.12.0</commons-lang3-version>
<jackson-databind-nullable-version>0.2.3</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.4</jackson-databind-nullable-version>
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<junit-version>5.8.2</junit-version>
<junit-platform-runner.version>1.6.2</junit-platform-runner.version>
<junit-version>5.9.1</junit-version>
<junit-platform-runner.version>1.9.1</junit-platform-runner.version>
<mockito-core-version>3.12.4</mockito-core-version>
<javax.ws.rs-api-version>2.1.1</javax.ws.rs-api-version>
<jsr311-api-version>1.1.1</jsr311-api-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spotless.version>2.21.0</spotless.version>
<spotless.version>2.27.2</spotless.version>
</properties>
</project>

View File

@@ -366,7 +366,7 @@ public class ApiClient {
* @return a {@link org.openapitools.client.ApiClient} object
*/
public ApiClient setDateFormat(DateFormat dateFormat) {
this.json.setDateFormat(dateFormat);
JSON.setDateFormat(dateFormat);
return this;
}
@@ -377,7 +377,7 @@ public class ApiClient {
* @return a {@link org.openapitools.client.ApiClient} object
*/
public ApiClient setSqlDateFormat(DateFormat dateFormat) {
this.json.setSqlDateFormat(dateFormat);
JSON.setSqlDateFormat(dateFormat);
return this;
}
@@ -388,7 +388,7 @@ public class ApiClient {
* @return a {@link org.openapitools.client.ApiClient} object
*/
public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
this.json.setOffsetDateTimeFormat(dateFormat);
JSON.setOffsetDateTimeFormat(dateFormat);
return this;
}
@@ -399,7 +399,7 @@ public class ApiClient {
* @return a {@link org.openapitools.client.ApiClient} object
*/
public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) {
this.json.setLocalDateFormat(dateFormat);
JSON.setLocalDateFormat(dateFormat);
return this;
}
@@ -410,7 +410,7 @@ public class ApiClient {
* @return a {@link org.openapitools.client.ApiClient} object
*/
public ApiClient setLenientOnJson(boolean lenientOnJson) {
this.json.setLenientOnJson(lenientOnJson);
JSON.setLenientOnJson(lenientOnJson);
return this;
}
@@ -704,7 +704,7 @@ public class ApiClient {
return "";
} else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) {
//Serialize to json string and remove the " enclosing characters
String jsonStr = json.serialize(param);
String jsonStr = JSON.serialize(param);
return jsonStr.substring(1, jsonStr.length() - 1);
} else if (param instanceof Collection) {
StringBuilder b = new StringBuilder();
@@ -712,7 +712,7 @@ public class ApiClient {
if (b.length() > 0) {
b.append(",");
}
b.append(String.valueOf(o));
b.append(o);
}
return b.toString();
} else {
@@ -963,7 +963,7 @@ public class ApiClient {
contentType = "application/json";
}
if (isJsonMime(contentType)) {
return json.deserialize(respBody, returnType);
return JSON.deserialize(respBody, returnType);
} else if (returnType.equals(String.class)) {
// Expecting string, return the raw response body.
return (T) respBody;
@@ -997,13 +997,13 @@ public class ApiClient {
} else if (isJsonMime(contentType)) {
String content;
if (obj != null) {
content = json.serialize(obj);
content = JSON.serialize(obj);
} else {
content = null;
}
return RequestBody.create(content, MediaType.parse(contentType));
} else if (obj instanceof String) {
return RequestBody.create(MediaType.parse(contentType), (String) obj);
return RequestBody.create((String) obj, MediaType.parse(contentType));
} else {
throw new ApiException("Content type \"" + contentType + "\" is not supported");
}
@@ -1476,7 +1476,7 @@ public class ApiClient {
} else {
String content;
if (obj != null) {
content = json.serialize(obj);
content = JSON.serialize(obj);
} else {
content = null;
}
@@ -1554,7 +1554,7 @@ public class ApiClient {
KeyStore caKeyStore = newEmptyKeyStore(password);
int index = 0;
for (Certificate certificate : certificates) {
String certificateAlias = "ca" + Integer.toString(index++);
String certificateAlias = "ca" + (index++);
caKeyStore.setCertificateEntry(certificateAlias, certificate);
}
trustManagerFactory.init(caKeyStore);

View File

@@ -42,7 +42,7 @@ public class ServerConfiguration {
throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
}
}
url = url.replaceAll("\\{" + name + "\\}", value);
url = url.replace("{" + name + "}", value);
}
return url;
}

View File

@@ -132,15 +132,12 @@ public class AnotherFakeApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call call123testSpecialTagsValidateBeforeCall(Client client, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'client' is set
if (client == null) {
throw new ApiException("Missing the required parameter 'client' when calling call123testSpecialTags(Async)");
}
okhttp3.Call localVarCall = call123testSpecialTagsCall(client, _callback);
return localVarCall;
return call123testSpecialTagsCall(client, _callback);
}

View File

@@ -118,7 +118,6 @@ public class DefaultApi {
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
@@ -131,10 +130,7 @@ public class DefaultApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call fooGetValidateBeforeCall(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = fooGetCall(_callback);
return localVarCall;
return fooGetCall(_callback);
}

View File

@@ -127,7 +127,6 @@ public class FakeApi {
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
@@ -140,10 +139,7 @@ public class FakeApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call fakeHealthGetValidateBeforeCall(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = fakeHealthGetCall(_callback);
return localVarCall;
return fakeHealthGetCall(_callback);
}
@@ -258,10 +254,7 @@ public class FakeApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call fakeOuterBooleanSerializeValidateBeforeCall(Boolean body, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = fakeOuterBooleanSerializeCall(body, _callback);
return localVarCall;
return fakeOuterBooleanSerializeCall(body, _callback);
}
@@ -379,10 +372,7 @@ public class FakeApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite outerComposite, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = fakeOuterCompositeSerializeCall(outerComposite, _callback);
return localVarCall;
return fakeOuterCompositeSerializeCall(outerComposite, _callback);
}
@@ -500,10 +490,7 @@ public class FakeApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call fakeOuterNumberSerializeValidateBeforeCall(BigDecimal body, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = fakeOuterNumberSerializeCall(body, _callback);
return localVarCall;
return fakeOuterNumberSerializeCall(body, _callback);
}
@@ -621,10 +608,7 @@ public class FakeApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call fakeOuterStringSerializeValidateBeforeCall(String body, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = fakeOuterStringSerializeCall(body, _callback);
return localVarCall;
return fakeOuterStringSerializeCall(body, _callback);
}
@@ -728,7 +712,6 @@ public class FakeApi {
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
@@ -741,10 +724,7 @@ public class FakeApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call getArrayOfEnumsValidateBeforeCall(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getArrayOfEnumsCall(_callback);
return localVarCall;
return getArrayOfEnumsCall(_callback);
}
@@ -838,7 +818,6 @@ public class FakeApi {
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -859,15 +838,12 @@ public class FakeApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call testBodyWithFileSchemaValidateBeforeCall(FileSchemaTestClass fileSchemaTestClass, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'fileSchemaTestClass' is set
if (fileSchemaTestClass == null) {
throw new ApiException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema(Async)");
}
okhttp3.Call localVarCall = testBodyWithFileSchemaCall(fileSchemaTestClass, _callback);
return localVarCall;
return testBodyWithFileSchemaCall(fileSchemaTestClass, _callback);
}
@@ -965,7 +941,6 @@ public class FakeApi {
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -986,20 +961,17 @@ public class FakeApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call testBodyWithQueryParamsValidateBeforeCall(String query, User user, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'query' is set
if (query == null) {
throw new ApiException("Missing the required parameter 'query' when calling testBodyWithQueryParams(Async)");
}
// verify the required parameter 'user' is set
if (user == null) {
throw new ApiException("Missing the required parameter 'user' when calling testBodyWithQueryParams(Async)");
}
okhttp3.Call localVarCall = testBodyWithQueryParamsCall(query, user, _callback);
return localVarCall;
return testBodyWithQueryParamsCall(query, user, _callback);
}
@@ -1116,15 +1088,12 @@ public class FakeApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call testClientModelValidateBeforeCall(Client client, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'client' is set
if (client == null) {
throw new ApiException("Missing the required parameter 'client' when calling testClientModel(Async)");
}
okhttp3.Call localVarCall = testClientModelCall(client, _callback);
return localVarCall;
return testClientModelCall(client, _callback);
}
@@ -1291,7 +1260,6 @@ public class FakeApi {
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -1312,30 +1280,27 @@ public class FakeApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call testEndpointParametersValidateBeforeCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'number' is set
if (number == null) {
throw new ApiException("Missing the required parameter 'number' when calling testEndpointParameters(Async)");
}
// verify the required parameter '_double' is set
if (_double == null) {
throw new ApiException("Missing the required parameter '_double' when calling testEndpointParameters(Async)");
}
// verify the required parameter 'patternWithoutDelimiter' is set
if (patternWithoutDelimiter == null) {
throw new ApiException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters(Async)");
}
// verify the required parameter '_byte' is set
if (_byte == null) {
throw new ApiException("Missing the required parameter '_byte' when calling testEndpointParameters(Async)");
}
okhttp3.Call localVarCall = testEndpointParametersCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, _callback);
return localVarCall;
return testEndpointParametersCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, _callback);
}
@@ -1510,7 +1475,6 @@ public class FakeApi {
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -1531,10 +1495,7 @@ public class FakeApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call testEnumParametersValidateBeforeCall(List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List<String> enumFormStringArray, String enumFormString, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = testEnumParametersCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, _callback);
return localVarCall;
return testEnumParametersCall(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, _callback);
}
@@ -1663,7 +1624,6 @@ public class FakeApi {
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -1671,7 +1631,6 @@ public class FakeApi {
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
@@ -1684,25 +1643,22 @@ public class FakeApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call testGroupParametersValidateBeforeCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'requiredStringGroup' is set
if (requiredStringGroup == null) {
throw new ApiException("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters(Async)");
}
// verify the required parameter 'requiredBooleanGroup' is set
if (requiredBooleanGroup == null) {
throw new ApiException("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters(Async)");
}
// verify the required parameter 'requiredInt64Group' is set
if (requiredInt64Group == null) {
throw new ApiException("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters(Async)");
}
okhttp3.Call localVarCall = testGroupParametersCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _callback);
return localVarCall;
return testGroupParametersCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, _callback);
}
@@ -1875,7 +1831,6 @@ public class FakeApi {
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -1896,15 +1851,12 @@ public class FakeApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call testInlineAdditionalPropertiesValidateBeforeCall(Map<String, String> requestBody, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'requestBody' is set
if (requestBody == null) {
throw new ApiException("Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties(Async)");
}
okhttp3.Call localVarCall = testInlineAdditionalPropertiesCall(requestBody, _callback);
return localVarCall;
return testInlineAdditionalPropertiesCall(requestBody, _callback);
}
@@ -2006,7 +1958,6 @@ public class FakeApi {
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -2027,20 +1978,17 @@ public class FakeApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call testJsonFormDataValidateBeforeCall(String param, String param2, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'param' is set
if (param == null) {
throw new ApiException("Missing the required parameter 'param' when calling testJsonFormData(Async)");
}
// verify the required parameter 'param2' is set
if (param2 == null) {
throw new ApiException("Missing the required parameter 'param2' when calling testJsonFormData(Async)");
}
okhttp3.Call localVarCall = testJsonFormDataCall(param, param2, _callback);
return localVarCall;
return testJsonFormDataCall(param, param2, _callback);
}
@@ -2160,7 +2108,6 @@ public class FakeApi {
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -2168,7 +2115,6 @@ public class FakeApi {
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
@@ -2181,35 +2127,32 @@ public class FakeApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call testQueryParameterCollectionFormatValidateBeforeCall(List<String> pipe, List<String> ioutil, List<String> http, List<String> url, List<String> context, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'pipe' is set
if (pipe == null) {
throw new ApiException("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat(Async)");
}
// verify the required parameter 'ioutil' is set
if (ioutil == null) {
throw new ApiException("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat(Async)");
}
// verify the required parameter 'http' is set
if (http == null) {
throw new ApiException("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat(Async)");
}
// verify the required parameter 'url' is set
if (url == null) {
throw new ApiException("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat(Async)");
}
// verify the required parameter 'context' is set
if (context == null) {
throw new ApiException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat(Async)");
}
okhttp3.Call localVarCall = testQueryParameterCollectionFormatCall(pipe, ioutil, http, url, context, _callback);
return localVarCall;
return testQueryParameterCollectionFormatCall(pipe, ioutil, http, url, context, _callback);
}

View File

@@ -132,15 +132,12 @@ public class FakeClassnameTags123Api {
@SuppressWarnings("rawtypes")
private okhttp3.Call testClassnameValidateBeforeCall(Client client, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'client' is set
if (client == null) {
throw new ApiException("Missing the required parameter 'client' when calling testClassname(Async)");
}
okhttp3.Call localVarCall = testClassnameCall(client, _callback);
return localVarCall;
return testClassnameCall(client, _callback);
}

View File

@@ -113,7 +113,6 @@ public class PetApi {
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -121,7 +120,8 @@ public class PetApi {
}
final String[] localVarContentTypes = {
"application/json", "application/xml"
"application/json",
"application/xml"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
@@ -134,15 +134,12 @@ public class PetApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call addPetValidateBeforeCall(Pet pet, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'pet' is set
if (pet == null) {
throw new ApiException("Missing the required parameter 'pet' when calling addPet(Async)");
}
okhttp3.Call localVarCall = addPetCall(pet, _callback);
return localVarCall;
return addPetCall(pet, _callback);
}
@@ -228,7 +225,7 @@ public class PetApi {
// create path and map variables
String localVarPath = "/pet/{petId}"
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
@@ -241,7 +238,6 @@ public class PetApi {
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -249,7 +245,6 @@ public class PetApi {
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
@@ -262,15 +257,12 @@ public class PetApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call deletePetValidateBeforeCall(Long petId, String apiKey, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException("Missing the required parameter 'petId' when calling deletePet(Async)");
}
okhttp3.Call localVarCall = deletePetCall(petId, apiKey, _callback);
return localVarCall;
return deletePetCall(petId, apiKey, _callback);
}
@@ -371,7 +363,8 @@ public class PetApi {
}
final String[] localVarAccepts = {
"application/xml", "application/json"
"application/xml",
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -379,7 +372,6 @@ public class PetApi {
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
@@ -392,15 +384,12 @@ public class PetApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call findPetsByStatusValidateBeforeCall(List<String> status, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'status' is set
if (status == null) {
throw new ApiException("Missing the required parameter 'status' when calling findPetsByStatus(Async)");
}
okhttp3.Call localVarCall = findPetsByStatusCall(status, _callback);
return localVarCall;
return findPetsByStatusCall(status, _callback);
}
@@ -507,7 +496,8 @@ public class PetApi {
}
final String[] localVarAccepts = {
"application/xml", "application/json"
"application/xml",
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -515,7 +505,6 @@ public class PetApi {
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
@@ -529,15 +518,12 @@ public class PetApi {
@Deprecated
@SuppressWarnings("rawtypes")
private okhttp3.Call findPetsByTagsValidateBeforeCall(List<String> tags, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'tags' is set
if (tags == null) {
throw new ApiException("Missing the required parameter 'tags' when calling findPetsByTags(Async)");
}
okhttp3.Call localVarCall = findPetsByTagsCall(tags, _callback);
return localVarCall;
return findPetsByTagsCall(tags, _callback);
}
@@ -637,7 +623,7 @@ public class PetApi {
// create path and map variables
String localVarPath = "/pet/{petId}"
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
@@ -646,7 +632,8 @@ public class PetApi {
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/xml", "application/json"
"application/xml",
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -654,7 +641,6 @@ public class PetApi {
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
@@ -667,15 +653,12 @@ public class PetApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call getPetByIdValidateBeforeCall(Long petId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException("Missing the required parameter 'petId' when calling getPetById(Async)");
}
okhttp3.Call localVarCall = getPetByIdCall(petId, _callback);
return localVarCall;
return getPetByIdCall(petId, _callback);
}
@@ -780,7 +763,6 @@ public class PetApi {
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -788,7 +770,8 @@ public class PetApi {
}
final String[] localVarContentTypes = {
"application/json", "application/xml"
"application/json",
"application/xml"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
@@ -801,15 +784,12 @@ public class PetApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call updatePetValidateBeforeCall(Pet pet, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'pet' is set
if (pet == null) {
throw new ApiException("Missing the required parameter 'pet' when calling updatePet(Async)");
}
okhttp3.Call localVarCall = updatePetCall(pet, _callback);
return localVarCall;
return updatePetCall(pet, _callback);
}
@@ -902,7 +882,7 @@ public class PetApi {
// create path and map variables
String localVarPath = "/pet/{petId}"
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
@@ -919,7 +899,6 @@ public class PetApi {
}
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -940,15 +919,12 @@ public class PetApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call updatePetWithFormValidateBeforeCall(Long petId, String name, String status, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException("Missing the required parameter 'petId' when calling updatePetWithForm(Async)");
}
okhttp3.Call localVarCall = updatePetWithFormCall(petId, name, status, _callback);
return localVarCall;
return updatePetWithFormCall(petId, name, status, _callback);
}
@@ -1041,7 +1017,7 @@ public class PetApi {
// create path and map variables
String localVarPath = "/pet/{petId}/uploadImage"
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
@@ -1079,15 +1055,12 @@ public class PetApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call uploadFileValidateBeforeCall(Long petId, String additionalMetadata, File _file, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException("Missing the required parameter 'petId' when calling uploadFile(Async)");
}
okhttp3.Call localVarCall = uploadFileCall(petId, additionalMetadata, _file, _callback);
return localVarCall;
return uploadFileCall(petId, additionalMetadata, _file, _callback);
}
@@ -1184,7 +1157,7 @@ public class PetApi {
// create path and map variables
String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile"
.replaceAll("\\{" + "petId" + "\\}", localVarApiClient.escapeString(petId.toString()));
.replace("{" + "petId" + "}", localVarApiClient.escapeString(petId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
@@ -1222,20 +1195,17 @@ public class PetApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call uploadFileWithRequiredFileValidateBeforeCall(Long petId, File requiredFile, String additionalMetadata, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile(Async)");
}
// verify the required parameter 'requiredFile' is set
if (requiredFile == null) {
throw new ApiException("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile(Async)");
}
okhttp3.Call localVarCall = uploadFileWithRequiredFileCall(petId, requiredFile, additionalMetadata, _callback);
return localVarCall;
return uploadFileWithRequiredFileCall(petId, requiredFile, additionalMetadata, _callback);
}

View File

@@ -104,7 +104,7 @@ public class StoreApi {
// create path and map variables
String localVarPath = "/store/order/{order_id}"
.replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString()));
.replace("{" + "order_id" + "}", localVarApiClient.escapeString(orderId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
@@ -113,7 +113,6 @@ public class StoreApi {
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -121,7 +120,6 @@ public class StoreApi {
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
@@ -134,15 +132,12 @@ public class StoreApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteOrderValidateBeforeCall(String orderId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new ApiException("Missing the required parameter 'orderId' when calling deleteOrder(Async)");
}
okhttp3.Call localVarCall = deleteOrderCall(orderId, _callback);
return localVarCall;
return deleteOrderCall(orderId, _callback);
}
@@ -245,7 +240,6 @@ public class StoreApi {
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
@@ -258,10 +252,7 @@ public class StoreApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call getInventoryValidateBeforeCall(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = getInventoryCall(_callback);
return localVarCall;
return getInventoryCall(_callback);
}
@@ -349,7 +340,7 @@ public class StoreApi {
// create path and map variables
String localVarPath = "/store/order/{order_id}"
.replaceAll("\\{" + "order_id" + "\\}", localVarApiClient.escapeString(orderId.toString()));
.replace("{" + "order_id" + "}", localVarApiClient.escapeString(orderId.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
@@ -358,7 +349,8 @@ public class StoreApi {
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/xml", "application/json"
"application/xml",
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -366,7 +358,6 @@ public class StoreApi {
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
@@ -379,15 +370,12 @@ public class StoreApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call getOrderByIdValidateBeforeCall(Long orderId, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'orderId' is set
if (orderId == null) {
throw new ApiException("Missing the required parameter 'orderId' when calling getOrderById(Async)");
}
okhttp3.Call localVarCall = getOrderByIdCall(orderId, _callback);
return localVarCall;
return getOrderByIdCall(orderId, _callback);
}
@@ -491,7 +479,8 @@ public class StoreApi {
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/xml", "application/json"
"application/xml",
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -512,15 +501,12 @@ public class StoreApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call placeOrderValidateBeforeCall(Order order, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'order' is set
if (order == null) {
throw new ApiException("Missing the required parameter 'order' when calling placeOrder(Async)");
}
okhttp3.Call localVarCall = placeOrderCall(order, _callback);
return localVarCall;
return placeOrderCall(order, _callback);
}

View File

@@ -112,7 +112,6 @@ public class UserApi {
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -133,15 +132,12 @@ public class UserApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call createUserValidateBeforeCall(User user, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'user' is set
if (user == null) {
throw new ApiException("Missing the required parameter 'user' when calling createUser(Async)");
}
okhttp3.Call localVarCall = createUserCall(user, _callback);
return localVarCall;
return createUserCall(user, _callback);
}
@@ -234,7 +230,6 @@ public class UserApi {
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -255,15 +250,12 @@ public class UserApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call createUsersWithArrayInputValidateBeforeCall(List<User> user, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'user' is set
if (user == null) {
throw new ApiException("Missing the required parameter 'user' when calling createUsersWithArrayInput(Async)");
}
okhttp3.Call localVarCall = createUsersWithArrayInputCall(user, _callback);
return localVarCall;
return createUsersWithArrayInputCall(user, _callback);
}
@@ -356,7 +348,6 @@ public class UserApi {
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -377,15 +368,12 @@ public class UserApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call createUsersWithListInputValidateBeforeCall(List<User> user, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'user' is set
if (user == null) {
throw new ApiException("Missing the required parameter 'user' when calling createUsersWithListInput(Async)");
}
okhttp3.Call localVarCall = createUsersWithListInputCall(user, _callback);
return localVarCall;
return createUsersWithListInputCall(user, _callback);
}
@@ -471,7 +459,7 @@ public class UserApi {
// create path and map variables
String localVarPath = "/user/{username}"
.replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString()));
.replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
@@ -480,7 +468,6 @@ public class UserApi {
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -488,7 +475,6 @@ public class UserApi {
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
@@ -501,15 +487,12 @@ public class UserApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call deleteUserValidateBeforeCall(String username, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling deleteUser(Async)");
}
okhttp3.Call localVarCall = deleteUserCall(username, _callback);
return localVarCall;
return deleteUserCall(username, _callback);
}
@@ -599,7 +582,7 @@ public class UserApi {
// create path and map variables
String localVarPath = "/user/{username}"
.replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString()));
.replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
@@ -608,7 +591,8 @@ public class UserApi {
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/xml", "application/json"
"application/xml",
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -616,7 +600,6 @@ public class UserApi {
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
@@ -629,15 +612,12 @@ public class UserApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call getUserByNameValidateBeforeCall(String username, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling getUserByName(Async)");
}
okhttp3.Call localVarCall = getUserByNameCall(username, _callback);
return localVarCall;
return getUserByNameCall(username, _callback);
}
@@ -750,7 +730,8 @@ public class UserApi {
}
final String[] localVarAccepts = {
"application/xml", "application/json"
"application/xml",
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -758,7 +739,6 @@ public class UserApi {
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
@@ -771,20 +751,17 @@ public class UserApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call loginUserValidateBeforeCall(String username, String password, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling loginUser(Async)");
}
// verify the required parameter 'password' is set
if (password == null) {
throw new ApiException("Missing the required parameter 'password' when calling loginUser(Async)");
}
okhttp3.Call localVarCall = loginUserCall(username, password, _callback);
return localVarCall;
return loginUserCall(username, password, _callback);
}
@@ -886,7 +863,6 @@ public class UserApi {
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -894,7 +870,6 @@ public class UserApi {
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
if (localVarContentType != null) {
@@ -907,10 +882,7 @@ public class UserApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call logoutUserValidateBeforeCall(final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = logoutUserCall(_callback);
return localVarCall;
return logoutUserCall(_callback);
}
@@ -994,7 +966,7 @@ public class UserApi {
// create path and map variables
String localVarPath = "/user/{username}"
.replaceAll("\\{" + "username" + "\\}", localVarApiClient.escapeString(username.toString()));
.replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
@@ -1003,7 +975,6 @@ public class UserApi {
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
@@ -1024,20 +995,17 @@ public class UserApi {
@SuppressWarnings("rawtypes")
private okhttp3.Call updateUserValidateBeforeCall(String username, User user, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'username' is set
if (username == null) {
throw new ApiException("Missing the required parameter 'username' when calling updateUser(Async)");
}
// verify the required parameter 'user' is set
if (user == null) {
throw new ApiException("Missing the required parameter 'user' when calling updateUser(Async)");
}
okhttp3.Call localVarCall = updateUserCall(username, user, _callback);
return localVarCall;
return updateUserCall(username, user, _callback);
}

View File

@@ -55,6 +55,7 @@ public class OAuthOkHttpClient implements HttpClient {
response.body().string(),
response.body().contentType().toString(),
response.code(),
response.headers().toMultimap(),
responseClass);
} catch (IOException e) {
throw new OAuthSystemException(e);

View File

@@ -65,8 +65,8 @@ public class RetryingOAuth extends OAuth implements Interceptor {
.setClientSecret(clientSecret));
setFlow(flow);
if (parameters != null) {
for (String paramName : parameters.keySet()) {
tokenRequestBuilder.setParameter(paramName, parameters.get(paramName));
for (Map.Entry<String, String> entry : parameters.entrySet()) {
tokenRequestBuilder.setParameter(entry.getKey(), entry.getValue());
}
}
}
@@ -129,8 +129,8 @@ public class RetryingOAuth extends OAuth implements Interceptor {
}
Map<String, String> headers = oAuthRequest.getHeaders();
for (String headerName : headers.keySet()) {
requestBuilder.addHeader(headerName, headers.get(headerName));
for (Map.Entry<String, String> entry : headers.entrySet()) {
requestBuilder.addHeader(entry.getKey(), entry.getValue());
}
requestBuilder.url(oAuthRequest.getLocationUri());

View File

@@ -41,6 +41,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -312,6 +313,10 @@ public class AdditionalPropertiesClass {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the AdditionalPropertiesClass instance itself
*/
public AdditionalPropertiesClass putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -323,6 +328,8 @@ public class AdditionalPropertiesClass {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -330,6 +337,9 @@ public class AdditionalPropertiesClass {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -489,8 +499,10 @@ public class AdditionalPropertiesClass {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -40,6 +40,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -118,6 +119,10 @@ public class Animal {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the Animal instance itself
*/
public Animal putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -129,6 +134,8 @@ public class Animal {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -136,6 +143,9 @@ public class Animal {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -115,6 +116,10 @@ public class Apple {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the Apple instance itself
*/
public Apple putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -126,6 +131,8 @@ public class Apple {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -133,6 +140,9 @@ public class Apple {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -269,8 +279,10 @@ public class Apple {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

View File

@@ -41,6 +41,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -99,6 +100,10 @@ public class ArrayOfArrayOfNumberOnly {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ArrayOfArrayOfNumberOnly instance itself
*/
public ArrayOfArrayOfNumberOnly putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -110,6 +115,8 @@ public class ArrayOfArrayOfNumberOnly {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -117,6 +124,9 @@ public class ArrayOfArrayOfNumberOnly {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -190,8 +200,8 @@ public class ArrayOfArrayOfNumberOnly {
throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfArrayOfNumberOnly is not found in the empty JSON string", ArrayOfArrayOfNumberOnly.openapiRequiredFields.toString()));
}
}
// ensure the json data is an array
if (!jsonObj.get("ArrayArrayNumber").isJsonArray()) {
// ensure the optional json data is an array if present
if (jsonObj.get("ArrayArrayNumber") != null && !jsonObj.get("ArrayArrayNumber").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `ArrayArrayNumber` to be an array in the JSON string but got `%s`", jsonObj.get("ArrayArrayNumber").toString()));
}
}
@@ -248,8 +258,10 @@ public class ArrayOfArrayOfNumberOnly {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -41,6 +41,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -153,6 +154,10 @@ public class ArrayOfInlineAllOf {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ArrayOfInlineAllOf instance itself
*/
public ArrayOfInlineAllOf putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -164,6 +169,8 @@ public class ArrayOfInlineAllOf {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -171,6 +178,9 @@ public class ArrayOfInlineAllOf {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -329,8 +339,10 @@ public class ArrayOfInlineAllOf {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -115,6 +116,10 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInner {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ArrayOfInlineAllOfArrayAllofDogPropertyInner instance itself
*/
public ArrayOfInlineAllOfArrayAllofDogPropertyInner putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -126,6 +131,8 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInner {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -133,6 +140,9 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInner {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -269,8 +279,10 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInner {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -88,6 +89,10 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf instance itself
*/
public ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -99,6 +104,8 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -106,6 +113,9 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -236,8 +246,10 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -88,6 +89,10 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf1 {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf1 instance itself
*/
public ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf1 putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -99,6 +104,8 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf1 {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -106,6 +113,9 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf1 {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -236,8 +246,10 @@ public class ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf1 {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -1,273 +0,0 @@
/*
* 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 com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.openapitools.client.JSON;
/**
* ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf {
public static final String SERIALIZED_NAME_COLOR = "color";
@SerializedName(SERIALIZED_NAME_COLOR)
private String color;
public ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf() {
}
public ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf color(String color) {
this.color = color;
return this;
}
/**
* Get color
* @return color
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
/**
* 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.
*/
public ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf 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.
*/
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);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf arrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf = (ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf) o;
return Objects.equals(this.color, arrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf.color)&&
Objects.equals(this.additionalProperties, arrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(color, additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf {\n");
sb.append(" color: ").append(toIndentedString(color)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("color");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf is not found in the empty JSON string", ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf.openapiRequiredFields.toString()));
}
}
if (jsonObj.get("color") != null && !jsonObj.get("color").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf.class));
return (TypeAdapter<T>) new TypeAdapter<ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf>() {
@Override
public void write(JsonWriter out, ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additonal properties
if (value.getAdditionalProperties() != null) {
for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) {
if (entry.getValue() instanceof String)
obj.addProperty(entry.getKey(), (String) entry.getValue());
else if (entry.getValue() instanceof Number)
obj.addProperty(entry.getKey(), (Number) entry.getValue());
else if (entry.getValue() instanceof Boolean)
obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
else if (entry.getValue() instanceof Character)
obj.addProperty(entry.getKey(), (Character) entry.getValue());
else {
obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
}
}
}
elementAdapter.write(out, obj);
}
@Override
public ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
// store additional fields in the deserialized instance
ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf instance = thisAdapter.fromJsonTree(jsonObj);
for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) {
if (!openapiFields.contains(entry.getKey())) {
if (entry.getValue().isJsonPrimitive()) { // primitive type
if (entry.getValue().getAsJsonPrimitive().isString())
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
else if (entry.getValue().getAsJsonPrimitive().isNumber())
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
else if (entry.getValue().getAsJsonPrimitive().isBoolean())
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();
}
}
/**
* Create an instance of ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf given an JSON string
*
* @param jsonString JSON string
* @return An instance of ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf
* @throws IOException if the JSON string is invalid with respect to ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf
*/
public static ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf.class);
}
/**
* Convert an instance of ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}

View File

@@ -1,273 +0,0 @@
/*
* 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 com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.openapitools.client.JSON;
/**
* ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 {
public static final String SERIALIZED_NAME_COLOR = "color";
@SerializedName(SERIALIZED_NAME_COLOR)
private String color;
public ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1() {
}
public ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 color(String color) {
this.color = color;
return this;
}
/**
* Get color
* @return color
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
/**
* 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.
*/
public ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 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.
*/
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);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 arrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 = (ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1) o;
return Objects.equals(this.color, arrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.color)&&
Objects.equals(this.additionalProperties, arrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(color, additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 {\n");
sb.append(" color: ").append(toIndentedString(color)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("color");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 is not found in the empty JSON string", ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.openapiRequiredFields.toString()));
}
}
if (jsonObj.get("color") != null && !jsonObj.get("color").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString()));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.class));
return (TypeAdapter<T>) new TypeAdapter<ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1>() {
@Override
public void write(JsonWriter out, ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additonal properties
if (value.getAdditionalProperties() != null) {
for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) {
if (entry.getValue() instanceof String)
obj.addProperty(entry.getKey(), (String) entry.getValue());
else if (entry.getValue() instanceof Number)
obj.addProperty(entry.getKey(), (Number) entry.getValue());
else if (entry.getValue() instanceof Boolean)
obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
else if (entry.getValue() instanceof Character)
obj.addProperty(entry.getKey(), (Character) entry.getValue());
else {
obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
}
}
}
elementAdapter.write(out, obj);
}
@Override
public ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
// store additional fields in the deserialized instance
ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 instance = thisAdapter.fromJsonTree(jsonObj);
for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) {
if (!openapiFields.contains(entry.getKey())) {
if (entry.getValue().isJsonPrimitive()) { // primitive type
if (entry.getValue().getAsJsonPrimitive().isString())
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
else if (entry.getValue().getAsJsonPrimitive().isNumber())
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
else if (entry.getValue().getAsJsonPrimitive().isBoolean())
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();
}
}
/**
* Create an instance of ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 given an JSON string
*
* @param jsonString JSON string
* @return An instance of ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1
* @throws IOException if the JSON string is invalid with respect to ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1
*/
public static ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1.class);
}
/**
* Convert an instance of ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}

View File

@@ -41,6 +41,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -99,6 +100,10 @@ public class ArrayOfNumberOnly {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ArrayOfNumberOnly instance itself
*/
public ArrayOfNumberOnly putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -110,6 +115,8 @@ public class ArrayOfNumberOnly {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -117,6 +124,9 @@ public class ArrayOfNumberOnly {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -190,8 +200,8 @@ public class ArrayOfNumberOnly {
throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfNumberOnly is not found in the empty JSON string", ArrayOfNumberOnly.openapiRequiredFields.toString()));
}
}
// ensure the json data is an array
if (!jsonObj.get("ArrayNumber").isJsonArray()) {
// ensure the optional json data is an array if present
if (jsonObj.get("ArrayNumber") != null && !jsonObj.get("ArrayNumber").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `ArrayNumber` to be an array in the JSON string but got `%s`", jsonObj.get("ArrayNumber").toString()));
}
}
@@ -248,8 +258,10 @@ public class ArrayOfNumberOnly {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -41,6 +41,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -169,6 +170,10 @@ public class ArrayTest {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ArrayTest instance itself
*/
public ArrayTest putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -180,6 +185,8 @@ public class ArrayTest {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -187,6 +194,9 @@ public class ArrayTest {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -266,16 +276,16 @@ public class ArrayTest {
throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayTest is not found in the empty JSON string", ArrayTest.openapiRequiredFields.toString()));
}
}
// ensure the json data is an array
if (!jsonObj.get("array_of_string").isJsonArray()) {
// ensure the optional json data is an array if present
if (jsonObj.get("array_of_string") != null && !jsonObj.get("array_of_string").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `array_of_string` to be an array in the JSON string but got `%s`", jsonObj.get("array_of_string").toString()));
}
// ensure the json data is an array
if (!jsonObj.get("array_array_of_integer").isJsonArray()) {
// ensure the optional json data is an array if present
if (jsonObj.get("array_array_of_integer") != null && !jsonObj.get("array_array_of_integer").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `array_array_of_integer` to be an array in the JSON string but got `%s`", jsonObj.get("array_array_of_integer").toString()));
}
// ensure the json data is an array
if (!jsonObj.get("array_array_of_model").isJsonArray()) {
// ensure the optional json data is an array if present
if (jsonObj.get("array_array_of_model") != null && !jsonObj.get("array_array_of_model").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `array_array_of_model` to be an array in the JSON string but got `%s`", jsonObj.get("array_array_of_model").toString()));
}
}
@@ -332,8 +342,10 @@ public class ArrayTest {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -39,6 +39,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -89,6 +90,10 @@ public class Banana {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the Banana instance itself
*/
public Banana putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -100,6 +105,8 @@ public class Banana {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -107,6 +114,9 @@ public class Banana {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -234,8 +244,10 @@ public class Banana {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -39,6 +39,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -88,6 +89,10 @@ public class BasquePig {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the BasquePig instance itself
*/
public BasquePig putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -99,6 +104,8 @@ public class BasquePig {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -106,6 +113,9 @@ public class BasquePig {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -244,8 +254,10 @@ public class BasquePig {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -223,6 +224,10 @@ public class Capitalization {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the Capitalization instance itself
*/
public Capitalization putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -234,6 +239,8 @@ public class Capitalization {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -241,6 +248,9 @@ public class Capitalization {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -401,8 +411,10 @@ public class Capitalization {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -39,6 +39,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -90,6 +91,10 @@ public class Cat extends Animal {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the Cat instance itself
*/
public Cat putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -101,6 +106,8 @@ public class Cat extends Animal {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -108,6 +115,9 @@ public class Cat extends Animal {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -247,8 +257,10 @@ public class Cat extends Animal {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -88,6 +89,10 @@ public class CatAllOf {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the CatAllOf instance itself
*/
public CatAllOf putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -99,6 +104,8 @@ public class CatAllOf {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -106,6 +113,9 @@ public class CatAllOf {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -233,8 +243,10 @@ public class CatAllOf {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -115,6 +116,10 @@ public class Category {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the Category instance itself
*/
public Category putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -126,6 +131,8 @@ public class Category {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -133,6 +140,9 @@ public class Category {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -274,8 +284,10 @@ public class Category {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -89,6 +90,10 @@ public class ClassModel {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ClassModel instance itself
*/
public ClassModel putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -100,6 +105,8 @@ public class ClassModel {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -107,6 +114,9 @@ public class ClassModel {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -237,8 +247,10 @@ public class ClassModel {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -88,6 +89,10 @@ public class Client {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the Client instance itself
*/
public Client putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -99,6 +104,8 @@ public class Client {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -106,6 +113,9 @@ public class Client {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -236,8 +246,10 @@ public class Client {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -115,6 +116,10 @@ public class ComplexQuadrilateral {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ComplexQuadrilateral instance itself
*/
public ComplexQuadrilateral putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -126,6 +131,8 @@ public class ComplexQuadrilateral {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -133,6 +140,9 @@ public class ComplexQuadrilateral {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -278,8 +288,10 @@ public class ComplexQuadrilateral {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -88,6 +89,10 @@ public class DanishPig {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the DanishPig instance itself
*/
public DanishPig putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -99,6 +104,8 @@ public class DanishPig {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -106,6 +113,9 @@ public class DanishPig {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -244,8 +254,10 @@ public class DanishPig {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -90,6 +91,10 @@ public class DeprecatedObject {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the DeprecatedObject instance itself
*/
public DeprecatedObject putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -101,6 +106,8 @@ public class DeprecatedObject {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -108,6 +115,9 @@ public class DeprecatedObject {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -238,8 +248,10 @@ public class DeprecatedObject {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -39,6 +39,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -90,6 +91,10 @@ public class Dog extends Animal {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the Dog instance itself
*/
public Dog putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -101,6 +106,8 @@ public class Dog extends Animal {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -108,6 +115,9 @@ public class Dog extends Animal {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -247,8 +257,10 @@ public class Dog extends Animal {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -88,6 +89,10 @@ public class DogAllOf {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the DogAllOf instance itself
*/
public DogAllOf putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -99,6 +104,8 @@ public class DogAllOf {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -106,6 +113,9 @@ public class DogAllOf {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -236,8 +246,10 @@ public class DogAllOf {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -45,6 +45,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

View File

@@ -40,6 +40,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -219,6 +220,10 @@ public class EnumArrays {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the EnumArrays instance itself
*/
public EnumArrays putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -230,6 +235,8 @@ public class EnumArrays {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -237,6 +244,9 @@ public class EnumArrays {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -316,8 +326,8 @@ public class EnumArrays {
if ((jsonObj.get("just_symbol") != null && !jsonObj.get("just_symbol").isJsonNull()) && !jsonObj.get("just_symbol").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `just_symbol` to be a primitive type in the JSON string but got `%s`", jsonObj.get("just_symbol").toString()));
}
// ensure the json data is an array
if (!jsonObj.get("array_enum").isJsonArray()) {
// ensure the optional json data is an array if present
if (jsonObj.get("array_enum") != null && !jsonObj.get("array_enum").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `array_enum` to be an array in the JSON string but got `%s`", jsonObj.get("array_enum").toString()));
}
}
@@ -374,8 +384,10 @@ public class EnumArrays {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -136,6 +137,10 @@ public class EnumStringDiscriminator {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the EnumStringDiscriminator instance itself
*/
public EnumStringDiscriminator putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -147,6 +152,8 @@ public class EnumStringDiscriminator {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -154,6 +161,9 @@ public class EnumStringDiscriminator {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -289,8 +299,10 @@ public class EnumStringDiscriminator {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -43,6 +43,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -548,6 +549,10 @@ public class EnumTest {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the EnumTest instance itself
*/
public EnumTest putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -559,6 +564,8 @@ public class EnumTest {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -566,6 +573,9 @@ public class EnumTest {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -742,8 +752,10 @@ public class EnumTest {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -115,6 +116,10 @@ public class EquilateralTriangle {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the EquilateralTriangle instance itself
*/
public EquilateralTriangle putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -126,6 +131,8 @@ public class EquilateralTriangle {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -133,6 +140,9 @@ public class EquilateralTriangle {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -278,8 +288,10 @@ public class EquilateralTriangle {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -41,6 +41,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -126,6 +127,10 @@ public class FileSchemaTestClass {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the FileSchemaTestClass instance itself
*/
public FileSchemaTestClass putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -137,6 +142,8 @@ public class FileSchemaTestClass {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -144,6 +151,9 @@ public class FileSchemaTestClass {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -292,8 +302,10 @@ public class FileSchemaTestClass {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -88,6 +89,10 @@ public class Foo {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the Foo instance itself
*/
public Foo putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -99,6 +104,8 @@ public class Foo {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -106,6 +113,9 @@ public class Foo {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -236,8 +246,10 @@ public class Foo {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -39,6 +39,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -89,6 +90,10 @@ public class FooGetDefaultResponse {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the FooGetDefaultResponse instance itself
*/
public FooGetDefaultResponse putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -100,6 +105,8 @@ public class FooGetDefaultResponse {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -107,6 +114,9 @@ public class FooGetDefaultResponse {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -238,8 +248,10 @@ public class FooGetDefaultResponse {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -43,6 +43,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -535,6 +536,10 @@ public class FormatTest {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the FormatTest instance itself
*/
public FormatTest putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -546,6 +551,8 @@ public class FormatTest {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -553,6 +560,9 @@ public class FormatTest {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -757,8 +767,10 @@ public class FormatTest {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -39,6 +39,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -90,6 +91,10 @@ public class GrandparentAnimal {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the GrandparentAnimal instance itself
*/
public GrandparentAnimal putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -101,6 +106,8 @@ public class GrandparentAnimal {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -108,6 +115,9 @@ public class GrandparentAnimal {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -107,6 +108,10 @@ public class HasOnlyReadOnly {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the HasOnlyReadOnly instance itself
*/
public HasOnlyReadOnly putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -118,6 +123,8 @@ public class HasOnlyReadOnly {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -125,6 +132,9 @@ public class HasOnlyReadOnly {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -261,8 +271,10 @@ public class HasOnlyReadOnly {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -39,6 +39,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -90,6 +91,10 @@ public class HealthCheckResult {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the HealthCheckResult instance itself
*/
public HealthCheckResult putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -101,6 +106,8 @@ public class HealthCheckResult {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -108,6 +115,9 @@ public class HealthCheckResult {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -249,8 +259,10 @@ public class HealthCheckResult {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -1,275 +0,0 @@
/*
* 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 com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.openapitools.client.model.Foo;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.openapitools.client.JSON;
/**
* InlineResponseDefault
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class InlineResponseDefault {
public static final String SERIALIZED_NAME_STRING = "string";
@SerializedName(SERIALIZED_NAME_STRING)
private Foo string;
public InlineResponseDefault() {
}
public InlineResponseDefault string(Foo string) {
this.string = string;
return this;
}
/**
* Get string
* @return string
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
public Foo getString() {
return string;
}
public void setString(Foo string) {
this.string = string;
}
/**
* 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.
*/
public InlineResponseDefault 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.
*/
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);
}
@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)&&
Objects.equals(this.additionalProperties, inlineResponseDefault.additionalProperties);
}
@Override
public int hashCode() {
return Objects.hash(string, additionalProperties);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InlineResponseDefault {\n");
sb.append(" string: ").append(toIndentedString(string)).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 ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("string");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
}
/**
* Validates the JSON Object and throws an exception if issues found
*
* @param jsonObj JSON Object
* @throws IOException if the JSON Object is invalid with respect to InlineResponseDefault
*/
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
if (jsonObj == null) {
if (InlineResponseDefault.openapiRequiredFields.isEmpty()) {
return;
} else { // has required fields
throw new IllegalArgumentException(String.format("The required field(s) %s in InlineResponseDefault is not found in the empty JSON string", InlineResponseDefault.openapiRequiredFields.toString()));
}
}
// validate the optional field `string`
if (jsonObj.getAsJsonObject("string") != null) {
Foo.validateJsonObject(jsonObj.getAsJsonObject("string"));
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!InlineResponseDefault.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'InlineResponseDefault' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<InlineResponseDefault> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(InlineResponseDefault.class));
return (TypeAdapter<T>) new TypeAdapter<InlineResponseDefault>() {
@Override
public void write(JsonWriter out, InlineResponseDefault value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
obj.remove("additionalProperties");
// serialize additonal properties
if (value.getAdditionalProperties() != null) {
for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) {
if (entry.getValue() instanceof String)
obj.addProperty(entry.getKey(), (String) entry.getValue());
else if (entry.getValue() instanceof Number)
obj.addProperty(entry.getKey(), (Number) entry.getValue());
else if (entry.getValue() instanceof Boolean)
obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
else if (entry.getValue() instanceof Character)
obj.addProperty(entry.getKey(), (Character) entry.getValue());
else {
obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());
}
}
}
elementAdapter.write(out, obj);
}
@Override
public InlineResponseDefault read(JsonReader in) throws IOException {
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
validateJsonObject(jsonObj);
// store additional fields in the deserialized instance
InlineResponseDefault instance = thisAdapter.fromJsonTree(jsonObj);
for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) {
if (!openapiFields.contains(entry.getKey())) {
if (entry.getValue().isJsonPrimitive()) { // primitive type
if (entry.getValue().getAsJsonPrimitive().isString())
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
else if (entry.getValue().getAsJsonPrimitive().isNumber())
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
else if (entry.getValue().getAsJsonPrimitive().isBoolean())
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}
return instance;
}
}.nullSafe();
}
}
/**
* Create an instance of InlineResponseDefault given an JSON string
*
* @param jsonString JSON string
* @return An instance of InlineResponseDefault
* @throws IOException if the JSON string is invalid with respect to InlineResponseDefault
*/
public static InlineResponseDefault fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, InlineResponseDefault.class);
}
/**
* Convert an instance of InlineResponseDefault to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

View File

@@ -40,6 +40,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -250,6 +251,10 @@ public class MapTest {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the MapTest instance itself
*/
public MapTest putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -261,6 +266,8 @@ public class MapTest {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -268,6 +275,9 @@ public class MapTest {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -404,8 +414,10 @@ public class MapTest {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -43,6 +43,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -155,6 +156,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the MixedPropertiesAndAdditionalPropertiesClass instance itself
*/
public MixedPropertiesAndAdditionalPropertiesClass putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -166,6 +171,8 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -173,6 +180,9 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -309,8 +319,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -116,6 +117,10 @@ public class Model200Response {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the Model200Response instance itself
*/
public Model200Response putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -127,6 +132,8 @@ public class Model200Response {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -134,6 +141,9 @@ public class Model200Response {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -267,8 +277,10 @@ public class Model200Response {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -142,6 +143,10 @@ public class ModelApiResponse {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ModelApiResponse instance itself
*/
public ModelApiResponse putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -153,6 +158,8 @@ public class ModelApiResponse {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -160,6 +167,9 @@ public class ModelApiResponse {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -299,8 +309,10 @@ public class ModelApiResponse {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -89,6 +90,10 @@ public class ModelFile {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ModelFile instance itself
*/
public ModelFile putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -100,6 +105,8 @@ public class ModelFile {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -107,6 +114,9 @@ public class ModelFile {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -237,8 +247,10 @@ public class ModelFile {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -88,6 +89,10 @@ public class ModelList {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ModelList instance itself
*/
public ModelList putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -99,6 +104,8 @@ public class ModelList {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -106,6 +113,9 @@ public class ModelList {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -236,8 +246,10 @@ public class ModelList {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -89,6 +90,10 @@ public class ModelReturn {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ModelReturn instance itself
*/
public ModelReturn putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -100,6 +105,8 @@ public class ModelReturn {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -107,6 +114,9 @@ public class ModelReturn {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -234,8 +244,10 @@ public class ModelReturn {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -162,6 +163,10 @@ public class Name {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the Name instance itself
*/
public Name putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -173,6 +178,8 @@ public class Name {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -180,6 +187,9 @@ public class Name {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -327,8 +337,10 @@ public class Name {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -46,6 +46,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -550,16 +551,16 @@ public class NullableClass {
if ((jsonObj.get("string_prop") != null && !jsonObj.get("string_prop").isJsonNull()) && !jsonObj.get("string_prop").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `string_prop` to be a primitive type in the JSON string but got `%s`", jsonObj.get("string_prop").toString()));
}
// ensure the json data is an array
if (!jsonObj.get("array_nullable_prop").isJsonArray()) {
// ensure the optional json data is an array if present
if (jsonObj.get("array_nullable_prop") != null && !jsonObj.get("array_nullable_prop").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `array_nullable_prop` to be an array in the JSON string but got `%s`", jsonObj.get("array_nullable_prop").toString()));
}
// ensure the json data is an array
if (!jsonObj.get("array_and_items_nullable_prop").isJsonArray()) {
// ensure the optional json data is an array if present
if (jsonObj.get("array_and_items_nullable_prop") != null && !jsonObj.get("array_and_items_nullable_prop").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `array_and_items_nullable_prop` to be an array in the JSON string but got `%s`", jsonObj.get("array_and_items_nullable_prop").toString()));
}
// ensure the json data is an array
if (!jsonObj.get("array_items_nullable").isJsonArray()) {
// ensure the optional json data is an array if present
if (jsonObj.get("array_items_nullable") != null && !jsonObj.get("array_items_nullable").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `array_items_nullable` to be an array in the JSON string but got `%s`", jsonObj.get("array_items_nullable").toString()));
}
}

View File

@@ -39,6 +39,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -89,6 +90,10 @@ public class NumberOnly {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the NumberOnly instance itself
*/
public NumberOnly putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -100,6 +105,8 @@ public class NumberOnly {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -107,6 +114,9 @@ public class NumberOnly {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -234,8 +244,10 @@ public class NumberOnly {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -42,6 +42,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -187,6 +188,10 @@ public class ObjectWithDeprecatedFields {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ObjectWithDeprecatedFields instance itself
*/
public ObjectWithDeprecatedFields putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -198,6 +203,8 @@ public class ObjectWithDeprecatedFields {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -205,6 +212,9 @@ public class ObjectWithDeprecatedFields {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -294,8 +304,8 @@ public class ObjectWithDeprecatedFields {
if (jsonObj.get("deprecatedRef") != null && !jsonObj.get("deprecatedRef").isJsonNull()) {
DeprecatedObject.validateJsonObject(jsonObj.getAsJsonObject("deprecatedRef"));
}
// ensure the json data is an array
if (!jsonObj.get("bars").isJsonArray()) {
// ensure the optional json data is an array if present
if (jsonObj.get("bars") != null && !jsonObj.get("bars").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `bars` to be an array in the JSON string but got `%s`", jsonObj.get("bars").toString()));
}
}
@@ -352,8 +362,10 @@ public class ObjectWithDeprecatedFields {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -39,6 +39,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -273,6 +274,10 @@ public class Order {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the Order instance itself
*/
public Order putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -284,6 +289,8 @@ public class Order {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -291,6 +298,9 @@ public class Order {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -436,8 +446,10 @@ public class Order {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -39,6 +39,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -143,6 +144,10 @@ public class OuterComposite {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the OuterComposite instance itself
*/
public OuterComposite putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -154,6 +159,8 @@ public class OuterComposite {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -161,6 +168,9 @@ public class OuterComposite {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -297,8 +307,10 @@ public class OuterComposite {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -39,6 +39,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -63,6 +64,10 @@ public class ParentPet extends GrandparentAnimal {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ParentPet instance itself
*/
public ParentPet putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -74,6 +79,8 @@ public class ParentPet extends GrandparentAnimal {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -81,6 +88,9 @@ public class ParentPet extends GrandparentAnimal {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -214,8 +224,10 @@ public class ParentPet extends GrandparentAnimal {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -42,6 +42,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -289,6 +290,10 @@ public class Pet {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the Pet instance itself
*/
public Pet putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -300,6 +305,8 @@ public class Pet {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -307,6 +314,9 @@ public class Pet {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -411,8 +421,10 @@ public class Pet {
if (!jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
// ensure the json data is an array
if ((jsonObj.get("photoUrls") != null && !jsonObj.get("photoUrls").isJsonNull()) && !jsonObj.get("photoUrls").isJsonArray()) {
// ensure the required json array is present
if (jsonObj.get("photoUrls") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("photoUrls").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `photoUrls` to be an array in the JSON string but got `%s`", jsonObj.get("photoUrls").toString()));
}
if (jsonObj.get("tags") != null && !jsonObj.get("tags").isJsonNull()) {
@@ -486,8 +498,10 @@ public class Pet {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -42,6 +42,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -286,6 +287,10 @@ public class PetWithRequiredTags {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the PetWithRequiredTags instance itself
*/
public PetWithRequiredTags putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -297,6 +302,8 @@ public class PetWithRequiredTags {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -304,6 +311,9 @@ public class PetWithRequiredTags {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -409,8 +419,10 @@ public class PetWithRequiredTags {
if (!jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
}
// ensure the json data is an array
if ((jsonObj.get("photoUrls") != null && !jsonObj.get("photoUrls").isJsonNull()) && !jsonObj.get("photoUrls").isJsonArray()) {
// ensure the required json array is present
if (jsonObj.get("photoUrls") == null) {
throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`");
} else if (!jsonObj.get("photoUrls").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `photoUrls` to be an array in the JSON string but got `%s`", jsonObj.get("photoUrls").toString()));
}
// ensure the json data is an array
@@ -480,8 +492,10 @@ public class PetWithRequiredTags {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -88,6 +89,10 @@ public class QuadrilateralInterface {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the QuadrilateralInterface instance itself
*/
public QuadrilateralInterface putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -99,6 +104,8 @@ public class QuadrilateralInterface {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -106,6 +113,9 @@ public class QuadrilateralInterface {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -244,8 +254,10 @@ public class QuadrilateralInterface {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -114,6 +115,10 @@ public class ReadOnlyFirst {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ReadOnlyFirst instance itself
*/
public ReadOnlyFirst putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -125,6 +130,8 @@ public class ReadOnlyFirst {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -132,6 +139,9 @@ public class ReadOnlyFirst {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -268,8 +278,10 @@ public class ReadOnlyFirst {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -115,6 +116,10 @@ public class ScaleneTriangle {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ScaleneTriangle instance itself
*/
public ScaleneTriangle putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -126,6 +131,8 @@ public class ScaleneTriangle {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -133,6 +140,9 @@ public class ScaleneTriangle {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -278,8 +288,10 @@ public class ScaleneTriangle {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -88,6 +89,10 @@ public class ShapeInterface {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the ShapeInterface instance itself
*/
public ShapeInterface putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -99,6 +104,8 @@ public class ShapeInterface {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -106,6 +113,9 @@ public class ShapeInterface {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -244,8 +254,10 @@ public class ShapeInterface {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -115,6 +116,10 @@ public class SimpleQuadrilateral {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the SimpleQuadrilateral instance itself
*/
public SimpleQuadrilateral putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -126,6 +131,8 @@ public class SimpleQuadrilateral {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -133,6 +140,9 @@ public class SimpleQuadrilateral {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -278,8 +288,10 @@ public class SimpleQuadrilateral {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -115,6 +116,10 @@ public class SpecialModelName {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the SpecialModelName instance itself
*/
public SpecialModelName putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -126,6 +131,8 @@ public class SpecialModelName {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -133,6 +140,9 @@ public class SpecialModelName {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -266,8 +276,10 @@ public class SpecialModelName {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -115,6 +116,10 @@ public class Tag {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the Tag instance itself
*/
public Tag putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -126,6 +131,8 @@ public class Tag {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -133,6 +140,9 @@ public class Tag {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -266,8 +276,10 @@ public class Tag {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -88,6 +89,10 @@ public class TriangleInterface {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the TriangleInterface instance itself
*/
public TriangleInterface putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -99,6 +104,8 @@ public class TriangleInterface {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -106,6 +113,9 @@ public class TriangleInterface {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -244,8 +254,10 @@ public class TriangleInterface {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -39,6 +39,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -386,6 +387,10 @@ public class User {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the User instance itself
*/
public User putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -397,6 +402,8 @@ public class User {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -404,6 +411,9 @@ public class User {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -593,8 +603,10 @@ public class User {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -142,6 +143,10 @@ public class Whale {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the Whale instance itself
*/
public Whale putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -153,6 +158,8 @@ public class Whale {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -160,6 +167,9 @@ public class Whale {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -304,8 +314,10 @@ public class Whale {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -38,6 +38,7 @@ import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -164,6 +165,10 @@ public class Zebra {
/**
* Set the additional (undeclared) property with the specified name and value.
* If the property does not already exist, create it otherwise replace it.
*
* @param key name of the property
* @param value value of the property
* @return the Zebra instance itself
*/
public Zebra putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
@@ -175,6 +180,8 @@ public class Zebra {
/**
* Return the additional (undeclared) property.
*
* @return a map of objects
*/
public Map<String, Object> getAdditionalProperties() {
return additionalProperties;
@@ -182,6 +189,9 @@ public class Zebra {
/**
* Return the additional (undeclared) property with the specified name.
*
* @param key name of the property
* @return an object
*/
public Object getAdditionalProperty(String key) {
if (this.additionalProperties == null) {
@@ -326,8 +336,10 @@ public class Zebra {
instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
else
throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
} else { // non-primitive type
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
} else if (entry.getValue().isJsonArray()) {
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
} else { // JSON object
instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
}
}
}

View File

@@ -21,32 +21,33 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.openapitools.client.model.Foo;
import org.junit.jupiter.api.Assertions;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* Model tests for InlineResponseDefault
* Model tests for ArrayOfArrayOfNumberOnly
*/
public class InlineResponseDefaultTest {
private final InlineResponseDefault model = new InlineResponseDefault();
public class ArrayOfArrayOfNumberOnlyTest {
private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly();
/**
* Model tests for InlineResponseDefault
* Model tests for ArrayOfArrayOfNumberOnly
*/
@Test
public void testInlineResponseDefault() {
// TODO: test InlineResponseDefault
public void testArrayOfArrayOfNumberOnly() {
// TODO: test ArrayOfArrayOfNumberOnly
}
/**
* Test the property 'string'
* Test the property 'arrayArrayNumber'
*/
@Test
public void stringTest() {
// TODO: test string
public void arrayArrayNumberTest() {
// TODO: test arrayArrayNumber
}
}

View File

@@ -21,8 +21,6 @@ import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.openapitools.client.model.ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf;
import org.openapitools.client.model.DogAllOf;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

View File

@@ -1,50 +0,0 @@
/*
* 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 com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* Model tests for ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1
*/
public class ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1Test {
private final ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1 model = new ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1();
/**
* Model tests for ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1
*/
@Test
public void testArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1() {
// TODO: test ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf1
}
/**
* Test the property 'color'
*/
@Test
public void colorTest() {
// TODO: test color
}
}

View File

@@ -1,50 +0,0 @@
/*
* 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 com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* Model tests for ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf
*/
public class ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOfTest {
private final ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf model = new ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf();
/**
* Model tests for ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf
*/
@Test
public void testArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf() {
// TODO: test ArrayOfInlineAllOfArrayAllofDogPropertyItemsAllOf
}
/**
* Test the property 'color'
*/
@Test
public void colorTest() {
// TODO: test color
}
}

View File

@@ -0,0 +1,94 @@
/*
* 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 com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.client.model.Category;
import org.openapitools.client.model.Tag;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* Model tests for Pet
*/
public class PetTest {
private final Pet model = new Pet();
/**
* Model tests for Pet
*/
@Test
public void testPet() {
// TODO: test Pet
}
/**
* Test the property 'id'
*/
@Test
public void idTest() {
// TODO: test id
}
/**
* Test the property 'category'
*/
@Test
public void categoryTest() {
// TODO: test category
}
/**
* Test the property 'name'
*/
@Test
public void nameTest() {
// TODO: test name
}
/**
* Test the property 'photoUrls'
*/
@Test
public void photoUrlsTest() {
// TODO: test photoUrls
}
/**
* Test the property 'tags'
*/
@Test
public void tagsTest() {
// TODO: test tags
}
/**
* Test the property 'status'
*/
@Test
public void statusTest() {
// TODO: test status
}
}