forked from loafle/openapi-generator-original
Fix default empty collections when collection is optional (#18080)
* Fix optional empty collection as default * Fix test * Fix test
This commit is contained in:
@@ -1178,8 +1178,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
schema = ModelUtils.getReferencedSchema(this.openAPI, schema);
|
||||
if (ModelUtils.isArraySchema(schema)) {
|
||||
if (schema.getDefault() == null) {
|
||||
// nullable, optional or containerDefaultToNull set to true
|
||||
if (cp.isNullable || !cp.required || containerDefaultToNull) {
|
||||
// nullable or containerDefaultToNull set to true
|
||||
if (cp.isNullable || containerDefaultToNull) {
|
||||
return null;
|
||||
} else {
|
||||
if (ModelUtils.isSet(schema)) {
|
||||
|
||||
@@ -605,11 +605,11 @@ public class AbstractJavaCodegenTest {
|
||||
|
||||
ModelUtils.setGenerateAliasAsModel(false);
|
||||
defaultValue = codegen.toDefaultValue(codegen.fromProperty("", schema), schema);
|
||||
Assert.assertEquals(defaultValue, null);
|
||||
Assert.assertEquals(defaultValue, "new ArrayList<>()");
|
||||
|
||||
ModelUtils.setGenerateAliasAsModel(true);
|
||||
defaultValue = codegen.toDefaultValue(codegen.fromProperty("", schema), schema);
|
||||
Assert.assertEquals(defaultValue, null);
|
||||
Assert.assertEquals(defaultValue, "new ArrayList<>()");
|
||||
|
||||
// Create a map schema with additionalProperties type set to array alias
|
||||
schema = new MapSchema().additionalProperties(new Schema().$ref("#/components/schemas/NestedArray"));
|
||||
|
||||
@@ -75,7 +75,7 @@ public class JavaModelEnumTest {
|
||||
Assert.assertEquals(enumVar.dataType, "List<String>");
|
||||
Assert.assertEquals(enumVar.datatypeWithEnum, "List<NameEnum>");
|
||||
Assert.assertEquals(enumVar.name, "name");
|
||||
Assert.assertEquals(enumVar.defaultValue, null);
|
||||
Assert.assertEquals(enumVar.defaultValue, "new ArrayList<>()");
|
||||
Assert.assertEquals(enumVar.baseType, "List");
|
||||
Assert.assertTrue(enumVar.isEnum);
|
||||
|
||||
@@ -108,7 +108,7 @@ public class JavaModelEnumTest {
|
||||
Assert.assertEquals(enumVar.dataType, "List<List<String>>");
|
||||
Assert.assertEquals(enumVar.datatypeWithEnum, "List<List<NameEnum>>");
|
||||
Assert.assertEquals(enumVar.name, "name");
|
||||
Assert.assertEquals(enumVar.defaultValue, null);
|
||||
Assert.assertEquals(enumVar.defaultValue, "new ArrayList<>()");
|
||||
Assert.assertEquals(enumVar.baseType, "List");
|
||||
Assert.assertTrue(enumVar.isEnum);
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ public class JavaModelTest {
|
||||
Assert.assertEquals(property.setter, "setUrls");
|
||||
Assert.assertEquals(property.dataType, "List<String>");
|
||||
Assert.assertEquals(property.name, "urls");
|
||||
Assert.assertEquals(property.defaultValue, null);
|
||||
Assert.assertEquals(property.defaultValue, "new ArrayList<>()");
|
||||
Assert.assertEquals(property.baseType, "List");
|
||||
Assert.assertEquals(property.containerType, "array");
|
||||
Assert.assertFalse(property.required);
|
||||
@@ -162,7 +162,7 @@ public class JavaModelTest {
|
||||
Assert.assertEquals(property.setter, "setUrls");
|
||||
Assert.assertEquals(property.dataType, "Set<String>");
|
||||
Assert.assertEquals(property.name, "urls");
|
||||
Assert.assertEquals(property.defaultValue, null);
|
||||
Assert.assertEquals(property.defaultValue, "new LinkedHashSet<>()");
|
||||
Assert.assertEquals(property.baseType, "Set");
|
||||
Assert.assertEquals(property.containerType, "set");
|
||||
Assert.assertFalse(property.required);
|
||||
@@ -248,7 +248,7 @@ public class JavaModelTest {
|
||||
Assert.assertEquals(property.setter, "setList2D");
|
||||
Assert.assertEquals(property.dataType, "List<List<Pet>>");
|
||||
Assert.assertEquals(property.name, "list2D");
|
||||
Assert.assertEquals(property.defaultValue, null);
|
||||
Assert.assertEquals(property.defaultValue, "new ArrayList<>()");
|
||||
Assert.assertEquals(property.baseType, "List");
|
||||
Assert.assertEquals(property.containerType, "array");
|
||||
Assert.assertFalse(property.required);
|
||||
@@ -333,7 +333,7 @@ public class JavaModelTest {
|
||||
Assert.assertEquals(property.setter, "setChildren");
|
||||
Assert.assertEquals(property.dataType, "List<Children>");
|
||||
Assert.assertEquals(property.name, "children");
|
||||
Assert.assertEquals(property.defaultValue, null);
|
||||
Assert.assertEquals(property.defaultValue, "new ArrayList<>()");
|
||||
Assert.assertEquals(property.baseType, "List");
|
||||
Assert.assertEquals(property.containerType, "array");
|
||||
Assert.assertFalse(property.required);
|
||||
@@ -396,7 +396,7 @@ public class JavaModelTest {
|
||||
Assert.assertEquals(property.setter, "setChildren");
|
||||
Assert.assertEquals(property.dataType, "List<Children>");
|
||||
Assert.assertEquals(property.name, "children");
|
||||
Assert.assertEquals(property.defaultValue, null);
|
||||
Assert.assertEquals(property.defaultValue, "new ArrayList<>()");
|
||||
Assert.assertEquals(property.baseType, "List");
|
||||
Assert.assertEquals(property.containerType, "array");
|
||||
Assert.assertFalse(property.required);
|
||||
@@ -429,7 +429,7 @@ public class JavaModelTest {
|
||||
Assert.assertEquals(property.setter, "setChildren");
|
||||
Assert.assertEquals(property.dataType, "Set<Children>");
|
||||
Assert.assertEquals(property.name, "children");
|
||||
Assert.assertEquals(property.defaultValue, null);
|
||||
Assert.assertEquals(property.defaultValue, "new LinkedHashSet<>()");
|
||||
Assert.assertEquals(property.baseType, "Set");
|
||||
Assert.assertEquals(property.containerType, "set");
|
||||
Assert.assertFalse(property.required);
|
||||
@@ -466,7 +466,7 @@ public class JavaModelTest {
|
||||
Assert.assertEquals(property.setter, "setChildren");
|
||||
Assert.assertEquals(property.dataType, "List<Child>");
|
||||
Assert.assertEquals(property.name, "children");
|
||||
Assert.assertEquals(property.defaultValue, null);
|
||||
Assert.assertEquals(property.defaultValue, "new ArrayList<>()");
|
||||
Assert.assertEquals(property.baseType, "List");
|
||||
Assert.assertEquals(property.containerType, "array");
|
||||
Assert.assertFalse(property.required);
|
||||
@@ -974,7 +974,7 @@ public class JavaModelTest {
|
||||
Assert.assertEquals(property2.setter, "setArray");
|
||||
Assert.assertEquals(property2.dataType, "List<String>");
|
||||
Assert.assertEquals(property2.name, "array");
|
||||
Assert.assertEquals(property2.defaultValue, null);
|
||||
Assert.assertEquals(property2.defaultValue, "new ArrayList<>()");
|
||||
Assert.assertEquals(property2.baseType, "List");
|
||||
Assert.assertTrue(property2.isContainer);
|
||||
Assert.assertTrue(property2.isXmlWrapped);
|
||||
|
||||
@@ -4518,4 +4518,34 @@ public class SpringCodegenTest {
|
||||
.assertMethod("equals")
|
||||
;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void optionalListShouldBeEmpty() throws IOException {
|
||||
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
|
||||
output.deleteOnExit();
|
||||
|
||||
OpenAPI openAPI = new OpenAPIParser()
|
||||
.readLocation("src/test/resources/3_1/petstore.yaml", null, new ParseOptions()).getOpenAPI();
|
||||
SpringCodegen codegen = new SpringCodegen();
|
||||
codegen.setLibrary(SPRING_CLOUD_LIBRARY);
|
||||
codegen.setOutputDir(output.getAbsolutePath());
|
||||
codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "xyz.model");
|
||||
codegen.additionalProperties().put(CodegenConstants.API_NAME_SUFFIX, "Controller");
|
||||
codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.controller");
|
||||
codegen.additionalProperties().put(CodegenConstants.MODEL_NAME_SUFFIX, "Dto");
|
||||
|
||||
|
||||
ClientOptInput input = new ClientOptInput()
|
||||
.openAPI(openAPI)
|
||||
.config(codegen);
|
||||
|
||||
DefaultGenerator generator = new DefaultGenerator();
|
||||
Map<String, File> files = generator.opts(input).generate().stream()
|
||||
.collect(Collectors.toMap(File::getName, Function.identity()));
|
||||
|
||||
JavaFileAssert.assertThat(files.get("PetDto.java"))
|
||||
.fileContains("private List<@Valid TagDto> tags = new ArrayList<>();")
|
||||
.fileContains("private List<String> photoUrls = new ArrayList<>();");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ public class DefaultValue {
|
||||
private List<Integer> arrayIntegerDefault = new ArrayList<>(Arrays.asList(1, 3));
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_STRING = "array_string";
|
||||
private List<String> arrayString;
|
||||
private List<String> arrayString = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_STRING_NULLABLE = "array_string_nullable";
|
||||
private JsonNullable<List<String>> arrayStringNullable = JsonNullable.<List<String>>undefined();
|
||||
|
||||
@@ -57,7 +57,7 @@ public class Pet {
|
||||
private List<String> photoUrls = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_TAGS = "tags";
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -39,7 +39,7 @@ import java.util.StringJoiner;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
public static final String JSON_PROPERTY_VALUES = "values";
|
||||
private List<String> values;
|
||||
private List<String> values = new ArrayList<>();
|
||||
|
||||
public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() {
|
||||
}
|
||||
|
||||
@@ -13,17 +13,23 @@
|
||||
|
||||
package org.openapitools.client;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import org.junit.Assert;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.api.*;
|
||||
import org.openapitools.client.model.*;
|
||||
import org.junit.Test;
|
||||
import org.junit.Ignore;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.openapitools.client.api.BodyApi;
|
||||
import org.openapitools.client.api.QueryApi;
|
||||
import org.openapitools.client.model.Category;
|
||||
import org.openapitools.client.model.DataQuery;
|
||||
import org.openapitools.client.model.DefaultValue;
|
||||
import org.openapitools.client.model.Pet;
|
||||
import org.openapitools.client.model.Query;
|
||||
import org.openapitools.client.model.StringEnumRef;
|
||||
import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
/**
|
||||
* API tests for QueryApi
|
||||
@@ -42,17 +48,17 @@ public class CustomTest {
|
||||
*/
|
||||
@Test
|
||||
public void testEchoBodyPet() throws ApiException {
|
||||
Pet queryObject = new Pet().id(12345L).name("Hello World").
|
||||
photoUrls(Arrays.asList(new String[]{"http://a.com", "http://b.com"})).category(new Category().id(987L).name("new category"));
|
||||
final Pet queryObject = new Pet().id( 12345L ).name( "Hello World" ).
|
||||
photoUrls( Arrays.asList( new String[] { "http://a.com", "http://b.com" } ) ).category( new Category().id( 987L ).name( "new category" ) );
|
||||
|
||||
Pet p = bodyApi.testEchoBodyPet(queryObject);
|
||||
Assert.assertNotNull(p);
|
||||
Assert.assertEquals("Hello World", p.getName());
|
||||
Assert.assertEquals(Long.valueOf(12345L), p.getId());
|
||||
final Pet p = bodyApi.testEchoBodyPet( queryObject );
|
||||
Assert.assertNotNull( p );
|
||||
Assert.assertEquals( "Hello World", p.getName() );
|
||||
Assert.assertEquals( Long.valueOf( 12345L ), p.getId() );
|
||||
|
||||
// response is empty body
|
||||
Pet p2 = bodyApi.testEchoBodyPet(null);
|
||||
Assert.assertNull(p2);
|
||||
final Pet p2 = bodyApi.testEchoBodyPet( null );
|
||||
Assert.assertNull( p2 );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,8 +71,8 @@ public class CustomTest {
|
||||
@Test
|
||||
public void testEchoBodyPetResponseString() throws ApiException {
|
||||
// response is empty body
|
||||
String p2 = bodyApi.testEchoBodyPetResponseString(null);
|
||||
Assert.assertNull(p2);
|
||||
final String p2 = bodyApi.testEchoBodyPetResponseString( null );
|
||||
Assert.assertNull( p2 );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,12 +84,14 @@ public class CustomTest {
|
||||
*/
|
||||
@Test
|
||||
public void testQueryStyleFormExplodeTrueObjectTest() throws ApiException {
|
||||
Pet queryObject = new Pet().id(12345L).name("Hello World").
|
||||
photoUrls(Arrays.asList(new String[]{"http://a.com", "http://b.com"})).category(new Category().id(987L).name("new category"));
|
||||
final Pet queryObject = new Pet().id( 12345L ).name( "Hello World" ).
|
||||
photoUrls( Arrays.asList( new String[] { "http://a.com", "http://b.com" } ) ).category( new Category().id( 987L ).name( "new category" ) );
|
||||
|
||||
String response = api.testQueryStyleFormExplodeTrueObject(queryObject);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/query/style_form/explode_true/object?id=12345&name=Hello%20World&category=class%20Category%20%7B%0A%20%20%20%20id%3A%20987%0A%20%20%20%20name%3A%20new%20category%0A%7D&photoUrls=http%3A%2F%2Fa.com&photoUrls=http%3A%2F%2Fb.com", p.path);
|
||||
final String response = api.testQueryStyleFormExplodeTrueObject( queryObject );
|
||||
final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response );
|
||||
Assert.assertEquals(
|
||||
"/query/style_form/explode_true/object?id=12345&name=Hello%20World&category=class%20Category%20%7B%0A%20%20%20%20id%3A%20987%0A%20%20%20%20name%3A%20new%20category%0A%7D&photoUrls=http%3A%2F%2Fa.com&photoUrls=http%3A%2F%2Fb.com",
|
||||
p.path );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,14 +103,18 @@ public class CustomTest {
|
||||
*/
|
||||
@Test
|
||||
public void testQueryStyleDeepObjectExplodeTrueObject() throws ApiException {
|
||||
Pet queryObject = new Pet().id(12345L).name("Hello World").
|
||||
photoUrls(Arrays.asList(new String[]{"http://a.com", "http://b.com"})).category(new Category().id(987L).name("new category"));
|
||||
final Pet queryObject = new Pet().id( 12345L ).name( "Hello World" ).
|
||||
photoUrls( Arrays.asList( new String[] { "http://a.com", "http://b.com" } ) ).category( new Category().id( 987L ).name( "new category" ) );
|
||||
|
||||
Assert.assertEquals("query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com", queryObject.toUrlQueryString("query_object"));
|
||||
Assert.assertEquals(
|
||||
"query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com",
|
||||
queryObject.toUrlQueryString( "query_object" ) );
|
||||
|
||||
String response = api.testQueryStyleDeepObjectExplodeTrueObject(queryObject);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/query/style_deepObject/explode_true/object?query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com", p.path);
|
||||
final String response = api.testQueryStyleDeepObjectExplodeTrueObject( queryObject );
|
||||
final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response );
|
||||
Assert.assertEquals(
|
||||
"/query/style_deepObject/explode_true/object?query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com",
|
||||
p.path );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,13 +126,13 @@ public class CustomTest {
|
||||
*/
|
||||
@Test
|
||||
public void testQueryStyleFormExplodeTrueObjectAllOfTest() throws ApiException {
|
||||
DataQuery queryObject = new DataQuery().text("Hello World");
|
||||
queryObject.setId(3487L);
|
||||
queryObject.setOutcomes(Arrays.asList(Query.OutcomesEnum.SKIPPED, Query.OutcomesEnum.FAILURE));
|
||||
final DataQuery queryObject = new DataQuery().text( "Hello World" );
|
||||
queryObject.setId( 3487L );
|
||||
queryObject.setOutcomes( Arrays.asList( Query.OutcomesEnum.SKIPPED, Query.OutcomesEnum.FAILURE ) );
|
||||
|
||||
String response = api.testQueryStyleFormExplodeTrueObjectAllOf(queryObject);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/query/style_form/explode_true/object/allOf?id=3487&outcomes=SKIPPED&outcomes=FAILURE&text=Hello%20World", p.path);
|
||||
final String response = api.testQueryStyleFormExplodeTrueObjectAllOf( queryObject );
|
||||
final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response );
|
||||
Assert.assertEquals( "/query/style_form/explode_true/object/allOf?id=3487&outcomes=SKIPPED&outcomes=FAILURE&text=Hello%20World", p.path );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,12 +144,12 @@ public class CustomTest {
|
||||
*/
|
||||
@Test
|
||||
public void testQueryStyleFormExplodeTrueArrayString() throws ApiException {
|
||||
TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter q = new TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter()
|
||||
.values(Arrays.asList(new String[]{"hello world 1", "hello world 2"}));
|
||||
final TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter q = new TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter()
|
||||
.values( Arrays.asList( new String[] { "hello world 1", "hello world 2" } ) );
|
||||
|
||||
String response = api.testQueryStyleFormExplodeTrueArrayString(q);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/query/style_form/explode_true/array_string?values=hello%20world%201&values=hello%20world%202", p.path);
|
||||
final String response = api.testQueryStyleFormExplodeTrueArrayString( q );
|
||||
final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response );
|
||||
Assert.assertEquals( "/query/style_form/explode_true/array_string?values=hello%20world%201&values=hello%20world%202", p.path );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,121 +161,124 @@ public class CustomTest {
|
||||
*/
|
||||
@Test
|
||||
public void testQueryIntegerBooleanString() throws ApiException {
|
||||
String response = api.testQueryIntegerBooleanString(1, true, "Hello World");
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/query/integer/boolean/string?integer_query=1&boolean_query=true&string_query=Hello%20World", p.path);
|
||||
final String response = api.testQueryIntegerBooleanString( 1, true, "Hello World" );
|
||||
final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response );
|
||||
Assert.assertEquals( "/query/integer/boolean/string?integer_query=1&boolean_query=true&string_query=Hello%20World", p.path );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testArrayDefaultValues() {
|
||||
// test array default values
|
||||
DefaultValue d = new DefaultValue();
|
||||
Assert.assertEquals(d.getArrayStringEnumRefDefault().size(), 2);
|
||||
Assert.assertEquals(d.getArrayStringEnumRefDefault().get(0), StringEnumRef.SUCCESS);
|
||||
Assert.assertEquals(d.getArrayStringEnumRefDefault().get(1), StringEnumRef.FAILURE);
|
||||
final DefaultValue d = new DefaultValue();
|
||||
Assert.assertEquals( d.getArrayStringEnumRefDefault().size(), 2 );
|
||||
Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 0 ), StringEnumRef.SUCCESS );
|
||||
Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 1 ), StringEnumRef.FAILURE );
|
||||
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().size(), 2);
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().get(0), DefaultValue.ArrayStringEnumDefaultEnum.SUCCESS);
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().get(1), DefaultValue.ArrayStringEnumDefaultEnum.FAILURE);
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().size(), 2 );
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().get( 0 ), DefaultValue.ArrayStringEnumDefaultEnum.SUCCESS );
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().get( 1 ), DefaultValue.ArrayStringEnumDefaultEnum.FAILURE );
|
||||
|
||||
Assert.assertEquals(d.getArrayStringDefault().size(), 2);
|
||||
Assert.assertEquals(d.getArrayStringDefault().get(0), "failure");
|
||||
Assert.assertEquals(d.getArrayStringDefault().get(1), "skipped");
|
||||
Assert.assertEquals( d.getArrayStringDefault().size(), 2 );
|
||||
Assert.assertEquals( d.getArrayStringDefault().get( 0 ), "failure" );
|
||||
Assert.assertEquals( d.getArrayStringDefault().get( 1 ), "skipped" );
|
||||
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().size(), 2);
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().get(0), Integer.valueOf(1));
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().get(1), Integer.valueOf(3));
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().size(), 2 );
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().get( 0 ), Integer.valueOf( 1 ) );
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().get( 1 ), Integer.valueOf( 3 ) );
|
||||
|
||||
Assert.assertNull(d.getArrayStringNullable());
|
||||
Assert.assertNull(d.getArrayString());
|
||||
Assert.assertNull( d.getArrayStringNullable() );
|
||||
Assert.assertEquals( d.getArrayString(), Collections.emptyList() );
|
||||
|
||||
// test addItem
|
||||
d.addArrayStringEnumDefaultItem(DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED);
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().size(), 3);
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().get(2), DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED);
|
||||
d.addArrayStringEnumDefaultItem( DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED );
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().size(), 3 );
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().get( 2 ), DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED );
|
||||
|
||||
d.addArrayStringDefaultItem("new item");
|
||||
Assert.assertEquals(d.getArrayStringDefault().size(), 3);
|
||||
Assert.assertEquals(d.getArrayStringDefault().get(2), "new item");
|
||||
d.addArrayStringDefaultItem( "new item" );
|
||||
Assert.assertEquals( d.getArrayStringDefault().size(), 3 );
|
||||
Assert.assertEquals( d.getArrayStringDefault().get( 2 ), "new item" );
|
||||
|
||||
d.addArrayIntegerDefaultItem(5);
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().size(), 3);
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().get(2), Integer.valueOf(5));
|
||||
d.addArrayIntegerDefaultItem( 5 );
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().size(), 3 );
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().get( 2 ), Integer.valueOf( 5 ) );
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefaultValuesSerializationWithEmptyPayload() throws IOException {
|
||||
ApiClient apiClient = new ApiClient();
|
||||
final ApiClient apiClient = new ApiClient();
|
||||
|
||||
String str = "{}";
|
||||
final String str = "{}";
|
||||
|
||||
DefaultValue d = apiClient.getObjectMapper().readValue(str, new TypeReference<DefaultValue>() {
|
||||
});
|
||||
final DefaultValue d = apiClient.getObjectMapper().readValue( str, new TypeReference<DefaultValue>() {
|
||||
} );
|
||||
|
||||
Assert.assertEquals(d.getArrayStringEnumRefDefault().size(), 2);
|
||||
Assert.assertEquals(d.getArrayStringEnumRefDefault().get(0), StringEnumRef.SUCCESS);
|
||||
Assert.assertEquals(d.getArrayStringEnumRefDefault().get(1), StringEnumRef.FAILURE);
|
||||
Assert.assertEquals( d.getArrayStringEnumRefDefault().size(), 2 );
|
||||
Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 0 ), StringEnumRef.SUCCESS );
|
||||
Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 1 ), StringEnumRef.FAILURE );
|
||||
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().size(), 2);
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().get(0), DefaultValue.ArrayStringEnumDefaultEnum.SUCCESS);
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().get(1), DefaultValue.ArrayStringEnumDefaultEnum.FAILURE);
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().size(), 2 );
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().get( 0 ), DefaultValue.ArrayStringEnumDefaultEnum.SUCCESS );
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().get( 1 ), DefaultValue.ArrayStringEnumDefaultEnum.FAILURE );
|
||||
|
||||
Assert.assertEquals(d.getArrayStringDefault().size(), 2);
|
||||
Assert.assertEquals(d.getArrayStringDefault().get(0), "failure");
|
||||
Assert.assertEquals(d.getArrayStringDefault().get(1), "skipped");
|
||||
Assert.assertEquals( d.getArrayStringDefault().size(), 2 );
|
||||
Assert.assertEquals( d.getArrayStringDefault().get( 0 ), "failure" );
|
||||
Assert.assertEquals( d.getArrayStringDefault().get( 1 ), "skipped" );
|
||||
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().size(), 2);
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().get(0), Integer.valueOf(1));
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().get(1), Integer.valueOf(3));
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().size(), 2 );
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().get( 0 ), Integer.valueOf( 1 ) );
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().get( 1 ), Integer.valueOf( 3 ) );
|
||||
|
||||
Assert.assertNull(d.getArrayStringNullable());
|
||||
Assert.assertNull(d.getArrayString());
|
||||
Assert.assertNull( d.getArrayStringNullable() );
|
||||
Assert.assertEquals( d.getArrayString(), Collections.emptyList() );
|
||||
|
||||
Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"success\",\"failure\"],\"array_string_enum_default\":[\"success\",\"failure\"],\"array_string_default\":[\"failure\",\"skipped\"],\"array_integer_default\":[1,3]}");
|
||||
Assert.assertEquals( apiClient.getObjectMapper().writeValueAsString( d ),
|
||||
"{\"array_string_enum_ref_default\":[\"success\",\"failure\"],\"array_string_enum_default\":[\"success\",\"failure\"],\"array_string_default\":[\"failure\",\"skipped\"],\"array_integer_default\":[1,3],\"array_string\":[]}" );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefaultValuesSerializationWithJSONString() throws IOException {
|
||||
ApiClient apiClient = new ApiClient();
|
||||
final ApiClient apiClient = new ApiClient();
|
||||
|
||||
String str = "{ \"array_string_enum_ref_default\": [\"unclassified\"], \"array_string_enum_default\": [\"unclassified\"], \"array_string_default\": [\"failure\"] }";
|
||||
final String str = "{ \"array_string_enum_ref_default\": [\"unclassified\"], \"array_string_enum_default\": [\"unclassified\"], \"array_string_default\": [\"failure\"] }";
|
||||
|
||||
DefaultValue d = apiClient.getObjectMapper().readValue(str, new TypeReference<DefaultValue>() {
|
||||
});
|
||||
final DefaultValue d = apiClient.getObjectMapper().readValue( str, new TypeReference<DefaultValue>() {
|
||||
} );
|
||||
|
||||
Assert.assertEquals(d.getArrayStringEnumRefDefault().size(), 1);
|
||||
Assert.assertEquals(d.getArrayStringEnumRefDefault().get(0), StringEnumRef.UNCLASSIFIED);
|
||||
Assert.assertEquals( d.getArrayStringEnumRefDefault().size(), 1 );
|
||||
Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 0 ), StringEnumRef.UNCLASSIFIED );
|
||||
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().size(), 1);
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().get(0), DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED);
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().size(), 1 );
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().get( 0 ), DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED );
|
||||
|
||||
Assert.assertEquals(d.getArrayStringDefault().size(), 1);
|
||||
Assert.assertEquals(d.getArrayStringDefault().get(0), "failure");
|
||||
Assert.assertEquals( d.getArrayStringDefault().size(), 1 );
|
||||
Assert.assertEquals( d.getArrayStringDefault().get( 0 ), "failure" );
|
||||
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().size(), 2);
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().get(0), Integer.valueOf(1));
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().get(1), Integer.valueOf(3));
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().size(), 2 );
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().get( 0 ), Integer.valueOf( 1 ) );
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().get( 1 ), Integer.valueOf( 3 ) );
|
||||
|
||||
Assert.assertNull(d.getArrayStringNullable());
|
||||
Assert.assertNull(d.getArrayString());
|
||||
Assert.assertNull( d.getArrayStringNullable() );
|
||||
Assert.assertEquals( d.getArrayString(), Collections.emptyList() );
|
||||
|
||||
Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"unclassified\"],\"array_string_enum_default\":[\"unclassified\"],\"array_string_default\":[\"failure\"],\"array_integer_default\":[1,3]}");
|
||||
Assert.assertEquals( apiClient.getObjectMapper().writeValueAsString( d ),
|
||||
"{\"array_string_enum_ref_default\":[\"unclassified\"],\"array_string_enum_default\":[\"unclassified\"],\"array_string_default\":[\"failure\"],\"array_integer_default\":[1,3],\"array_string\":[]}" );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefaultValuesSerializationWithIncorrectDefaultValues() throws IOException {
|
||||
ApiClient apiClient = new ApiClient();
|
||||
final ApiClient apiClient = new ApiClient();
|
||||
|
||||
String str = "{ \"array_string_enum_default\": [\"invalid\"] }";
|
||||
final String str = "{ \"array_string_enum_default\": [\"invalid\"] }";
|
||||
|
||||
try {
|
||||
DefaultValue d = apiClient.getObjectMapper().readValue(str, new TypeReference<DefaultValue>() {
|
||||
});
|
||||
Assert.assertTrue(false); // the test should not reach this line
|
||||
} catch (com.fasterxml.jackson.databind.exc.ValueInstantiationException e) {
|
||||
Assert.assertEquals(e.getMessage(), "Cannot construct instance of `org.openapitools.client.model.DefaultValue$ArrayStringEnumDefaultEnum`, problem: Unexpected value 'invalid'\n" +
|
||||
" at [Source: (String)\"{ \"array_string_enum_default\": [\"invalid\"] }\"; line: 1, column: 33] (through reference chain: org.openapitools.client.model.DefaultValue[\"array_string_enum_default\"]->java.util.ArrayList[0])");
|
||||
final DefaultValue d = apiClient.getObjectMapper().readValue( str, new TypeReference<DefaultValue>() {
|
||||
} );
|
||||
Assert.assertTrue( false ); // the test should not reach this line
|
||||
} catch ( final com.fasterxml.jackson.databind.exc.ValueInstantiationException e ) {
|
||||
Assert.assertEquals( e.getMessage(),
|
||||
"Cannot construct instance of `org.openapitools.client.model.DefaultValue$ArrayStringEnumDefaultEnum`, problem: Unexpected value 'invalid'\n" +
|
||||
" at [Source: (String)\"{ \"array_string_enum_default\": [\"invalid\"] }\"; line: 1, column: 33] (through reference chain: org.openapitools.client.model.DefaultValue[\"array_string_enum_default\"]->java.util.ArrayList[0])" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ public class DefaultValue {
|
||||
|
||||
public static final String SERIALIZED_NAME_ARRAY_STRING = "array_string";
|
||||
@SerializedName(SERIALIZED_NAME_ARRAY_STRING)
|
||||
private List<String> arrayString;
|
||||
private List<String> arrayString = new ArrayList<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_ARRAY_STRING_NULLABLE = "array_string_nullable";
|
||||
@SerializedName(SERIALIZED_NAME_ARRAY_STRING_NULLABLE)
|
||||
|
||||
@@ -50,7 +50,7 @@ public class Pet {
|
||||
|
||||
public static final String SERIALIZED_NAME_TAGS = "tags";
|
||||
@SerializedName(SERIALIZED_NAME_TAGS)
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -32,7 +32,7 @@ import java.util.List;
|
||||
public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
public static final String SERIALIZED_NAME_VALUES = "values";
|
||||
@SerializedName(SERIALIZED_NAME_VALUES)
|
||||
private List<String> values;
|
||||
private List<String> values = new ArrayList<>();
|
||||
|
||||
public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() {
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class DefaultValue {
|
||||
private List<Integer> arrayIntegerDefault = new ArrayList<>(Arrays.asList(1, 3));
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_STRING = "array_string";
|
||||
private List<String> arrayString;
|
||||
private List<String> arrayString = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_STRING_NULLABLE = "array_string_nullable";
|
||||
private JsonNullable<List<String>> arrayStringNullable = JsonNullable.<List<String>>undefined();
|
||||
|
||||
@@ -58,7 +58,7 @@ public class Pet {
|
||||
private List<String> photoUrls = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_TAGS = "tags";
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -39,7 +39,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
public static final String JSON_PROPERTY_VALUES = "values";
|
||||
private List<String> values;
|
||||
private List<String> values = new ArrayList<>();
|
||||
|
||||
public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() {
|
||||
}
|
||||
|
||||
@@ -13,20 +13,30 @@
|
||||
|
||||
package org.openapitools.client;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import org.junit.Assert;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.api.*;
|
||||
import org.openapitools.client.model.*;
|
||||
import org.junit.Test;
|
||||
import org.junit.Ignore;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.openapitools.client.api.BodyApi;
|
||||
import org.openapitools.client.api.FormApi;
|
||||
import org.openapitools.client.api.QueryApi;
|
||||
import org.openapitools.client.model.Category;
|
||||
import org.openapitools.client.model.DataQuery;
|
||||
import org.openapitools.client.model.DefaultValue;
|
||||
import org.openapitools.client.model.Pet;
|
||||
import org.openapitools.client.model.Query;
|
||||
import org.openapitools.client.model.StringEnumRef;
|
||||
import org.openapitools.client.model.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter;
|
||||
import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
/**
|
||||
* API tests for QueryApi
|
||||
@@ -37,7 +47,6 @@ public class CustomTest {
|
||||
private final BodyApi bodyApi = new BodyApi();
|
||||
private final FormApi formApi = new FormApi();
|
||||
|
||||
|
||||
/**
|
||||
* Test body parameter(s)
|
||||
* <p>
|
||||
@@ -47,17 +56,17 @@ public class CustomTest {
|
||||
*/
|
||||
@Test
|
||||
public void testEchoBodyPet() throws ApiException {
|
||||
Pet queryObject = new Pet().id(12345L).name("Hello World").
|
||||
photoUrls(Arrays.asList(new String[]{"http://a.com", "http://b.com"})).category(new Category().id(987L).name("new category"));
|
||||
final Pet queryObject = new Pet().id( 12345L ).name( "Hello World" ).
|
||||
photoUrls( Arrays.asList( new String[] { "http://a.com", "http://b.com" } ) ).category( new Category().id( 987L ).name( "new category" ) );
|
||||
|
||||
Pet p = bodyApi.testEchoBodyPet(queryObject);
|
||||
Assert.assertNotNull(p);
|
||||
Assert.assertEquals("Hello World", p.getName());
|
||||
Assert.assertEquals(Long.valueOf(12345L), p.getId());
|
||||
final Pet p = bodyApi.testEchoBodyPet( queryObject );
|
||||
Assert.assertNotNull( p );
|
||||
Assert.assertEquals( "Hello World", p.getName() );
|
||||
Assert.assertEquals( Long.valueOf( 12345L ), p.getId() );
|
||||
|
||||
// response is empty body
|
||||
Pet p2 = bodyApi.testEchoBodyPet(null);
|
||||
Assert.assertNull(p2);
|
||||
final Pet p2 = bodyApi.testEchoBodyPet( null );
|
||||
Assert.assertNull( p2 );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,17 +78,17 @@ public class CustomTest {
|
||||
*/
|
||||
@Test
|
||||
public void testEchoBodyAllOfPet() throws ApiException {
|
||||
Pet queryObject = new Pet().id(12345L).name("Hello World").
|
||||
photoUrls(Arrays.asList(new String[]{"http://a.com", "http://b.com"})).category(new Category().id(987L).name("new category"));
|
||||
final Pet queryObject = new Pet().id( 12345L ).name( "Hello World" ).
|
||||
photoUrls( Arrays.asList( new String[] { "http://a.com", "http://b.com" } ) ).category( new Category().id( 987L ).name( "new category" ) );
|
||||
|
||||
Pet p = bodyApi.testEchoBodyAllOfPet(queryObject);
|
||||
Assert.assertNotNull(p);
|
||||
Assert.assertEquals("Hello World", p.getName());
|
||||
Assert.assertEquals(Long.valueOf(12345L), p.getId());
|
||||
final Pet p = bodyApi.testEchoBodyAllOfPet( queryObject );
|
||||
Assert.assertNotNull( p );
|
||||
Assert.assertEquals( "Hello World", p.getName() );
|
||||
Assert.assertEquals( Long.valueOf( 12345L ), p.getId() );
|
||||
|
||||
// response is empty body
|
||||
Pet p2 = bodyApi.testEchoBodyPet(null);
|
||||
Assert.assertNull(p2);
|
||||
final Pet p2 = bodyApi.testEchoBodyPet( null );
|
||||
Assert.assertNull( p2 );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,12 +100,14 @@ public class CustomTest {
|
||||
*/
|
||||
@Test
|
||||
public void testQueryStyleFormExplodeTrueObjectTest() throws ApiException {
|
||||
Pet queryObject = new Pet().id(12345L).name("Hello World").
|
||||
photoUrls(Arrays.asList(new String[]{"http://a.com", "http://b.com"})).category(new Category().id(987L).name("new category"));
|
||||
final Pet queryObject = new Pet().id( 12345L ).name( "Hello World" ).
|
||||
photoUrls( Arrays.asList( new String[] { "http://a.com", "http://b.com" } ) ).category( new Category().id( 987L ).name( "new category" ) );
|
||||
|
||||
String response = api.testQueryStyleFormExplodeTrueObject(queryObject);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/query/style_form/explode_true/object?id=12345&name=Hello%20World&category=class%20Category%20%7B%0A%20%20%20%20id%3A%20987%0A%20%20%20%20name%3A%20new%20category%0A%7D&photoUrls=http%3A%2F%2Fa.com&photoUrls=http%3A%2F%2Fb.com", p.path);
|
||||
final String response = api.testQueryStyleFormExplodeTrueObject( queryObject );
|
||||
final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response );
|
||||
Assert.assertEquals(
|
||||
"/query/style_form/explode_true/object?id=12345&name=Hello%20World&category=class%20Category%20%7B%0A%20%20%20%20id%3A%20987%0A%20%20%20%20name%3A%20new%20category%0A%7D&photoUrls=http%3A%2F%2Fa.com&photoUrls=http%3A%2F%2Fb.com",
|
||||
p.path );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -108,13 +119,13 @@ public class CustomTest {
|
||||
*/
|
||||
@Test
|
||||
public void testQueryStyleFormExplodeTrueObjectAllOfTest() throws ApiException {
|
||||
DataQuery queryObject = new DataQuery().text("Hello World");
|
||||
queryObject.setId(3487L);
|
||||
queryObject.setOutcomes(Arrays.asList(Query.OutcomesEnum.SKIPPED, Query.OutcomesEnum.FAILURE));
|
||||
final DataQuery queryObject = new DataQuery().text( "Hello World" );
|
||||
queryObject.setId( 3487L );
|
||||
queryObject.setOutcomes( Arrays.asList( Query.OutcomesEnum.SKIPPED, Query.OutcomesEnum.FAILURE ) );
|
||||
|
||||
String response = api.testQueryStyleFormExplodeTrueObjectAllOf(queryObject);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/query/style_form/explode_true/object/allOf?id=3487&outcomes=SKIPPED&outcomes=FAILURE&text=Hello%20World", p.path);
|
||||
final String response = api.testQueryStyleFormExplodeTrueObjectAllOf( queryObject );
|
||||
final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response );
|
||||
Assert.assertEquals( "/query/style_form/explode_true/object/allOf?id=3487&outcomes=SKIPPED&outcomes=FAILURE&text=Hello%20World", p.path );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -126,14 +137,18 @@ public class CustomTest {
|
||||
*/
|
||||
@Test
|
||||
public void testQueryStyleDeepObjectExplodeTrueObject() throws ApiException {
|
||||
Pet queryObject = new Pet().id(12345L).name("Hello World").
|
||||
photoUrls(Arrays.asList(new String[]{"http://a.com", "http://b.com"})).category(new Category().id(987L).name("new category"));
|
||||
final Pet queryObject = new Pet().id( 12345L ).name( "Hello World" ).
|
||||
photoUrls( Arrays.asList( new String[] { "http://a.com", "http://b.com" } ) ).category( new Category().id( 987L ).name( "new category" ) );
|
||||
|
||||
Assert.assertEquals("query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com", queryObject.toUrlQueryString("query_object"));
|
||||
Assert.assertEquals(
|
||||
"query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com",
|
||||
queryObject.toUrlQueryString( "query_object" ) );
|
||||
|
||||
String response = api.testQueryStyleDeepObjectExplodeTrueObject(queryObject);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/query/style_deepObject/explode_true/object?query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com", p.path);
|
||||
final String response = api.testQueryStyleDeepObjectExplodeTrueObject( queryObject );
|
||||
final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response );
|
||||
Assert.assertEquals(
|
||||
"/query/style_deepObject/explode_true/object?query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com",
|
||||
p.path );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -145,14 +160,18 @@ public class CustomTest {
|
||||
*/
|
||||
@Test
|
||||
public void testQueryStyleDeepObjectExplodeTrueObjectAllOf() throws ApiException {
|
||||
TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject = new TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter().id(12345L).name("Hello World").
|
||||
color("red").size("small");
|
||||
final TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject = new TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter().id(
|
||||
12345L ).name( "Hello World" ).
|
||||
color( "red" ).size( "small" );
|
||||
|
||||
Assert.assertEquals("query_object[size]=small&query_object[color]=red&query_object[id]=12345&query_object[name]=Hello%20World", queryObject.toUrlQueryString("query_object"));
|
||||
Assert.assertEquals( "query_object[size]=small&query_object[color]=red&query_object[id]=12345&query_object[name]=Hello%20World",
|
||||
queryObject.toUrlQueryString( "query_object" ) );
|
||||
|
||||
String response = api.testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/query/style_deepObject/explode_true/object/allOf?query_object[size]=small&query_object[color]=red&query_object[id]=12345&query_object[name]=Hello%20World", p.path);
|
||||
final String response = api.testQueryStyleDeepObjectExplodeTrueObjectAllOf( queryObject );
|
||||
final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response );
|
||||
Assert.assertEquals(
|
||||
"/query/style_deepObject/explode_true/object/allOf?query_object[size]=small&query_object[color]=red&query_object[id]=12345&query_object[name]=Hello%20World",
|
||||
p.path );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -164,126 +183,129 @@ public class CustomTest {
|
||||
*/
|
||||
@Test
|
||||
public void testQueryStyleFormExplodeTrueArrayString() throws ApiException {
|
||||
TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter q = new TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter()
|
||||
.values(Arrays.asList(new String[]{"hello world 1", "hello world 2"}));
|
||||
final TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter q = new TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter()
|
||||
.values( Arrays.asList( new String[] { "hello world 1", "hello world 2" } ) );
|
||||
|
||||
String response = api.testQueryStyleFormExplodeTrueArrayString(q);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/query/style_form/explode_true/array_string?values=hello%20world%201&values=hello%20world%202", p.path);
|
||||
final String response = api.testQueryStyleFormExplodeTrueArrayString( q );
|
||||
final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response );
|
||||
Assert.assertEquals( "/query/style_form/explode_true/array_string?values=hello%20world%201&values=hello%20world%202", p.path );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testArrayDefaultValues() {
|
||||
// test array default values
|
||||
DefaultValue d = new DefaultValue();
|
||||
Assert.assertEquals(d.getArrayStringEnumRefDefault().size(), 2);
|
||||
Assert.assertEquals(d.getArrayStringEnumRefDefault().get(0), StringEnumRef.SUCCESS);
|
||||
Assert.assertEquals(d.getArrayStringEnumRefDefault().get(1), StringEnumRef.FAILURE);
|
||||
final DefaultValue d = new DefaultValue();
|
||||
Assert.assertEquals( d.getArrayStringEnumRefDefault().size(), 2 );
|
||||
Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 0 ), StringEnumRef.SUCCESS );
|
||||
Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 1 ), StringEnumRef.FAILURE );
|
||||
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().size(), 2);
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().get(0), DefaultValue.ArrayStringEnumDefaultEnum.SUCCESS);
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().get(1), DefaultValue.ArrayStringEnumDefaultEnum.FAILURE);
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().size(), 2 );
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().get( 0 ), DefaultValue.ArrayStringEnumDefaultEnum.SUCCESS );
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().get( 1 ), DefaultValue.ArrayStringEnumDefaultEnum.FAILURE );
|
||||
|
||||
Assert.assertEquals(d.getArrayStringDefault().size(), 2);
|
||||
Assert.assertEquals(d.getArrayStringDefault().get(0), "failure");
|
||||
Assert.assertEquals(d.getArrayStringDefault().get(1), "skipped");
|
||||
Assert.assertEquals( d.getArrayStringDefault().size(), 2 );
|
||||
Assert.assertEquals( d.getArrayStringDefault().get( 0 ), "failure" );
|
||||
Assert.assertEquals( d.getArrayStringDefault().get( 1 ), "skipped" );
|
||||
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().size(), 2);
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().get(0), Integer.valueOf(1));
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().get(1), Integer.valueOf(3));
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().size(), 2 );
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().get( 0 ), Integer.valueOf( 1 ) );
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().get( 1 ), Integer.valueOf( 3 ) );
|
||||
|
||||
Assert.assertNull(d.getArrayStringNullable());
|
||||
Assert.assertNull(d.getArrayStringExtensionNullable());
|
||||
Assert.assertNull(d.getArrayString());
|
||||
Assert.assertNull( d.getArrayStringNullable() );
|
||||
Assert.assertNull( d.getArrayStringExtensionNullable() );
|
||||
Assert.assertEquals( d.getArrayString(), List.of() );
|
||||
|
||||
// test addItem
|
||||
d.addArrayStringEnumDefaultItem(DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED);
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().size(), 3);
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().get(2), DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED);
|
||||
d.addArrayStringEnumDefaultItem( DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED );
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().size(), 3 );
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().get( 2 ), DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED );
|
||||
|
||||
d.addArrayStringDefaultItem("new item");
|
||||
Assert.assertEquals(d.getArrayStringDefault().size(), 3);
|
||||
Assert.assertEquals(d.getArrayStringDefault().get(2), "new item");
|
||||
d.addArrayStringDefaultItem( "new item" );
|
||||
Assert.assertEquals( d.getArrayStringDefault().size(), 3 );
|
||||
Assert.assertEquals( d.getArrayStringDefault().get( 2 ), "new item" );
|
||||
|
||||
d.addArrayIntegerDefaultItem(5);
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().size(), 3);
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().get(2), Integer.valueOf(5));
|
||||
d.addArrayIntegerDefaultItem( 5 );
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().size(), 3 );
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().get( 2 ), Integer.valueOf( 5 ) );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefaultValuesSerializationWithEmptyPayload() throws IOException {
|
||||
ApiClient apiClient = new ApiClient();
|
||||
final ApiClient apiClient = new ApiClient();
|
||||
|
||||
String str = "{}";
|
||||
final String str = "{}";
|
||||
|
||||
DefaultValue d = apiClient.getObjectMapper().readValue(str, new TypeReference<DefaultValue>() {
|
||||
});
|
||||
final DefaultValue d = apiClient.getObjectMapper().readValue( str, new TypeReference<>() {
|
||||
} );
|
||||
|
||||
Assert.assertEquals(d.getArrayStringEnumRefDefault().size(), 2);
|
||||
Assert.assertEquals(d.getArrayStringEnumRefDefault().get(0), StringEnumRef.SUCCESS);
|
||||
Assert.assertEquals(d.getArrayStringEnumRefDefault().get(1), StringEnumRef.FAILURE);
|
||||
Assert.assertEquals( d.getArrayStringEnumRefDefault().size(), 2 );
|
||||
Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 0 ), StringEnumRef.SUCCESS );
|
||||
Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 1 ), StringEnumRef.FAILURE );
|
||||
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().size(), 2);
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().get(0), DefaultValue.ArrayStringEnumDefaultEnum.SUCCESS);
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().get(1), DefaultValue.ArrayStringEnumDefaultEnum.FAILURE);
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().size(), 2 );
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().get( 0 ), DefaultValue.ArrayStringEnumDefaultEnum.SUCCESS );
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().get( 1 ), DefaultValue.ArrayStringEnumDefaultEnum.FAILURE );
|
||||
|
||||
Assert.assertEquals(d.getArrayStringDefault().size(), 2);
|
||||
Assert.assertEquals(d.getArrayStringDefault().get(0), "failure");
|
||||
Assert.assertEquals(d.getArrayStringDefault().get(1), "skipped");
|
||||
Assert.assertEquals( d.getArrayStringDefault().size(), 2 );
|
||||
Assert.assertEquals( d.getArrayStringDefault().get( 0 ), "failure" );
|
||||
Assert.assertEquals( d.getArrayStringDefault().get( 1 ), "skipped" );
|
||||
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().size(), 2);
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().get(0), Integer.valueOf(1));
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().get(1), Integer.valueOf(3));
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().size(), 2 );
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().get( 0 ), Integer.valueOf( 1 ) );
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().get( 1 ), Integer.valueOf( 3 ) );
|
||||
|
||||
Assert.assertNull(d.getArrayStringNullable());
|
||||
Assert.assertNull(d.getArrayStringExtensionNullable());
|
||||
Assert.assertNull(d.getArrayString());
|
||||
Assert.assertNull( d.getArrayStringNullable() );
|
||||
Assert.assertNull( d.getArrayStringExtensionNullable() );
|
||||
Assert.assertEquals( d.getArrayString(), List.of() );
|
||||
|
||||
Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"success\",\"failure\"],\"array_string_enum_default\":[\"success\",\"failure\"],\"array_string_default\":[\"failure\",\"skipped\"],\"array_integer_default\":[1,3]}");
|
||||
Assert.assertEquals( apiClient.getObjectMapper().writeValueAsString( d ),
|
||||
"{\"array_string_enum_ref_default\":[\"success\",\"failure\"],\"array_string_enum_default\":[\"success\",\"failure\"],\"array_string_default\":[\"failure\",\"skipped\"],\"array_integer_default\":[1,3],\"array_string\":[]}" );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefaultValuesSerializationWithJSONString() throws IOException {
|
||||
ApiClient apiClient = new ApiClient();
|
||||
final ApiClient apiClient = new ApiClient();
|
||||
|
||||
String str = "{ \"array_string_enum_ref_default\": [\"unclassified\"], \"array_string_enum_default\": [\"unclassified\"], \"array_string_default\": [\"failure\"] }";
|
||||
final String str = "{ \"array_string_enum_ref_default\": [\"unclassified\"], \"array_string_enum_default\": [\"unclassified\"], \"array_string_default\": [\"failure\"] }";
|
||||
|
||||
DefaultValue d = apiClient.getObjectMapper().readValue(str, new TypeReference<DefaultValue>() {
|
||||
});
|
||||
final DefaultValue d = apiClient.getObjectMapper().readValue( str, new TypeReference<>() {
|
||||
} );
|
||||
|
||||
Assert.assertEquals(d.getArrayStringEnumRefDefault().size(), 1);
|
||||
Assert.assertEquals(d.getArrayStringEnumRefDefault().get(0), StringEnumRef.UNCLASSIFIED);
|
||||
Assert.assertEquals( d.getArrayStringEnumRefDefault().size(), 1 );
|
||||
Assert.assertEquals( d.getArrayStringEnumRefDefault().get( 0 ), StringEnumRef.UNCLASSIFIED );
|
||||
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().size(), 1);
|
||||
Assert.assertEquals(d.getArrayStringEnumDefault().get(0), DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED);
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().size(), 1 );
|
||||
Assert.assertEquals( d.getArrayStringEnumDefault().get( 0 ), DefaultValue.ArrayStringEnumDefaultEnum.UNCLASSIFIED );
|
||||
|
||||
Assert.assertEquals(d.getArrayStringDefault().size(), 1);
|
||||
Assert.assertEquals(d.getArrayStringDefault().get(0), "failure");
|
||||
Assert.assertEquals( d.getArrayStringDefault().size(), 1 );
|
||||
Assert.assertEquals( d.getArrayStringDefault().get( 0 ), "failure" );
|
||||
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().size(), 2);
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().get(0), Integer.valueOf(1));
|
||||
Assert.assertEquals(d.getArrayIntegerDefault().get(1), Integer.valueOf(3));
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().size(), 2 );
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().get( 0 ), Integer.valueOf( 1 ) );
|
||||
Assert.assertEquals( d.getArrayIntegerDefault().get( 1 ), Integer.valueOf( 3 ) );
|
||||
|
||||
Assert.assertNull(d.getArrayStringNullable());
|
||||
Assert.assertNull(d.getArrayStringExtensionNullable());
|
||||
Assert.assertNull(d.getArrayString());
|
||||
Assert.assertNull( d.getArrayStringNullable() );
|
||||
Assert.assertNull( d.getArrayStringExtensionNullable() );
|
||||
Assert.assertEquals( d.getArrayString(), List.of() );
|
||||
|
||||
Assert.assertEquals(apiClient.getObjectMapper().writeValueAsString(d), "{\"array_string_enum_ref_default\":[\"unclassified\"],\"array_string_enum_default\":[\"unclassified\"],\"array_string_default\":[\"failure\"],\"array_integer_default\":[1,3]}");
|
||||
Assert.assertEquals( apiClient.getObjectMapper().writeValueAsString( d ),
|
||||
"{\"array_string_enum_ref_default\":[\"unclassified\"],\"array_string_enum_default\":[\"unclassified\"],\"array_string_default\":[\"failure\"],\"array_integer_default\":[1,3],\"array_string\":[]}" );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefaultValuesSerializationWithIncorrectDefaultValues() throws IOException {
|
||||
ApiClient apiClient = new ApiClient();
|
||||
final ApiClient apiClient = new ApiClient();
|
||||
|
||||
String str = "{ \"array_string_enum_default\": [\"invalid\"] }";
|
||||
final String str = "{ \"array_string_enum_default\": [\"invalid\"] }";
|
||||
|
||||
try {
|
||||
DefaultValue d = apiClient.getObjectMapper().readValue(str, new TypeReference<DefaultValue>() {
|
||||
});
|
||||
Assert.assertTrue(false); // the test should not reach this line
|
||||
} catch (com.fasterxml.jackson.databind.exc.ValueInstantiationException e) {
|
||||
Assert.assertEquals(e.getMessage(), "Cannot construct instance of `org.openapitools.client.model.DefaultValue$ArrayStringEnumDefaultEnum`, problem: Unexpected value 'invalid'\n" +
|
||||
" at [Source: (String)\"{ \"array_string_enum_default\": [\"invalid\"] }\"; line: 1, column: 33] (through reference chain: org.openapitools.client.model.DefaultValue[\"array_string_enum_default\"]->java.util.ArrayList[0])");
|
||||
final DefaultValue d = apiClient.getObjectMapper().readValue( str, new TypeReference<>() {
|
||||
} );
|
||||
Assert.assertTrue( false ); // the test should not reach this line
|
||||
} catch ( final com.fasterxml.jackson.databind.exc.ValueInstantiationException e ) {
|
||||
Assert.assertEquals( e.getMessage(),
|
||||
"Cannot construct instance of `org.openapitools.client.model.DefaultValue$ArrayStringEnumDefaultEnum`, problem: Unexpected value 'invalid'\n" +
|
||||
" at [Source: (String)\"{ \"array_string_enum_default\": [\"invalid\"] }\"; line: 1, column: 33] (through reference chain: org.openapitools.client.model.DefaultValue[\"array_string_enum_default\"]->java.util.ArrayList[0])" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -297,52 +319,52 @@ public class CustomTest {
|
||||
*/
|
||||
@Test
|
||||
public void testFormIntegerBooleanStringTest() throws ApiException {
|
||||
Integer integerForm = 1337;
|
||||
Boolean booleanForm = true;
|
||||
String stringForm = "Hello World";
|
||||
String response = formApi.testFormIntegerBooleanString(integerForm, booleanForm, stringForm);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/form/integer/boolean/string", p.path);
|
||||
Assert.assertEquals("3b\ninteger_form=1337&boolean_form=true&string_form=Hello+World\n0\n\n", p.body);
|
||||
final Integer integerForm = 1337;
|
||||
final Boolean booleanForm = true;
|
||||
final String stringForm = "Hello World";
|
||||
final String response = formApi.testFormIntegerBooleanString( integerForm, booleanForm, stringForm );
|
||||
final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response );
|
||||
Assert.assertEquals( "/form/integer/boolean/string", p.path );
|
||||
Assert.assertEquals( "3b\ninteger_form=1337&boolean_form=true&string_form=Hello+World\n0\n\n", p.body );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFormOneOf() throws ApiException {
|
||||
String form1 = "form1_example"; // String |
|
||||
Integer form2 = 56; // Integer |
|
||||
String form3 = "form3 example"; // String |
|
||||
Boolean form4 = true;
|
||||
String response = formApi.testFormOneof(form1, form2, form3, form4, null, null);
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
Assert.assertEquals("/form/oneof", p.path);
|
||||
Assert.assertEquals("3c\nform1=form1_example&form2=56&form3=form3++example&form4=true\n0\n\n", p.body);
|
||||
final String form1 = "form1_example"; // String |
|
||||
final Integer form2 = 56; // Integer |
|
||||
final String form3 = "form3 example"; // String |
|
||||
final Boolean form4 = true;
|
||||
final String response = formApi.testFormOneof( form1, form2, form3, form4, null, null );
|
||||
final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response );
|
||||
Assert.assertEquals( "/form/oneof", p.path );
|
||||
Assert.assertEquals( "3c\nform1=form1_example&form2=56&form3=form3++example&form4=true\n0\n\n", p.body );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBodyMultipartFormdataArrayOfBinary() throws ApiException {
|
||||
File file1 = Objects.requireNonNull(getFile("Hello"));
|
||||
File file2 = Objects.requireNonNull(getFile("World"));
|
||||
final File file1 = Objects.requireNonNull( getFile( "Hello" ) );
|
||||
final File file2 = Objects.requireNonNull( getFile( "World" ) );
|
||||
|
||||
String response = bodyApi.testBodyMultipartFormdataArrayOfBinary(List.of(file1, file2));
|
||||
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
|
||||
final String response = bodyApi.testBodyMultipartFormdataArrayOfBinary( List.of( file1, file2 ) );
|
||||
final org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser( response );
|
||||
|
||||
Assert.assertEquals("/body/application/octetstream/array_of_binary", p.path);
|
||||
Assert.assertEquals( "/body/application/octetstream/array_of_binary", p.path );
|
||||
|
||||
Assert.assertTrue(p.body.contains(file1.getName()));
|
||||
Assert.assertTrue(p.body.contains("Hello"));
|
||||
Assert.assertTrue(p.body.contains(file2.getName()));
|
||||
Assert.assertTrue(p.body.contains("World"));
|
||||
Assert.assertTrue( p.body.contains( file1.getName() ) );
|
||||
Assert.assertTrue( p.body.contains( "Hello" ) );
|
||||
Assert.assertTrue( p.body.contains( file2.getName() ) );
|
||||
Assert.assertTrue( p.body.contains( "World" ) );
|
||||
}
|
||||
|
||||
private File getFile(String content) {
|
||||
private File getFile( final String content ) {
|
||||
try {
|
||||
File tempFile = Files.createTempFile("tempFile", ".txt").toFile();
|
||||
BufferedWriter writer = new BufferedWriter(new FileWriter(tempFile));
|
||||
writer.write(content);
|
||||
final File tempFile = Files.createTempFile( "tempFile", ".txt" ).toFile();
|
||||
final BufferedWriter writer = new BufferedWriter( new FileWriter( tempFile ) );
|
||||
writer.write( content );
|
||||
writer.close();
|
||||
|
||||
return tempFile;
|
||||
} catch (IOException e) {
|
||||
} catch ( final IOException e ) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ public class DefaultValue {
|
||||
|
||||
public static final String SERIALIZED_NAME_ARRAY_STRING = "array_string";
|
||||
@SerializedName(SERIALIZED_NAME_ARRAY_STRING)
|
||||
private List<String> arrayString;
|
||||
private List<String> arrayString = new ArrayList<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_ARRAY_STRING_NULLABLE = "array_string_nullable";
|
||||
@SerializedName(SERIALIZED_NAME_ARRAY_STRING_NULLABLE)
|
||||
|
||||
@@ -73,7 +73,7 @@ public class Pet {
|
||||
|
||||
public static final String SERIALIZED_NAME_TAGS = "tags";
|
||||
@SerializedName(SERIALIZED_NAME_TAGS)
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -55,7 +55,7 @@ import org.openapitools.client.JSON;
|
||||
public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
public static final String SERIALIZED_NAME_VALUES = "values";
|
||||
@SerializedName(SERIALIZED_NAME_VALUES)
|
||||
private List<String> values;
|
||||
private List<String> values = new ArrayList<>();
|
||||
|
||||
public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() {
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public class DefaultValue {
|
||||
private List<Integer> arrayIntegerDefault = new ArrayList<>(Arrays.asList(1, 3));
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_STRING = "array_string";
|
||||
private List<String> arrayString;
|
||||
private List<String> arrayString = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_STRING_NULLABLE = "array_string_nullable";
|
||||
private JsonNullable<List<String>> arrayStringNullable = JsonNullable.<List<String>>undefined();
|
||||
|
||||
@@ -54,7 +54,7 @@ public class Pet {
|
||||
private List<String> photoUrls = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_TAGS = "tags";
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -36,7 +36,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {
|
||||
public static final String JSON_PROPERTY_VALUES = "values";
|
||||
private List<String> values;
|
||||
private List<String> values = new ArrayList<>();
|
||||
|
||||
public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() {
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ class Pet {
|
||||
|
||||
List<String> photoUrls = new ArrayList<>()
|
||||
|
||||
List<Tag> tags
|
||||
List<Tag> tags = new ArrayList<>()
|
||||
|
||||
enum StatusEnum {
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ import java.util.StringJoiner;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber";
|
||||
private List<List<BigDecimal>> arrayArrayNumber;
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ import java.util.StringJoiner;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber";
|
||||
private List<BigDecimal> arrayNumber;
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -41,13 +41,13 @@ import java.util.StringJoiner;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayTest {
|
||||
public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string";
|
||||
private List<String> arrayOfString;
|
||||
private List<String> arrayOfString = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
|
||||
private List<List<Long>> arrayArrayOfInteger;
|
||||
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel;
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
|
||||
|
||||
public ArrayTest() {
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public class EnumArrays {
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum";
|
||||
private List<ArrayEnumEnum> arrayEnum;
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
|
||||
|
||||
public EnumArrays() {
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class FileSchemaTestClass {
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<ModelFile> files;
|
||||
private List<ModelFile> files = new ArrayList<>();
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class NullableClass extends HashMap<String, Object> {
|
||||
private JsonNullable<List<Object>> arrayAndItemsNullableProp = JsonNullable.<List<Object>>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable";
|
||||
private List<Object> arrayItemsNullable;
|
||||
private List<Object> arrayItemsNullable = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop";
|
||||
private JsonNullable<Map<String, Object>> objectNullableProp = JsonNullable.<Map<String, Object>>undefined();
|
||||
|
||||
@@ -52,7 +52,7 @@ public class ObjectWithDeprecatedFields {
|
||||
private DeprecatedObject deprecatedRef;
|
||||
|
||||
public static final String JSON_PROPERTY_BARS = "bars";
|
||||
private List<String> bars;
|
||||
private List<String> bars = new ArrayList<>();
|
||||
|
||||
public ObjectWithDeprecatedFields() {
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class Pet {
|
||||
private Set<String> photoUrls = new LinkedHashSet<>();
|
||||
|
||||
public static final String JSON_PROPERTY_TAGS = "tags";
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -37,7 +37,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber";
|
||||
private List<List<BigDecimal>> arrayArrayNumber;
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber";
|
||||
private List<BigDecimal> arrayNumber;
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -39,13 +39,13 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayTest {
|
||||
public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string";
|
||||
private List<String> arrayOfString;
|
||||
private List<String> arrayOfString = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
|
||||
private List<List<Long>> arrayArrayOfInteger;
|
||||
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel;
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
|
||||
|
||||
public ArrayTest() {
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ public class EnumArrays {
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum";
|
||||
private List<ArrayEnumEnum> arrayEnum;
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
|
||||
|
||||
public EnumArrays() {
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class FileSchemaTestClass {
|
||||
private File file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<File> files;
|
||||
private List<File> files = new ArrayList<>();
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class Pet {
|
||||
private Set<String> photoUrls = new LinkedHashSet<>();
|
||||
|
||||
public static final String JSON_PROPERTY_TAGS = "tags";
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -77,7 +77,7 @@ public class XmlItem {
|
||||
private Boolean attributeBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array";
|
||||
private List<Integer> wrappedArray;
|
||||
private List<Integer> wrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_NAME_STRING = "name_string";
|
||||
private String nameString;
|
||||
@@ -92,10 +92,10 @@ public class XmlItem {
|
||||
private Boolean nameBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_NAME_ARRAY = "name_array";
|
||||
private List<Integer> nameArray;
|
||||
private List<Integer> nameArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array";
|
||||
private List<Integer> nameWrappedArray;
|
||||
private List<Integer> nameWrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string";
|
||||
private String prefixString;
|
||||
@@ -110,10 +110,10 @@ public class XmlItem {
|
||||
private Boolean prefixBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array";
|
||||
private List<Integer> prefixArray;
|
||||
private List<Integer> prefixArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array";
|
||||
private List<Integer> prefixWrappedArray;
|
||||
private List<Integer> prefixWrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string";
|
||||
private String namespaceString;
|
||||
@@ -128,10 +128,10 @@ public class XmlItem {
|
||||
private Boolean namespaceBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array";
|
||||
private List<Integer> namespaceArray;
|
||||
private List<Integer> namespaceArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array";
|
||||
private List<Integer> namespaceWrappedArray;
|
||||
private List<Integer> namespaceWrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string";
|
||||
private String prefixNsString;
|
||||
@@ -146,10 +146,10 @@ public class XmlItem {
|
||||
private Boolean prefixNsBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array";
|
||||
private List<Integer> prefixNsArray;
|
||||
private List<Integer> prefixNsArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array";
|
||||
private List<Integer> prefixNsWrappedArray;
|
||||
private List<Integer> prefixNsWrappedArray = new ArrayList<>();
|
||||
|
||||
public XmlItem() {
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber";
|
||||
private List<List<BigDecimal>> arrayArrayNumber;
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber";
|
||||
private List<BigDecimal> arrayNumber;
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -38,13 +38,13 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayTest {
|
||||
public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string";
|
||||
private List<String> arrayOfString;
|
||||
private List<String> arrayOfString = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
|
||||
private List<List<Long>> arrayArrayOfInteger;
|
||||
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel;
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
|
||||
|
||||
public ArrayTest() {
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ public class EnumArrays {
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum";
|
||||
private List<ArrayEnumEnum> arrayEnum;
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
|
||||
|
||||
public EnumArrays() {
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class FileSchemaTestClass {
|
||||
private File file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<File> files;
|
||||
private List<File> files = new ArrayList<>();
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class NullableClass extends HashMap<String, Object> {
|
||||
private JsonNullable<List<Object>> arrayAndItemsNullableProp = JsonNullable.<List<Object>>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable";
|
||||
private List<Object> arrayItemsNullable;
|
||||
private List<Object> arrayItemsNullable = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop";
|
||||
private JsonNullable<Map<String, Object>> objectNullableProp = JsonNullable.<Map<String, Object>>undefined();
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ObjectWithDeprecatedFields {
|
||||
private DeprecatedObject deprecatedRef;
|
||||
|
||||
public static final String JSON_PROPERTY_BARS = "bars";
|
||||
private List<String> bars;
|
||||
private List<String> bars = new ArrayList<>();
|
||||
|
||||
public ObjectWithDeprecatedFields() {
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class Pet {
|
||||
private Set<String> photoUrls = new LinkedHashSet<>();
|
||||
|
||||
public static final String JSON_PROPERTY_TAGS = "tags";
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -36,7 +36,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber";
|
||||
private List<List<BigDecimal>> arrayArrayNumber;
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber";
|
||||
private List<BigDecimal> arrayNumber;
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -38,13 +38,13 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayTest {
|
||||
public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string";
|
||||
private List<String> arrayOfString;
|
||||
private List<String> arrayOfString = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
|
||||
private List<List<Long>> arrayArrayOfInteger;
|
||||
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel;
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
|
||||
|
||||
public ArrayTest() {
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ public class EnumArrays {
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum";
|
||||
private List<ArrayEnumEnum> arrayEnum;
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
|
||||
|
||||
public EnumArrays() {
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class FileSchemaTestClass {
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<ModelFile> files;
|
||||
private List<ModelFile> files = new ArrayList<>();
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class Pet {
|
||||
private Set<String> photoUrls = new LinkedHashSet<>();
|
||||
|
||||
public static final String JSON_PROPERTY_TAGS = "tags";
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -76,7 +76,7 @@ public class XmlItem {
|
||||
private Boolean attributeBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array";
|
||||
private List<Integer> wrappedArray;
|
||||
private List<Integer> wrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_NAME_STRING = "name_string";
|
||||
private String nameString;
|
||||
@@ -91,10 +91,10 @@ public class XmlItem {
|
||||
private Boolean nameBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_NAME_ARRAY = "name_array";
|
||||
private List<Integer> nameArray;
|
||||
private List<Integer> nameArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array";
|
||||
private List<Integer> nameWrappedArray;
|
||||
private List<Integer> nameWrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string";
|
||||
private String prefixString;
|
||||
@@ -109,10 +109,10 @@ public class XmlItem {
|
||||
private Boolean prefixBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array";
|
||||
private List<Integer> prefixArray;
|
||||
private List<Integer> prefixArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array";
|
||||
private List<Integer> prefixWrappedArray;
|
||||
private List<Integer> prefixWrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string";
|
||||
private String namespaceString;
|
||||
@@ -127,10 +127,10 @@ public class XmlItem {
|
||||
private Boolean namespaceBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array";
|
||||
private List<Integer> namespaceArray;
|
||||
private List<Integer> namespaceArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array";
|
||||
private List<Integer> namespaceWrappedArray;
|
||||
private List<Integer> namespaceWrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string";
|
||||
private String prefixNsString;
|
||||
@@ -145,10 +145,10 @@ public class XmlItem {
|
||||
private Boolean prefixNsBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array";
|
||||
private List<Integer> prefixNsArray;
|
||||
private List<Integer> prefixNsArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array";
|
||||
private List<Integer> prefixNsWrappedArray;
|
||||
private List<Integer> prefixNsWrappedArray = new ArrayList<>();
|
||||
|
||||
public XmlItem() {
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.openapitools.client.JSON;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber";
|
||||
private List<List<BigDecimal>> arrayArrayNumber;
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.openapitools.client.JSON;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber";
|
||||
private List<BigDecimal> arrayNumber;
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -40,13 +40,13 @@ import org.openapitools.client.JSON;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayTest {
|
||||
public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string";
|
||||
private List<String> arrayOfString;
|
||||
private List<String> arrayOfString = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
|
||||
private List<List<Long>> arrayArrayOfInteger;
|
||||
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel;
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
|
||||
|
||||
public ArrayTest() {
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public class EnumArrays {
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum";
|
||||
private List<ArrayEnumEnum> arrayEnum;
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
|
||||
|
||||
public EnumArrays() {
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class FileSchemaTestClass {
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<ModelFile> files;
|
||||
private List<ModelFile> files = new ArrayList<>();
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class Pet {
|
||||
private Set<String> photoUrls = new LinkedHashSet<>();
|
||||
|
||||
public static final String JSON_PROPERTY_TAGS = "tags";
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -78,7 +78,7 @@ public class XmlItem {
|
||||
private Boolean attributeBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array";
|
||||
private List<Integer> wrappedArray;
|
||||
private List<Integer> wrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_NAME_STRING = "name_string";
|
||||
private String nameString;
|
||||
@@ -93,10 +93,10 @@ public class XmlItem {
|
||||
private Boolean nameBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_NAME_ARRAY = "name_array";
|
||||
private List<Integer> nameArray;
|
||||
private List<Integer> nameArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array";
|
||||
private List<Integer> nameWrappedArray;
|
||||
private List<Integer> nameWrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string";
|
||||
private String prefixString;
|
||||
@@ -111,10 +111,10 @@ public class XmlItem {
|
||||
private Boolean prefixBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array";
|
||||
private List<Integer> prefixArray;
|
||||
private List<Integer> prefixArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array";
|
||||
private List<Integer> prefixWrappedArray;
|
||||
private List<Integer> prefixWrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string";
|
||||
private String namespaceString;
|
||||
@@ -129,10 +129,10 @@ public class XmlItem {
|
||||
private Boolean namespaceBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array";
|
||||
private List<Integer> namespaceArray;
|
||||
private List<Integer> namespaceArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array";
|
||||
private List<Integer> namespaceWrappedArray;
|
||||
private List<Integer> namespaceWrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string";
|
||||
private String prefixNsString;
|
||||
@@ -147,10 +147,10 @@ public class XmlItem {
|
||||
private Boolean prefixNsBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array";
|
||||
private List<Integer> prefixNsArray;
|
||||
private List<Integer> prefixNsArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array";
|
||||
private List<Integer> prefixNsWrappedArray;
|
||||
private List<Integer> prefixNsWrappedArray = new ArrayList<>();
|
||||
|
||||
public XmlItem() {
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.openapitools.client.JSON;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber";
|
||||
private List<List<BigDecimal>> arrayArrayNumber;
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.openapitools.client.JSON;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber";
|
||||
private List<BigDecimal> arrayNumber;
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -40,13 +40,13 @@ import org.openapitools.client.JSON;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayTest {
|
||||
public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string";
|
||||
private List<String> arrayOfString;
|
||||
private List<String> arrayOfString = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
|
||||
private List<List<Long>> arrayArrayOfInteger;
|
||||
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel;
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
|
||||
|
||||
public ArrayTest() {
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public class EnumArrays {
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum";
|
||||
private List<ArrayEnumEnum> arrayEnum;
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
|
||||
|
||||
public EnumArrays() {
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class FileSchemaTestClass {
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<ModelFile> files;
|
||||
private List<ModelFile> files = new ArrayList<>();
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class Pet {
|
||||
private Set<String> photoUrls = new LinkedHashSet<>();
|
||||
|
||||
public static final String JSON_PROPERTY_TAGS = "tags";
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -78,7 +78,7 @@ public class XmlItem {
|
||||
private Boolean attributeBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array";
|
||||
private List<Integer> wrappedArray;
|
||||
private List<Integer> wrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_NAME_STRING = "name_string";
|
||||
private String nameString;
|
||||
@@ -93,10 +93,10 @@ public class XmlItem {
|
||||
private Boolean nameBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_NAME_ARRAY = "name_array";
|
||||
private List<Integer> nameArray;
|
||||
private List<Integer> nameArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array";
|
||||
private List<Integer> nameWrappedArray;
|
||||
private List<Integer> nameWrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string";
|
||||
private String prefixString;
|
||||
@@ -111,10 +111,10 @@ public class XmlItem {
|
||||
private Boolean prefixBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array";
|
||||
private List<Integer> prefixArray;
|
||||
private List<Integer> prefixArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array";
|
||||
private List<Integer> prefixWrappedArray;
|
||||
private List<Integer> prefixWrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string";
|
||||
private String namespaceString;
|
||||
@@ -129,10 +129,10 @@ public class XmlItem {
|
||||
private Boolean namespaceBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array";
|
||||
private List<Integer> namespaceArray;
|
||||
private List<Integer> namespaceArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array";
|
||||
private List<Integer> namespaceWrappedArray;
|
||||
private List<Integer> namespaceWrappedArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string";
|
||||
private String prefixNsString;
|
||||
@@ -147,10 +147,10 @@ public class XmlItem {
|
||||
private Boolean prefixNsBoolean;
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array";
|
||||
private List<Integer> prefixNsArray;
|
||||
private List<Integer> prefixNsArray = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array";
|
||||
private List<Integer> prefixNsWrappedArray;
|
||||
private List<Integer> prefixNsWrappedArray = new ArrayList<>();
|
||||
|
||||
public XmlItem() {
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.openapitools.client.JSON;
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber";
|
||||
private List<List<BigDecimal>> arrayArrayNumber;
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.openapitools.client.JSON;
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber";
|
||||
private List<BigDecimal> arrayNumber;
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -40,13 +40,13 @@ import org.openapitools.client.JSON;
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayTest {
|
||||
public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string";
|
||||
private List<String> arrayOfString;
|
||||
private List<String> arrayOfString = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
|
||||
private List<List<Long>> arrayArrayOfInteger;
|
||||
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel;
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
|
||||
|
||||
public ArrayTest() {
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class Drawing {
|
||||
private JsonNullable<NullableShape> nullableShape = JsonNullable.<NullableShape>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_SHAPES = "shapes";
|
||||
private List<Shape> shapes;
|
||||
private List<Shape> shapes = new ArrayList<>();
|
||||
|
||||
public Drawing() {
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public class EnumArrays {
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum";
|
||||
private List<ArrayEnumEnum> arrayEnum;
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
|
||||
|
||||
public EnumArrays() {
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class FileSchemaTestClass {
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<ModelFile> files;
|
||||
private List<ModelFile> files = new ArrayList<>();
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ public class NullableClass {
|
||||
private JsonNullable<List<Object>> arrayAndItemsNullableProp = JsonNullable.<List<Object>>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable";
|
||||
private List<Object> arrayItemsNullable;
|
||||
private List<Object> arrayItemsNullable = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop";
|
||||
private JsonNullable<Map<String, Object>> objectNullableProp = JsonNullable.<Map<String, Object>>undefined();
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ObjectWithDeprecatedFields {
|
||||
|
||||
public static final String JSON_PROPERTY_BARS = "bars";
|
||||
@Deprecated
|
||||
private List<String> bars;
|
||||
private List<String> bars = new ArrayList<>();
|
||||
|
||||
public ObjectWithDeprecatedFields() {
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class Pet {
|
||||
private List<String> photoUrls = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_TAGS = "tags";
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -40,7 +40,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber";
|
||||
private List<List<BigDecimal>> arrayArrayNumber;
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber";
|
||||
private List<BigDecimal> arrayNumber;
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -42,13 +42,13 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayTest {
|
||||
public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string";
|
||||
private List<String> arrayOfString;
|
||||
private List<String> arrayOfString = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
|
||||
private List<List<Long>> arrayArrayOfInteger;
|
||||
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel;
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
|
||||
|
||||
public ArrayTest() {
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class Drawing extends HashMap<String, Fruit> {
|
||||
private JsonNullable<NullableShape> nullableShape = JsonNullable.<NullableShape>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_SHAPES = "shapes";
|
||||
private List<Shape> shapes;
|
||||
private List<Shape> shapes = new ArrayList<>();
|
||||
|
||||
public Drawing() {
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public class EnumArrays {
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum";
|
||||
private List<ArrayEnumEnum> arrayEnum;
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
|
||||
|
||||
public EnumArrays() {
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class FileSchemaTestClass {
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<ModelFile> files;
|
||||
private List<ModelFile> files = new ArrayList<>();
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class NullableClass extends HashMap<String, Object> {
|
||||
private JsonNullable<List<Object>> arrayAndItemsNullableProp = JsonNullable.<List<Object>>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable";
|
||||
private List<Object> arrayItemsNullable;
|
||||
private List<Object> arrayItemsNullable = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop";
|
||||
private JsonNullable<Map<String, Object>> objectNullableProp = JsonNullable.<Map<String, Object>>undefined();
|
||||
|
||||
@@ -53,7 +53,7 @@ public class ObjectWithDeprecatedFields {
|
||||
private DeprecatedObject deprecatedRef;
|
||||
|
||||
public static final String JSON_PROPERTY_BARS = "bars";
|
||||
private List<String> bars;
|
||||
private List<String> bars = new ArrayList<>();
|
||||
|
||||
public ObjectWithDeprecatedFields() {
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class Pet {
|
||||
private List<String> photoUrls = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_TAGS = "tags";
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -58,7 +58,7 @@ public class Pet {
|
||||
private List<String> photoUrls = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_TAGS = "tags";
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -40,7 +40,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber";
|
||||
private List<List<BigDecimal>> arrayArrayNumber;
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayOfNumberOnly {
|
||||
public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber";
|
||||
private List<BigDecimal> arrayNumber;
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -42,13 +42,13 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0-SNAPSHOT")
|
||||
public class ArrayTest {
|
||||
public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string";
|
||||
private List<String> arrayOfString;
|
||||
private List<String> arrayOfString = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
|
||||
private List<List<Long>> arrayArrayOfInteger;
|
||||
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel;
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
|
||||
|
||||
public ArrayTest() {
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class Drawing extends HashMap<String, Fruit> {
|
||||
private JsonNullable<NullableShape> nullableShape = JsonNullable.<NullableShape>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_SHAPES = "shapes";
|
||||
private List<Shape> shapes;
|
||||
private List<Shape> shapes = new ArrayList<>();
|
||||
|
||||
public Drawing() {
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public class EnumArrays {
|
||||
}
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum";
|
||||
private List<ArrayEnumEnum> arrayEnum;
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
|
||||
|
||||
public EnumArrays() {
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class FileSchemaTestClass {
|
||||
private ModelFile _file;
|
||||
|
||||
public static final String JSON_PROPERTY_FILES = "files";
|
||||
private List<ModelFile> files;
|
||||
private List<ModelFile> files = new ArrayList<>();
|
||||
|
||||
public FileSchemaTestClass() {
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class NullableClass extends HashMap<String, Object> {
|
||||
private JsonNullable<List<Object>> arrayAndItemsNullableProp = JsonNullable.<List<Object>>undefined();
|
||||
|
||||
public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable";
|
||||
private List<Object> arrayItemsNullable;
|
||||
private List<Object> arrayItemsNullable = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop";
|
||||
private JsonNullable<Map<String, Object>> objectNullableProp = JsonNullable.<Map<String, Object>>undefined();
|
||||
|
||||
@@ -53,7 +53,7 @@ public class ObjectWithDeprecatedFields {
|
||||
private DeprecatedObject deprecatedRef;
|
||||
|
||||
public static final String JSON_PROPERTY_BARS = "bars";
|
||||
private List<String> bars;
|
||||
private List<String> bars = new ArrayList<>();
|
||||
|
||||
public ObjectWithDeprecatedFields() {
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class Pet {
|
||||
private List<String> photoUrls = new ArrayList<>();
|
||||
|
||||
public static final String JSON_PROPERTY_TAGS = "tags";
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -60,11 +60,11 @@ public class AnyTypeTest {
|
||||
|
||||
public static final String SERIALIZED_NAME_ARRAY_PROP = "array_prop";
|
||||
@SerializedName(SERIALIZED_NAME_ARRAY_PROP)
|
||||
private List<String> arrayProp;
|
||||
private List<String> arrayProp = new ArrayList<>();
|
||||
|
||||
public static final String SERIALIZED_NAME_REF_ARRAY_PREFIX_ITEMS = "ref_array_prefix_items";
|
||||
@SerializedName(SERIALIZED_NAME_REF_ARRAY_PREFIX_ITEMS)
|
||||
private List<String> refArrayPrefixItems;
|
||||
private List<String> refArrayPrefixItems = new ArrayList<>();
|
||||
|
||||
public AnyTypeTest() {
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class Pet {
|
||||
|
||||
public static final String SERIALIZED_NAME_TAGS = "tags";
|
||||
@SerializedName(SERIALIZED_NAME_TAGS)
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -73,7 +73,7 @@ public class Pet {
|
||||
|
||||
public static final String SERIALIZED_NAME_TAGS = "tags";
|
||||
@SerializedName(SERIALIZED_NAME_TAGS)
|
||||
private List<Tag> tags;
|
||||
private List<Tag> tags = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
||||
@@ -56,7 +56,7 @@ import org.openapitools.client.JSON;
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
public static final String SERIALIZED_NAME_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber";
|
||||
@SerializedName(SERIALIZED_NAME_ARRAY_ARRAY_NUMBER)
|
||||
private List<List<BigDecimal>> arrayArrayNumber;
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ import org.openapitools.client.JSON;
|
||||
public class ArrayOfNumberOnly {
|
||||
public static final String SERIALIZED_NAME_ARRAY_NUMBER = "ArrayNumber";
|
||||
@SerializedName(SERIALIZED_NAME_ARRAY_NUMBER)
|
||||
private List<BigDecimal> arrayNumber;
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<>();
|
||||
|
||||
public ArrayOfNumberOnly() {
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user