forked from loafle/openapi-generator-original
Fix JsonNullable issue for Helidon generators (#15423)
* fix JsonNullable issue Signed-off-by: aserkes <andrii.serkes@oracle.com> * update samples Signed-off-by: aserkes <andrii.serkes@oracle.com> * update samples, refactoring Signed-off-by: aserkes <andrii.serkes@oracle.com> * update samples, refactoring Signed-off-by: aserkes <andrii.serkes@oracle.com> * update samples Signed-off-by: aserkes <andrii.serkes@oracle.com> --------- Signed-off-by: aserkes <andrii.serkes@oracle.com>
This commit is contained in:
parent
6d56a1911e
commit
fbf42de200
@ -29,7 +29,6 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
import java.util.function.Function;
|
||||
|
||||
import io.swagger.v3.oas.models.Operation;
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
@ -235,7 +234,8 @@ public class JavaHelidonClientCodegen extends JavaHelidonCommonCodegen {
|
||||
supportingFiles.add(new SupportingFile("RFC3339DateFormat.mustache", invokerFolder.toString(), "RFC3339DateFormat.java"));
|
||||
break;
|
||||
case SERIALIZATION_LIBRARY_JSONB:
|
||||
openApiNullable = false; // for Jackson only
|
||||
openApiNullable = false;
|
||||
additionalProperties.put(OPENAPI_NULLABLE, false);
|
||||
additionalProperties.put(SERIALIZATION_LIBRARY_JSONB, "true");
|
||||
additionalProperties.remove(SERIALIZATION_LIBRARY_JACKSON);
|
||||
break;
|
||||
@ -445,7 +445,6 @@ public class JavaHelidonClientCodegen extends JavaHelidonCommonCodegen {
|
||||
|
||||
if (addImports) {
|
||||
Map<String, String> imports2Classnames = new HashMap<>();
|
||||
imports2Classnames.put("JsonNullable", "org.openapitools.jackson.nullable.JsonNullable");
|
||||
imports2Classnames.put("NoSuchElementException", "java.util.NoSuchElementException");
|
||||
imports2Classnames.put("JsonIgnore", "com.fasterxml.jackson.annotation.JsonIgnore");
|
||||
for (Map.Entry<String, String> entry : imports2Classnames.entrySet()) {
|
||||
|
@ -254,6 +254,8 @@ public class JavaHelidonServerCodegen extends JavaHelidonCommonCodegen {
|
||||
}
|
||||
break;
|
||||
case SERIALIZATION_LIBRARY_JSONB:
|
||||
openApiNullable = false;
|
||||
additionalProperties.put(OPENAPI_NULLABLE, false);
|
||||
additionalProperties.put(SERIALIZATION_LIBRARY_JSONB, "true");
|
||||
additionalProperties.remove(SERIALIZATION_LIBRARY_JACKSON);
|
||||
break;
|
||||
|
@ -16,6 +16,12 @@
|
||||
<description>{{artifactDescription}}</description>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
{{#openApiNullable}}
|
||||
<version.jackson.databind.nullable>0.2.6</version.jackson.databind.nullable>
|
||||
{{/openApiNullable}}
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.helidon.microprofile.rest-client</groupId>
|
||||
@ -37,16 +43,18 @@
|
||||
<groupId>{{x-helidon-rootJavaEEDepPrefix}}.json</groupId>
|
||||
<artifactId>{{x-helidon-rootJavaEEDepPrefix}}.json-api</artifactId>
|
||||
</dependency>
|
||||
{{#openApiNullable}}
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
<version>${version.jackson.databind.nullable}</version>
|
||||
</dependency>
|
||||
{{/openApiNullable}}
|
||||
{{#jackson}}
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey.media</groupId>
|
||||
<artifactId>jersey-media-json-jackson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
<version>0.2.6</version>
|
||||
</dependency>
|
||||
{{/jackson}}
|
||||
{{#jsonb}}
|
||||
<dependency>
|
||||
|
@ -17,6 +17,12 @@
|
||||
<version>{{artifactVersion}}</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
{{#openApiNullable}}
|
||||
<version.jackson.databind.nullable>0.2.6</version.jackson.databind.nullable>
|
||||
{{/openApiNullable}}
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.helidon.webclient</groupId>
|
||||
@ -30,6 +36,13 @@
|
||||
<groupId>{{x-helidon-rootJavaEEDepPrefix}}.json</groupId>
|
||||
<artifactId>{{x-helidon-rootJavaEEDepPrefix}}.json-api</artifactId>
|
||||
</dependency>
|
||||
{{#openApiNullable}}
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
<version>${version.jackson.databind.nullable}</version>
|
||||
</dependency>
|
||||
{{/openApiNullable}}
|
||||
{{#jackson}}
|
||||
<dependency>
|
||||
<groupId>io.helidon.media</groupId>
|
||||
@ -39,11 +52,6 @@
|
||||
<groupId>org.glassfish.jersey.media</groupId>
|
||||
<artifactId>jersey-media-json-jackson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
<version>0.2.6</version>
|
||||
</dependency>
|
||||
{{/jackson}}
|
||||
{{#jsonb}}
|
||||
<dependency>
|
||||
|
@ -17,11 +17,11 @@
|
||||
<version>{{artifactVersion}}</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
{{#openApiNullable}}
|
||||
<properties>
|
||||
<version.jackson.databind.nullable>0.2.3</version.jackson.databind.nullable>
|
||||
</properties>
|
||||
{{#openApiNullable}}
|
||||
<version.jackson.databind.nullable>0.2.6</version.jackson.databind.nullable>
|
||||
{{/openApiNullable}}
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -19,7 +19,9 @@
|
||||
|
||||
<properties>
|
||||
<mainClass>{{{invokerPackage}}}.Main</mainClass>
|
||||
<version.jackson.databind.nullable>0.2.3</version.jackson.databind.nullable>
|
||||
{{#openApiNullable}}
|
||||
<version.jackson.databind.nullable>0.2.6</version.jackson.databind.nullable>
|
||||
{{/openApiNullable}}
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
@ -16,6 +16,10 @@
|
||||
<description>OpenAPI Java</description>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<version.jackson.databind.nullable>0.2.6</version.jackson.databind.nullable>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.helidon.microprofile.rest-client</groupId>
|
||||
@ -37,14 +41,14 @@
|
||||
<groupId>jakarta.json</groupId>
|
||||
<artifactId>jakarta.json-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey.media</groupId>
|
||||
<artifactId>jersey-media-json-jackson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
<version>0.2.6</version>
|
||||
<version>${version.jackson.databind.nullable}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey.media</groupId>
|
||||
<artifactId>jersey-media-json-jackson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
|
@ -23,7 +23,6 @@ import org.openapitools.client.model.OuterEnumInteger;
|
||||
import org.openapitools.client.model.OuterEnumIntegerDefaultValue;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
|
||||
|
@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
|
||||
|
@ -26,7 +26,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
|
||||
|
@ -15,6 +15,10 @@
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<version.jackson.databind.nullable>0.2.6</version.jackson.databind.nullable>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.helidon.webclient</groupId>
|
||||
@ -28,6 +32,11 @@
|
||||
<groupId>jakarta.json</groupId>
|
||||
<artifactId>jakarta.json-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
<version>${version.jackson.databind.nullable}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.helidon.media</groupId>
|
||||
<artifactId>helidon-media-jackson</artifactId>
|
||||
@ -36,11 +45,6 @@
|
||||
<groupId>org.glassfish.jersey.media</groupId>
|
||||
<artifactId>jersey-media-json-jackson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
<version>0.2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
|
@ -23,7 +23,6 @@ import org.openapitools.client.model.OuterEnumInteger;
|
||||
import org.openapitools.client.model.OuterEnumIntegerDefaultValue;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
|
||||
|
@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
|
||||
|
@ -26,7 +26,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
|
||||
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for AdditionalPropertiesClass
|
||||
*/
|
||||
public class AdditionalPropertiesClassTest {
|
||||
private final AdditionalPropertiesClass model = new AdditionalPropertiesClass();
|
||||
|
||||
/**
|
||||
* Model tests for AdditionalPropertiesClass
|
||||
*/
|
||||
@Test
|
||||
public void testAdditionalPropertiesClass() {
|
||||
// TODO: test AdditionalPropertiesClass
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'mapProperty'
|
||||
*/
|
||||
@Test
|
||||
public void mapPropertyTest() {
|
||||
// TODO: test mapProperty
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'mapOfMapProperty'
|
||||
*/
|
||||
@Test
|
||||
public void mapOfMapPropertyTest() {
|
||||
// TODO: test mapOfMapProperty
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ArrayOfArrayOfNumberOnly
|
||||
*/
|
||||
public class ArrayOfArrayOfNumberOnlyTest {
|
||||
private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly();
|
||||
|
||||
/**
|
||||
* Model tests for ArrayOfArrayOfNumberOnly
|
||||
*/
|
||||
@Test
|
||||
public void testArrayOfArrayOfNumberOnly() {
|
||||
// TODO: test ArrayOfArrayOfNumberOnly
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'arrayArrayNumber'
|
||||
*/
|
||||
@Test
|
||||
public void arrayArrayNumberTest() {
|
||||
// TODO: test arrayArrayNumber
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.server.model.ReadOnlyFirst;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ArrayTest
|
||||
*/
|
||||
public class ArrayTestTest {
|
||||
private final ArrayTest model = new ArrayTest();
|
||||
|
||||
/**
|
||||
* Model tests for ArrayTest
|
||||
*/
|
||||
@Test
|
||||
public void testArrayTest() {
|
||||
// TODO: test ArrayTest
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'arrayOfString'
|
||||
*/
|
||||
@Test
|
||||
public void arrayOfStringTest() {
|
||||
// TODO: test arrayOfString
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'arrayArrayOfInteger'
|
||||
*/
|
||||
@Test
|
||||
public void arrayArrayOfIntegerTest() {
|
||||
// TODO: test arrayArrayOfInteger
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'arrayArrayOfModel'
|
||||
*/
|
||||
@Test
|
||||
public void arrayArrayOfModelTest() {
|
||||
// TODO: test arrayArrayOfModel
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for Capitalization
|
||||
*/
|
||||
public class CapitalizationTest {
|
||||
private final Capitalization model = new Capitalization();
|
||||
|
||||
/**
|
||||
* Model tests for Capitalization
|
||||
*/
|
||||
@Test
|
||||
public void testCapitalization() {
|
||||
// TODO: test Capitalization
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'smallCamel'
|
||||
*/
|
||||
@Test
|
||||
public void smallCamelTest() {
|
||||
// TODO: test smallCamel
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'capitalCamel'
|
||||
*/
|
||||
@Test
|
||||
public void capitalCamelTest() {
|
||||
// TODO: test capitalCamel
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'smallSnake'
|
||||
*/
|
||||
@Test
|
||||
public void smallSnakeTest() {
|
||||
// TODO: test smallSnake
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'capitalSnake'
|
||||
*/
|
||||
@Test
|
||||
public void capitalSnakeTest() {
|
||||
// TODO: test capitalSnake
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'scAETHFlowPoints'
|
||||
*/
|
||||
@Test
|
||||
public void scAETHFlowPointsTest() {
|
||||
// TODO: test scAETHFlowPoints
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'ATT_NAME'
|
||||
*/
|
||||
@Test
|
||||
public void ATT_NAMETest() {
|
||||
// TODO: test ATT_NAME
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for CatAllOf
|
||||
*/
|
||||
public class CatAllOfTest {
|
||||
private final CatAllOf model = new CatAllOf();
|
||||
|
||||
/**
|
||||
* Model tests for CatAllOf
|
||||
*/
|
||||
@Test
|
||||
public void testCatAllOf() {
|
||||
// TODO: test CatAllOf
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'declawed'
|
||||
*/
|
||||
@Test
|
||||
public void declawedTest() {
|
||||
// TODO: test declawed
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import org.openapitools.server.model.Animal;
|
||||
import org.openapitools.server.model.CatAllOf;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for Cat
|
||||
*/
|
||||
public class CatTest {
|
||||
private final Cat model = new Cat();
|
||||
|
||||
/**
|
||||
* Model tests for Cat
|
||||
*/
|
||||
@Test
|
||||
public void testCat() {
|
||||
// TODO: test Cat
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'className'
|
||||
*/
|
||||
@Test
|
||||
public void classNameTest() {
|
||||
// TODO: test className
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'color'
|
||||
*/
|
||||
@Test
|
||||
public void colorTest() {
|
||||
// TODO: test color
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'declawed'
|
||||
*/
|
||||
@Test
|
||||
public void declawedTest() {
|
||||
// TODO: test declawed
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for Category
|
||||
*/
|
||||
public class CategoryTest {
|
||||
private final Category model = new Category();
|
||||
|
||||
/**
|
||||
* Model tests for Category
|
||||
*/
|
||||
@Test
|
||||
public void testCategory() {
|
||||
// TODO: test Category
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'id'
|
||||
*/
|
||||
@Test
|
||||
public void idTest() {
|
||||
// TODO: test id
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'name'
|
||||
*/
|
||||
@Test
|
||||
public void nameTest() {
|
||||
// TODO: test name
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for Client
|
||||
*/
|
||||
public class ClientTest {
|
||||
private final Client model = new Client();
|
||||
|
||||
/**
|
||||
* Model tests for Client
|
||||
*/
|
||||
@Test
|
||||
public void testClient() {
|
||||
// TODO: test Client
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'client'
|
||||
*/
|
||||
@Test
|
||||
public void clientTest() {
|
||||
// TODO: test client
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for DeprecatedObject
|
||||
*/
|
||||
public class DeprecatedObjectTest {
|
||||
private final DeprecatedObject model = new DeprecatedObject();
|
||||
|
||||
/**
|
||||
* Model tests for DeprecatedObject
|
||||
*/
|
||||
@Test
|
||||
public void testDeprecatedObject() {
|
||||
// TODO: test DeprecatedObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'name'
|
||||
*/
|
||||
@Test
|
||||
public void nameTest() {
|
||||
// TODO: test name
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for DogAllOf
|
||||
*/
|
||||
public class DogAllOfTest {
|
||||
private final DogAllOf model = new DogAllOf();
|
||||
|
||||
/**
|
||||
* Model tests for DogAllOf
|
||||
*/
|
||||
@Test
|
||||
public void testDogAllOf() {
|
||||
// TODO: test DogAllOf
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'breed'
|
||||
*/
|
||||
@Test
|
||||
public void breedTest() {
|
||||
// TODO: test breed
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import org.openapitools.server.model.Animal;
|
||||
import org.openapitools.server.model.DogAllOf;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for Dog
|
||||
*/
|
||||
public class DogTest {
|
||||
private final Dog model = new Dog();
|
||||
|
||||
/**
|
||||
* Model tests for Dog
|
||||
*/
|
||||
@Test
|
||||
public void testDog() {
|
||||
// TODO: test Dog
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'className'
|
||||
*/
|
||||
@Test
|
||||
public void classNameTest() {
|
||||
// TODO: test className
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'color'
|
||||
*/
|
||||
@Test
|
||||
public void colorTest() {
|
||||
// TODO: test color
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'breed'
|
||||
*/
|
||||
@Test
|
||||
public void breedTest() {
|
||||
// TODO: test breed
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for EnumClass
|
||||
*/
|
||||
public class EnumClassTest {
|
||||
/**
|
||||
* Model tests for EnumClass
|
||||
*/
|
||||
@Test
|
||||
public void testEnumClass() {
|
||||
// TODO: test EnumClass
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import org.openapitools.server.model.OuterEnum;
|
||||
import org.openapitools.server.model.OuterEnumDefaultValue;
|
||||
import org.openapitools.server.model.OuterEnumInteger;
|
||||
import org.openapitools.server.model.OuterEnumIntegerDefaultValue;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for EnumTest
|
||||
*/
|
||||
public class EnumTestTest {
|
||||
private final EnumTest model = new EnumTest();
|
||||
|
||||
/**
|
||||
* Model tests for EnumTest
|
||||
*/
|
||||
@Test
|
||||
public void testEnumTest() {
|
||||
// TODO: test EnumTest
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'enumString'
|
||||
*/
|
||||
@Test
|
||||
public void enumStringTest() {
|
||||
// TODO: test enumString
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'enumStringRequired'
|
||||
*/
|
||||
@Test
|
||||
public void enumStringRequiredTest() {
|
||||
// TODO: test enumStringRequired
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'enumInteger'
|
||||
*/
|
||||
@Test
|
||||
public void enumIntegerTest() {
|
||||
// TODO: test enumInteger
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'enumNumber'
|
||||
*/
|
||||
@Test
|
||||
public void enumNumberTest() {
|
||||
// TODO: test enumNumber
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'outerEnum'
|
||||
*/
|
||||
@Test
|
||||
public void outerEnumTest() {
|
||||
// TODO: test outerEnum
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'outerEnumInteger'
|
||||
*/
|
||||
@Test
|
||||
public void outerEnumIntegerTest() {
|
||||
// TODO: test outerEnumInteger
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'outerEnumDefaultValue'
|
||||
*/
|
||||
@Test
|
||||
public void outerEnumDefaultValueTest() {
|
||||
// TODO: test outerEnumDefaultValue
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'outerEnumIntegerDefaultValue'
|
||||
*/
|
||||
@Test
|
||||
public void outerEnumIntegerDefaultValueTest() {
|
||||
// TODO: test outerEnumIntegerDefaultValue
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.server.model.ModelFile;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for FileSchemaTestClass
|
||||
*/
|
||||
public class FileSchemaTestClassTest {
|
||||
private final FileSchemaTestClass model = new FileSchemaTestClass();
|
||||
|
||||
/**
|
||||
* Model tests for FileSchemaTestClass
|
||||
*/
|
||||
@Test
|
||||
public void testFileSchemaTestClass() {
|
||||
// TODO: test FileSchemaTestClass
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property '_file'
|
||||
*/
|
||||
@Test
|
||||
public void _fileTest() {
|
||||
// TODO: test _file
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'files'
|
||||
*/
|
||||
@Test
|
||||
public void filesTest() {
|
||||
// TODO: test files
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import org.openapitools.server.model.Foo;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for FooGetDefaultResponse
|
||||
*/
|
||||
public class FooGetDefaultResponseTest {
|
||||
private final FooGetDefaultResponse model = new FooGetDefaultResponse();
|
||||
|
||||
/**
|
||||
* Model tests for FooGetDefaultResponse
|
||||
*/
|
||||
@Test
|
||||
public void testFooGetDefaultResponse() {
|
||||
// TODO: test FooGetDefaultResponse
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'string'
|
||||
*/
|
||||
@Test
|
||||
public void stringTest() {
|
||||
// TODO: test string
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for Foo
|
||||
*/
|
||||
public class FooTest {
|
||||
private final Foo model = new Foo();
|
||||
|
||||
/**
|
||||
* Model tests for Foo
|
||||
*/
|
||||
@Test
|
||||
public void testFoo() {
|
||||
// TODO: test Foo
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'bar'
|
||||
*/
|
||||
@Test
|
||||
public void barTest() {
|
||||
// TODO: test bar
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for HasOnlyReadOnly
|
||||
*/
|
||||
public class HasOnlyReadOnlyTest {
|
||||
private final HasOnlyReadOnly model = new HasOnlyReadOnly();
|
||||
|
||||
/**
|
||||
* Model tests for HasOnlyReadOnly
|
||||
*/
|
||||
@Test
|
||||
public void testHasOnlyReadOnly() {
|
||||
// TODO: test HasOnlyReadOnly
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'bar'
|
||||
*/
|
||||
@Test
|
||||
public void barTest() {
|
||||
// TODO: test bar
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'foo'
|
||||
*/
|
||||
@Test
|
||||
public void fooTest() {
|
||||
// TODO: test foo
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for HealthCheckResult
|
||||
*/
|
||||
public class HealthCheckResultTest {
|
||||
private final HealthCheckResult model = new HealthCheckResult();
|
||||
|
||||
/**
|
||||
* Model tests for HealthCheckResult
|
||||
*/
|
||||
@Test
|
||||
public void testHealthCheckResult() {
|
||||
// TODO: test HealthCheckResult
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'nullableMessage'
|
||||
*/
|
||||
@Test
|
||||
public void nullableMessageTest() {
|
||||
// TODO: test nullableMessage
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import org.openapitools.server.model.Animal;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for MixedPropertiesAndAdditionalPropertiesClass
|
||||
*/
|
||||
public class MixedPropertiesAndAdditionalPropertiesClassTest {
|
||||
private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass();
|
||||
|
||||
/**
|
||||
* Model tests for MixedPropertiesAndAdditionalPropertiesClass
|
||||
*/
|
||||
@Test
|
||||
public void testMixedPropertiesAndAdditionalPropertiesClass() {
|
||||
// TODO: test MixedPropertiesAndAdditionalPropertiesClass
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'uuid'
|
||||
*/
|
||||
@Test
|
||||
public void uuidTest() {
|
||||
// TODO: test uuid
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'dateTime'
|
||||
*/
|
||||
@Test
|
||||
public void dateTimeTest() {
|
||||
// TODO: test dateTime
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'map'
|
||||
*/
|
||||
@Test
|
||||
public void mapTest() {
|
||||
// TODO: test map
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for Model200Response
|
||||
*/
|
||||
public class Model200ResponseTest {
|
||||
private final Model200Response model = new Model200Response();
|
||||
|
||||
/**
|
||||
* Model tests for Model200Response
|
||||
*/
|
||||
@Test
|
||||
public void testModel200Response() {
|
||||
// TODO: test Model200Response
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'name'
|
||||
*/
|
||||
@Test
|
||||
public void nameTest() {
|
||||
// TODO: test name
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'propertyClass'
|
||||
*/
|
||||
@Test
|
||||
public void propertyClassTest() {
|
||||
// TODO: test propertyClass
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,136 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for NullableClass
|
||||
*/
|
||||
public class NullableClassTest {
|
||||
private final NullableClass model = new NullableClass();
|
||||
|
||||
/**
|
||||
* Model tests for NullableClass
|
||||
*/
|
||||
@Test
|
||||
public void testNullableClass() {
|
||||
// TODO: test NullableClass
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'integerProp'
|
||||
*/
|
||||
@Test
|
||||
public void integerPropTest() {
|
||||
// TODO: test integerProp
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'numberProp'
|
||||
*/
|
||||
@Test
|
||||
public void numberPropTest() {
|
||||
// TODO: test numberProp
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'booleanProp'
|
||||
*/
|
||||
@Test
|
||||
public void booleanPropTest() {
|
||||
// TODO: test booleanProp
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'stringProp'
|
||||
*/
|
||||
@Test
|
||||
public void stringPropTest() {
|
||||
// TODO: test stringProp
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'dateProp'
|
||||
*/
|
||||
@Test
|
||||
public void datePropTest() {
|
||||
// TODO: test dateProp
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'datetimeProp'
|
||||
*/
|
||||
@Test
|
||||
public void datetimePropTest() {
|
||||
// TODO: test datetimeProp
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'arrayNullableProp'
|
||||
*/
|
||||
@Test
|
||||
public void arrayNullablePropTest() {
|
||||
// TODO: test arrayNullableProp
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'arrayAndItemsNullableProp'
|
||||
*/
|
||||
@Test
|
||||
public void arrayAndItemsNullablePropTest() {
|
||||
// TODO: test arrayAndItemsNullableProp
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'arrayItemsNullable'
|
||||
*/
|
||||
@Test
|
||||
public void arrayItemsNullableTest() {
|
||||
// TODO: test arrayItemsNullable
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'objectNullableProp'
|
||||
*/
|
||||
@Test
|
||||
public void objectNullablePropTest() {
|
||||
// TODO: test objectNullableProp
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'objectAndItemsNullableProp'
|
||||
*/
|
||||
@Test
|
||||
public void objectAndItemsNullablePropTest() {
|
||||
// TODO: test objectAndItemsNullableProp
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'objectItemsNullable'
|
||||
*/
|
||||
@Test
|
||||
public void objectItemsNullableTest() {
|
||||
// TODO: test objectItemsNullable
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for NumberOnly
|
||||
*/
|
||||
public class NumberOnlyTest {
|
||||
private final NumberOnly model = new NumberOnly();
|
||||
|
||||
/**
|
||||
* Model tests for NumberOnly
|
||||
*/
|
||||
@Test
|
||||
public void testNumberOnly() {
|
||||
// TODO: test NumberOnly
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'justNumber'
|
||||
*/
|
||||
@Test
|
||||
public void justNumberTest() {
|
||||
// TODO: test justNumber
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for Order
|
||||
*/
|
||||
public class OrderTest {
|
||||
private final Order model = new Order();
|
||||
|
||||
/**
|
||||
* Model tests for Order
|
||||
*/
|
||||
@Test
|
||||
public void testOrder() {
|
||||
// TODO: test Order
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'id'
|
||||
*/
|
||||
@Test
|
||||
public void idTest() {
|
||||
// TODO: test id
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'petId'
|
||||
*/
|
||||
@Test
|
||||
public void petIdTest() {
|
||||
// TODO: test petId
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'quantity'
|
||||
*/
|
||||
@Test
|
||||
public void quantityTest() {
|
||||
// TODO: test quantity
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'shipDate'
|
||||
*/
|
||||
@Test
|
||||
public void shipDateTest() {
|
||||
// TODO: test shipDate
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'status'
|
||||
*/
|
||||
@Test
|
||||
public void statusTest() {
|
||||
// TODO: test status
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'complete'
|
||||
*/
|
||||
@Test
|
||||
public void completeTest() {
|
||||
// TODO: test complete
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for OuterEnumDefaultValue
|
||||
*/
|
||||
public class OuterEnumDefaultValueTest {
|
||||
/**
|
||||
* Model tests for OuterEnumDefaultValue
|
||||
*/
|
||||
@Test
|
||||
public void testOuterEnumDefaultValue() {
|
||||
// TODO: test OuterEnumDefaultValue
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ReadOnlyFirst
|
||||
*/
|
||||
public class ReadOnlyFirstTest {
|
||||
private final ReadOnlyFirst model = new ReadOnlyFirst();
|
||||
|
||||
/**
|
||||
* Model tests for ReadOnlyFirst
|
||||
*/
|
||||
@Test
|
||||
public void testReadOnlyFirst() {
|
||||
// TODO: test ReadOnlyFirst
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'bar'
|
||||
*/
|
||||
@Test
|
||||
public void barTest() {
|
||||
// TODO: test bar
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'baz'
|
||||
*/
|
||||
@Test
|
||||
public void bazTest() {
|
||||
// TODO: test baz
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for SingleRefType
|
||||
*/
|
||||
public class SingleRefTypeTest {
|
||||
/**
|
||||
* Model tests for SingleRefType
|
||||
*/
|
||||
@Test
|
||||
public void testSingleRefType() {
|
||||
// TODO: test SingleRefType
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for User
|
||||
*/
|
||||
public class UserTest {
|
||||
private final User model = new User();
|
||||
|
||||
/**
|
||||
* Model tests for User
|
||||
*/
|
||||
@Test
|
||||
public void testUser() {
|
||||
// TODO: test User
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'id'
|
||||
*/
|
||||
@Test
|
||||
public void idTest() {
|
||||
// TODO: test id
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'username'
|
||||
*/
|
||||
@Test
|
||||
public void usernameTest() {
|
||||
// TODO: test username
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'firstName'
|
||||
*/
|
||||
@Test
|
||||
public void firstNameTest() {
|
||||
// TODO: test firstName
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'lastName'
|
||||
*/
|
||||
@Test
|
||||
public void lastNameTest() {
|
||||
// TODO: test lastName
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'email'
|
||||
*/
|
||||
@Test
|
||||
public void emailTest() {
|
||||
// TODO: test email
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'password'
|
||||
*/
|
||||
@Test
|
||||
public void passwordTest() {
|
||||
// TODO: test password
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'phone'
|
||||
*/
|
||||
@Test
|
||||
public void phoneTest() {
|
||||
// TODO: test phone
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'userStatus'
|
||||
*/
|
||||
@Test
|
||||
public void userStatusTest() {
|
||||
// TODO: test userStatus
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
@ -0,0 +1,117 @@
|
||||
.openapi-generator-ignore
|
||||
README.md
|
||||
build.gradle
|
||||
pom.xml
|
||||
settings.gradle
|
||||
src/main/java/org/openapitools/server/Main.java
|
||||
src/main/java/org/openapitools/server/RFC3339DateFormat.java
|
||||
src/main/java/org/openapitools/server/api/AnotherFakeService.java
|
||||
src/main/java/org/openapitools/server/api/DefaultService.java
|
||||
src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java
|
||||
src/main/java/org/openapitools/server/api/FakeService.java
|
||||
src/main/java/org/openapitools/server/api/JsonProvider.java
|
||||
src/main/java/org/openapitools/server/api/PetService.java
|
||||
src/main/java/org/openapitools/server/api/StoreService.java
|
||||
src/main/java/org/openapitools/server/api/UserService.java
|
||||
src/main/java/org/openapitools/server/api/ValidatorUtils.java
|
||||
src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java
|
||||
src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java
|
||||
src/main/java/org/openapitools/server/model/Animal.java
|
||||
src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java
|
||||
src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java
|
||||
src/main/java/org/openapitools/server/model/ArrayTest.java
|
||||
src/main/java/org/openapitools/server/model/Capitalization.java
|
||||
src/main/java/org/openapitools/server/model/Cat.java
|
||||
src/main/java/org/openapitools/server/model/CatAllOf.java
|
||||
src/main/java/org/openapitools/server/model/Category.java
|
||||
src/main/java/org/openapitools/server/model/ClassModel.java
|
||||
src/main/java/org/openapitools/server/model/Client.java
|
||||
src/main/java/org/openapitools/server/model/DeprecatedObject.java
|
||||
src/main/java/org/openapitools/server/model/Dog.java
|
||||
src/main/java/org/openapitools/server/model/DogAllOf.java
|
||||
src/main/java/org/openapitools/server/model/EnumArrays.java
|
||||
src/main/java/org/openapitools/server/model/EnumClass.java
|
||||
src/main/java/org/openapitools/server/model/EnumTest.java
|
||||
src/main/java/org/openapitools/server/model/FileSchemaTestClass.java
|
||||
src/main/java/org/openapitools/server/model/Foo.java
|
||||
src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java
|
||||
src/main/java/org/openapitools/server/model/FormatTest.java
|
||||
src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java
|
||||
src/main/java/org/openapitools/server/model/HealthCheckResult.java
|
||||
src/main/java/org/openapitools/server/model/MapTest.java
|
||||
src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java
|
||||
src/main/java/org/openapitools/server/model/Model200Response.java
|
||||
src/main/java/org/openapitools/server/model/ModelApiResponse.java
|
||||
src/main/java/org/openapitools/server/model/ModelFile.java
|
||||
src/main/java/org/openapitools/server/model/ModelList.java
|
||||
src/main/java/org/openapitools/server/model/ModelReturn.java
|
||||
src/main/java/org/openapitools/server/model/Name.java
|
||||
src/main/java/org/openapitools/server/model/NullableClass.java
|
||||
src/main/java/org/openapitools/server/model/NumberOnly.java
|
||||
src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java
|
||||
src/main/java/org/openapitools/server/model/Order.java
|
||||
src/main/java/org/openapitools/server/model/OuterComposite.java
|
||||
src/main/java/org/openapitools/server/model/OuterEnum.java
|
||||
src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java
|
||||
src/main/java/org/openapitools/server/model/OuterEnumInteger.java
|
||||
src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java
|
||||
src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java
|
||||
src/main/java/org/openapitools/server/model/Pet.java
|
||||
src/main/java/org/openapitools/server/model/ReadOnlyFirst.java
|
||||
src/main/java/org/openapitools/server/model/SingleRefType.java
|
||||
src/main/java/org/openapitools/server/model/SpecialModelName.java
|
||||
src/main/java/org/openapitools/server/model/Tag.java
|
||||
src/main/java/org/openapitools/server/model/User.java
|
||||
src/main/java/org/openapitools/server/package-info.java
|
||||
src/main/resources/META-INF/openapi.yml
|
||||
src/main/resources/application.yaml
|
||||
src/main/resources/logging.properties
|
||||
src/test/java/org/openapitools/server/MainTest.java
|
||||
src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java
|
||||
src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java
|
||||
src/test/java/org/openapitools/server/model/AnimalTest.java
|
||||
src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java
|
||||
src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java
|
||||
src/test/java/org/openapitools/server/model/ArrayTestTest.java
|
||||
src/test/java/org/openapitools/server/model/CapitalizationTest.java
|
||||
src/test/java/org/openapitools/server/model/CatAllOfTest.java
|
||||
src/test/java/org/openapitools/server/model/CatTest.java
|
||||
src/test/java/org/openapitools/server/model/CategoryTest.java
|
||||
src/test/java/org/openapitools/server/model/ClassModelTest.java
|
||||
src/test/java/org/openapitools/server/model/ClientTest.java
|
||||
src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java
|
||||
src/test/java/org/openapitools/server/model/DogAllOfTest.java
|
||||
src/test/java/org/openapitools/server/model/DogTest.java
|
||||
src/test/java/org/openapitools/server/model/EnumArraysTest.java
|
||||
src/test/java/org/openapitools/server/model/EnumClassTest.java
|
||||
src/test/java/org/openapitools/server/model/EnumTestTest.java
|
||||
src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java
|
||||
src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java
|
||||
src/test/java/org/openapitools/server/model/FooTest.java
|
||||
src/test/java/org/openapitools/server/model/FormatTestTest.java
|
||||
src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java
|
||||
src/test/java/org/openapitools/server/model/HealthCheckResultTest.java
|
||||
src/test/java/org/openapitools/server/model/MapTestTest.java
|
||||
src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java
|
||||
src/test/java/org/openapitools/server/model/Model200ResponseTest.java
|
||||
src/test/java/org/openapitools/server/model/ModelApiResponseTest.java
|
||||
src/test/java/org/openapitools/server/model/ModelFileTest.java
|
||||
src/test/java/org/openapitools/server/model/ModelListTest.java
|
||||
src/test/java/org/openapitools/server/model/ModelReturnTest.java
|
||||
src/test/java/org/openapitools/server/model/NameTest.java
|
||||
src/test/java/org/openapitools/server/model/NullableClassTest.java
|
||||
src/test/java/org/openapitools/server/model/NumberOnlyTest.java
|
||||
src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java
|
||||
src/test/java/org/openapitools/server/model/OrderTest.java
|
||||
src/test/java/org/openapitools/server/model/OuterCompositeTest.java
|
||||
src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java
|
||||
src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java
|
||||
src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java
|
||||
src/test/java/org/openapitools/server/model/OuterEnumTest.java
|
||||
src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java
|
||||
src/test/java/org/openapitools/server/model/PetTest.java
|
||||
src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java
|
||||
src/test/java/org/openapitools/server/model/SingleRefTypeTest.java
|
||||
src/test/java/org/openapitools/server/model/SpecialModelNameTest.java
|
||||
src/test/java/org/openapitools/server/model/TagTest.java
|
||||
src/test/java/org/openapitools/server/model/UserTest.java
|
@ -0,0 +1 @@
|
||||
6.0.0-SNAPSHOT
|
74
samples/server/petstore/helidon/se-default/README.md
Normal file
74
samples/server/petstore/helidon/se-default/README.md
Normal file
@ -0,0 +1,74 @@
|
||||
# Helidon SE Server with OpenAPI
|
||||
|
||||
## Build and run
|
||||
|
||||
With JDK11+
|
||||
```bash
|
||||
mvn package
|
||||
java -jar target/petstore-helidon-se-server.jar
|
||||
```
|
||||
|
||||
## Exercise the application
|
||||
|
||||
```
|
||||
curl -X PATCH http://petstore.swagger.io:80/v2/another-fake/dummy
|
||||
curl -X GET http://petstore.swagger.io:80/v2/foo
|
||||
curl -X GET http://petstore.swagger.io:80/v2/fake/health
|
||||
curl -X GET http://petstore.swagger.io:80/v2/fake/http-signature-test
|
||||
curl -X POST http://petstore.swagger.io:80/v2/fake/outer/boolean
|
||||
curl -X POST http://petstore.swagger.io:80/v2/fake/outer/composite
|
||||
curl -X POST http://petstore.swagger.io:80/v2/fake/outer/number
|
||||
curl -X POST http://petstore.swagger.io:80/v2/fake/outer/string
|
||||
curl -X POST http://petstore.swagger.io:80/v2/fake/property/enum-int
|
||||
curl -X PUT http://petstore.swagger.io:80/v2/fake/body-with-binary
|
||||
curl -X PUT http://petstore.swagger.io:80/v2/fake/body-with-file-schema
|
||||
curl -X PUT http://petstore.swagger.io:80/v2/fake/body-with-query-params
|
||||
curl -X PATCH http://petstore.swagger.io:80/v2/fake
|
||||
curl -X POST http://petstore.swagger.io:80/v2/fake
|
||||
curl -X GET http://petstore.swagger.io:80/v2/fake
|
||||
curl -X DELETE http://petstore.swagger.io:80/v2/fake
|
||||
curl -X POST http://petstore.swagger.io:80/v2/fake/inline-additionalProperties
|
||||
curl -X GET http://petstore.swagger.io:80/v2/fake/jsonFormData
|
||||
curl -X PUT http://petstore.swagger.io:80/v2/fake/test-query-parameters
|
||||
curl -X PATCH http://petstore.swagger.io:80/v2/fake_classname_test
|
||||
curl -X POST http://petstore.swagger.io:80/v2/pet
|
||||
curl -X DELETE http://petstore.swagger.io:80/v2/pet/{petId}
|
||||
curl -X GET http://petstore.swagger.io:80/v2/pet/findByStatus
|
||||
curl -X GET http://petstore.swagger.io:80/v2/pet/findByTags
|
||||
curl -X GET http://petstore.swagger.io:80/v2/pet/{petId}
|
||||
curl -X PUT http://petstore.swagger.io:80/v2/pet
|
||||
curl -X POST http://petstore.swagger.io:80/v2/pet/{petId}
|
||||
curl -X POST http://petstore.swagger.io:80/v2/pet/{petId}/uploadImage
|
||||
curl -X POST http://petstore.swagger.io:80/v2/fake/{petId}/uploadImageWithRequiredFile
|
||||
curl -X DELETE http://petstore.swagger.io:80/v2/store/order/{order_id}
|
||||
curl -X GET http://petstore.swagger.io:80/v2/store/inventory
|
||||
curl -X GET http://petstore.swagger.io:80/v2/store/order/{order_id}
|
||||
curl -X POST http://petstore.swagger.io:80/v2/store/order
|
||||
curl -X POST http://petstore.swagger.io:80/v2/user
|
||||
curl -X POST http://petstore.swagger.io:80/v2/user/createWithArray
|
||||
curl -X POST http://petstore.swagger.io:80/v2/user/createWithList
|
||||
curl -X DELETE http://petstore.swagger.io:80/v2/user/{username}
|
||||
curl -X GET http://petstore.swagger.io:80/v2/user/{username}
|
||||
curl -X GET http://petstore.swagger.io:80/v2/user/login
|
||||
curl -X GET http://petstore.swagger.io:80/v2/user/logout
|
||||
curl -X PUT http://petstore.swagger.io:80/v2/user/{username}
|
||||
|
||||
```
|
||||
|
||||
## Try health and metrics
|
||||
|
||||
```
|
||||
curl -s -X GET http://petstore.swagger.io:80/v2/health
|
||||
{"outcome":"UP",...
|
||||
. . .
|
||||
|
||||
# Prometheus Format
|
||||
curl -s -X GET http://petstore.swagger.io:80/v2/metrics
|
||||
# TYPE base:gc_g1_young_generation_count gauge
|
||||
. . .
|
||||
|
||||
# JSON Format
|
||||
curl -H 'Accept: application/json' -X GET http://petstore.swagger.io:80/v2/metrics
|
||||
{"base":...
|
||||
. . .
|
||||
```
|
77
samples/server/petstore/helidon/se-default/build.gradle
Normal file
77
samples/server/petstore/helidon/se-default/build.gradle
Normal file
@ -0,0 +1,77 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
}
|
||||
|
||||
group = 'org.openapitools'
|
||||
version = '1.0.0'
|
||||
|
||||
description = """This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\"""
|
||||
|
||||
|
||||
sourceCompatibility = 11
|
||||
targetCompatibility = 11
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.encoding = 'UTF-8'
|
||||
}
|
||||
|
||||
ext {
|
||||
helidonVersion = '2.5.2'
|
||||
mainClass='org.openapitools.server.Main'
|
||||
validationApiVersion = '2.0.1.Final'
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// import Helidon BOM
|
||||
implementation enforcedPlatform("io.helidon:helidon-dependencies:${project.helidonVersion}")
|
||||
implementation "javax.validation:validation-api:${project.validationApiVersion}"
|
||||
implementation 'io.helidon.webserver:helidon-webserver'
|
||||
implementation 'io.helidon.media:helidon-media-jsonp'
|
||||
implementation 'io.helidon.media:helidon-media-jackson'
|
||||
implementation 'io.helidon.media:helidon-media-multipart'
|
||||
implementation 'io.helidon.config:helidon-config-yaml'
|
||||
implementation 'io.helidon.health:helidon-health'
|
||||
implementation 'io.helidon.health:helidon-health-checks'
|
||||
implementation 'io.helidon.metrics:helidon-metrics'
|
||||
implementation 'io.helidon.openapi:helidon-openapi'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter-api'
|
||||
testImplementation 'io.helidon.webclient:helidon-webclient'
|
||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
|
||||
}
|
||||
|
||||
// define a custom task to copy all dependencies in the runtime classpath
|
||||
// into build/libs/libs
|
||||
// uses built-in Copy
|
||||
task copyLibs(type: Copy) {
|
||||
from configurations.runtimeClasspath
|
||||
into 'build/libs/libs'
|
||||
}
|
||||
|
||||
// add it as a dependency of built-in task 'assemble'
|
||||
copyLibs.dependsOn jar
|
||||
assemble.dependsOn copyLibs
|
||||
|
||||
// default jar configuration
|
||||
// set the main classpath
|
||||
// add each jar under build/libs/libs into the classpath
|
||||
jar {
|
||||
archiveFileName = "${project.name}.jar"
|
||||
manifest {
|
||||
attributes ('Main-Class': "${project.mainClass}",
|
||||
'Class-Path': configurations.runtimeClasspath.files.collect { "libs/$it.name" }.join(' ')
|
||||
)
|
||||
}
|
||||
}
|
||||
application {
|
||||
mainClass = "${project.mainClass}"
|
||||
}
|
99
samples/server/petstore/helidon/se-default/pom.xml
Normal file
99
samples/server/petstore/helidon/se-default/pom.xml
Normal file
@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>io.helidon.applications</groupId>
|
||||
<artifactId>helidon-se</artifactId>
|
||||
<version>2.5.2</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>petstore-helidon-se-server</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<name>petstore-helidon-se-server</name>
|
||||
<description>This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\</description>
|
||||
|
||||
<properties>
|
||||
<mainClass>org.openapitools.server.Main</mainClass>
|
||||
<version.validation.api>2.0.1.Final</version.validation.api>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
<version>${version.validation.api}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.helidon.webserver</groupId>
|
||||
<artifactId>helidon-webserver</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.helidon.media</groupId>
|
||||
<artifactId>helidon-media-jsonp</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.helidon.media</groupId>
|
||||
<artifactId>helidon-media-multipart</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.helidon.config</groupId>
|
||||
<artifactId>helidon-config-yaml</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.helidon.health</groupId>
|
||||
<artifactId>helidon-health</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.helidon.health</groupId>
|
||||
<artifactId>helidon-health-checks</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.helidon.metrics</groupId>
|
||||
<artifactId>helidon-metrics</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.helidon.openapi</groupId>
|
||||
<artifactId>helidon-openapi</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.helidon.media</groupId>
|
||||
<artifactId>helidon-media-jackson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.helidon.webclient</groupId>
|
||||
<artifactId>helidon-webclient</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-libs</id>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>io.helidon.build-tools</groupId>
|
||||
<artifactId>helidon-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>third-party-license-report</id>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1 @@
|
||||
rootProject.name = 'petstore-helidon-se-server'
|
@ -0,0 +1,89 @@
|
||||
package org.openapitools.server;
|
||||
|
||||
|
||||
import io.helidon.common.LogConfig;
|
||||
import io.helidon.common.reactive.Single;
|
||||
import io.helidon.config.Config;
|
||||
import io.helidon.health.HealthSupport;
|
||||
import io.helidon.health.checks.HealthChecks;
|
||||
import io.helidon.media.jsonp.JsonpSupport;
|
||||
import io.helidon.media.jackson.JacksonSupport;
|
||||
import org.openapitools.server.api.JsonProvider;
|
||||
import io.helidon.metrics.MetricsSupport;
|
||||
import io.helidon.openapi.OpenAPISupport;
|
||||
import io.helidon.webserver.Routing;
|
||||
import io.helidon.webserver.WebServer;
|
||||
|
||||
/**
|
||||
* The application main class.
|
||||
*/
|
||||
public final class Main {
|
||||
|
||||
/**
|
||||
* Cannot be instantiated.
|
||||
*/
|
||||
private Main() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Application main entry point.
|
||||
* @param args command line arguments.
|
||||
*/
|
||||
public static void main(final String[] args) {
|
||||
startServer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the server.
|
||||
* @return the created {@link WebServer} instance
|
||||
*/
|
||||
static Single<WebServer> startServer() {
|
||||
|
||||
// load logging configuration
|
||||
LogConfig.configureRuntime();
|
||||
|
||||
// By default this will pick up application.yaml from the classpath
|
||||
Config config = Config.create();
|
||||
|
||||
WebServer server = WebServer.builder(createRouting(config))
|
||||
.config(config.get("server"))
|
||||
.addMediaSupport(JsonpSupport.create())
|
||||
.addMediaSupport(JacksonSupport.create(JsonProvider.objectMapper()))
|
||||
.build();
|
||||
|
||||
Single<WebServer> webserver = server.start();
|
||||
|
||||
// Try to start the server. If successful, print some info and arrange to
|
||||
// print a message at shutdown. If unsuccessful, print the exception.
|
||||
webserver.thenAccept(ws -> {
|
||||
System.out.println("WEB server is up! http://petstore.swagger.io:80/v2");
|
||||
ws.whenShutdown().thenRun(() -> System.out.println("WEB server is DOWN. Good bye!"));
|
||||
})
|
||||
.exceptionallyAccept(t -> {
|
||||
System.err.println("Startup failed: " + t.getMessage());
|
||||
t.printStackTrace(System.err);
|
||||
});
|
||||
|
||||
return webserver;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new {@link Routing}.
|
||||
*
|
||||
* @return routing configured with JSON support, a health check, and a service
|
||||
* @param config configuration of this server
|
||||
*/
|
||||
private static Routing createRouting(Config config) {
|
||||
|
||||
MetricsSupport metrics = MetricsSupport.create();
|
||||
HealthSupport health = HealthSupport.builder()
|
||||
.addLiveness(HealthChecks.healthChecks()) // Adds a convenient set of checks
|
||||
.build();
|
||||
|
||||
return Routing.builder()
|
||||
.register(OpenAPISupport.create(config.get(OpenAPISupport.Builder.CONFIG_KEY)))
|
||||
.register(health) // Health at "/health"
|
||||
.register(metrics) // Metrics at "/metrics"
|
||||
.build();
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.server;
|
||||
|
||||
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.FieldPosition;
|
||||
import java.text.ParsePosition;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.TimeZone;
|
||||
|
||||
public class RFC3339DateFormat extends DateFormat {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||
|
||||
private final StdDateFormat fmt = new StdDateFormat()
|
||||
.withTimeZone(TIMEZONE_Z)
|
||||
.withColonInTimeZone(true);
|
||||
|
||||
public RFC3339DateFormat() {
|
||||
this.calendar = new GregorianCalendar();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date parse(String source, ParsePosition pos) {
|
||||
return fmt.parse(source, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||
return fmt.format(date, toAppendTo, fieldPosition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
return this;
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package org.openapitools.server.api;
|
||||
|
||||
import org.openapitools.server.model.Client;
|
||||
import io.helidon.webserver.Handler;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import io.helidon.common.GenericType;
|
||||
import io.helidon.common.reactive.Single;
|
||||
import io.helidon.config.Config;
|
||||
import io.helidon.webserver.Routing;
|
||||
import io.helidon.webserver.ServerRequest;
|
||||
import io.helidon.webserver.ServerResponse;
|
||||
import io.helidon.webserver.Service;
|
||||
|
||||
|
||||
public abstract class AnotherFakeService implements Service {
|
||||
|
||||
protected static final Logger LOGGER = Logger.getLogger(AnotherFakeService.class.getName());
|
||||
private static final ObjectMapper MAPPER = JsonProvider.objectMapper();
|
||||
|
||||
protected final Config config;
|
||||
|
||||
public AnotherFakeService(Config config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
/**
|
||||
* A service registers itself by updating the routing rules.
|
||||
* @param rules the routing rules.
|
||||
*/
|
||||
@Override
|
||||
public void update(Routing.Rules rules) {
|
||||
rules.patch("/another-fake/dummy", Handler.create(Client.class, this::call123testSpecialTags));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PATCH /another-fake/dummy : To test special tags.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param client client model
|
||||
*/
|
||||
void call123testSpecialTags(ServerRequest request, ServerResponse response, Client client) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
ValidatorUtils.checkNonNull(client);
|
||||
|
||||
handleCall123testSpecialTags(request, response, client);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle PATCH /another-fake/dummy : To test special tags.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param client client model
|
||||
*/
|
||||
abstract void handleCall123testSpecialTags(ServerRequest request, ServerResponse response, Client client);
|
||||
|
||||
|
||||
abstract Void handleError(ServerRequest request, ServerResponse response, Throwable throwable);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package org.openapitools.server.api;
|
||||
|
||||
import org.openapitools.server.model.FooGetDefaultResponse;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import io.helidon.common.GenericType;
|
||||
import io.helidon.common.reactive.Single;
|
||||
import io.helidon.config.Config;
|
||||
import io.helidon.webserver.Routing;
|
||||
import io.helidon.webserver.ServerRequest;
|
||||
import io.helidon.webserver.ServerResponse;
|
||||
import io.helidon.webserver.Service;
|
||||
|
||||
|
||||
public abstract class DefaultService implements Service {
|
||||
|
||||
protected static final Logger LOGGER = Logger.getLogger(DefaultService.class.getName());
|
||||
private static final ObjectMapper MAPPER = JsonProvider.objectMapper();
|
||||
|
||||
protected final Config config;
|
||||
|
||||
public DefaultService(Config config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
/**
|
||||
* A service registers itself by updating the routing rules.
|
||||
* @param rules the routing rules.
|
||||
*/
|
||||
@Override
|
||||
public void update(Routing.Rules rules) {
|
||||
rules.get("/foo", this::fooGet);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* GET /foo.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void fooGet(ServerRequest request, ServerResponse response) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
|
||||
handleFooGet(request, response);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle GET /foo.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
abstract void handleFooGet(ServerRequest request, ServerResponse response);
|
||||
|
||||
|
||||
abstract Void handleError(ServerRequest request, ServerResponse response, Throwable throwable);
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package org.openapitools.server.api;
|
||||
|
||||
import org.openapitools.server.model.Client;
|
||||
import io.helidon.webserver.Handler;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import io.helidon.common.GenericType;
|
||||
import io.helidon.common.reactive.Single;
|
||||
import io.helidon.config.Config;
|
||||
import io.helidon.webserver.Routing;
|
||||
import io.helidon.webserver.ServerRequest;
|
||||
import io.helidon.webserver.ServerResponse;
|
||||
import io.helidon.webserver.Service;
|
||||
|
||||
|
||||
public abstract class FakeClassnameTags123Service implements Service {
|
||||
|
||||
protected static final Logger LOGGER = Logger.getLogger(FakeClassnameTags123Service.class.getName());
|
||||
private static final ObjectMapper MAPPER = JsonProvider.objectMapper();
|
||||
|
||||
protected final Config config;
|
||||
|
||||
public FakeClassnameTags123Service(Config config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
/**
|
||||
* A service registers itself by updating the routing rules.
|
||||
* @param rules the routing rules.
|
||||
*/
|
||||
@Override
|
||||
public void update(Routing.Rules rules) {
|
||||
rules.patch("/fake_classname_test", Handler.create(Client.class, this::testClassname));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PATCH /fake_classname_test : To test class name in snake case.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param client client model
|
||||
*/
|
||||
void testClassname(ServerRequest request, ServerResponse response, Client client) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
ValidatorUtils.checkNonNull(client);
|
||||
|
||||
handleTestClassname(request, response, client);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle PATCH /fake_classname_test : To test class name in snake case.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param client client model
|
||||
*/
|
||||
abstract void handleTestClassname(ServerRequest request, ServerResponse response, Client client);
|
||||
|
||||
|
||||
abstract Void handleError(ServerRequest request, ServerResponse response, Throwable throwable);
|
||||
}
|
@ -0,0 +1,668 @@
|
||||
package org.openapitools.server.api;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import org.openapitools.server.model.Client;
|
||||
import io.helidon.common.http.DataChunk;
|
||||
import org.openapitools.server.model.EnumClass;
|
||||
import java.io.File;
|
||||
import org.openapitools.server.model.FileSchemaTestClass;
|
||||
import io.helidon.webserver.Handler;
|
||||
import java.util.HashMap;
|
||||
import org.openapitools.server.model.HealthCheckResult;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Map;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.openapitools.server.model.OuterComposite;
|
||||
import org.openapitools.server.model.OuterObjectWithEnumProperty;
|
||||
import org.openapitools.server.model.Pet;
|
||||
import io.helidon.media.multipart.ReadableBodyPart;
|
||||
import java.io.UncheckedIOException;
|
||||
import org.openapitools.server.model.User;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import io.helidon.common.GenericType;
|
||||
import io.helidon.common.reactive.Single;
|
||||
import io.helidon.config.Config;
|
||||
import io.helidon.webserver.Routing;
|
||||
import io.helidon.webserver.ServerRequest;
|
||||
import io.helidon.webserver.ServerResponse;
|
||||
import io.helidon.webserver.Service;
|
||||
|
||||
|
||||
public abstract class FakeService implements Service {
|
||||
|
||||
protected static final Logger LOGGER = Logger.getLogger(FakeService.class.getName());
|
||||
private static final ObjectMapper MAPPER = JsonProvider.objectMapper();
|
||||
|
||||
protected final Config config;
|
||||
|
||||
public FakeService(Config config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
/**
|
||||
* A service registers itself by updating the routing rules.
|
||||
* @param rules the routing rules.
|
||||
*/
|
||||
@Override
|
||||
public void update(Routing.Rules rules) {
|
||||
rules.get("/fake/health", this::fakeHealthGet);
|
||||
rules.get("/fake/http-signature-test", Handler.create(Pet.class, this::fakeHttpSignatureTest));
|
||||
rules.post("/fake/outer/boolean", this::fakeOuterBooleanSerialize);
|
||||
rules.post("/fake/outer/composite", Handler.create(OuterComposite.class, this::fakeOuterCompositeSerialize));
|
||||
rules.post("/fake/outer/number", this::fakeOuterNumberSerialize);
|
||||
rules.post("/fake/outer/string", this::fakeOuterStringSerialize);
|
||||
rules.post("/fake/property/enum-int", Handler.create(OuterObjectWithEnumProperty.class, this::fakePropertyEnumIntegerSerialize));
|
||||
rules.put("/fake/body-with-binary", this::testBodyWithBinary);
|
||||
rules.put("/fake/body-with-file-schema", Handler.create(FileSchemaTestClass.class, this::testBodyWithFileSchema));
|
||||
rules.put("/fake/body-with-query-params", Handler.create(User.class, this::testBodyWithQueryParams));
|
||||
rules.patch("/fake", Handler.create(Client.class, this::testClientModel));
|
||||
rules.post("/fake", this::testEndpointParameters);
|
||||
rules.get("/fake", this::testEnumParameters);
|
||||
rules.delete("/fake", this::testGroupParameters);
|
||||
rules.post("/fake/inline-additionalProperties", this::testInlineAdditionalProperties);
|
||||
rules.get("/fake/jsonFormData", this::testJsonFormData);
|
||||
rules.put("/fake/test-query-parameters", this::testQueryParameterCollectionFormat);
|
||||
}
|
||||
|
||||
|
||||
private void processNonFileFormField(String name, Map<String, List<String>> nonFileFormContent, ReadableBodyPart part) {
|
||||
List<String> content = nonFileFormContent.computeIfAbsent(name, key -> new ArrayList<>());
|
||||
part.content().as(String.class).thenAccept(content::add);
|
||||
}
|
||||
|
||||
private void processFileFormField(String name, Map<String, List<InputStream>> fileFormContent, ReadableBodyPart part) {
|
||||
List<InputStream> content = fileFormContent.computeIfAbsent(name, key -> new ArrayList<>());
|
||||
part.content().map(DataChunk::bytes)
|
||||
.collect(ByteArrayOutputStream::new, (stream, bytes) -> {
|
||||
try {
|
||||
stream.write(bytes);
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
})
|
||||
.thenAccept(byteStream -> content.add(new ByteArrayInputStream(byteStream.toByteArray())));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* GET /fake/health : Health check endpoint.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void fakeHealthGet(ServerRequest request, ServerResponse response) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
|
||||
handleFakeHealthGet(request, response);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle GET /fake/health : Health check endpoint.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
abstract void handleFakeHealthGet(ServerRequest request, ServerResponse response);
|
||||
|
||||
|
||||
/**
|
||||
* GET /fake/http-signature-test : test http signature authentication.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
void fakeHttpSignatureTest(ServerRequest request, ServerResponse response, Pet pet) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
ValidatorUtils.checkNonNull(pet);
|
||||
String query1 = request.queryParams().toMap().getOrDefault("query_1", List.of()).stream().findFirst().orElse(null);
|
||||
String header1 = request.headers().value("header_1").orElse(null);
|
||||
|
||||
handleFakeHttpSignatureTest(request, response, pet, query1, header1);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle GET /fake/http-signature-test : test http signature authentication.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
* @param query1 query parameter
|
||||
* @param header1 header parameter
|
||||
*/
|
||||
abstract void handleFakeHttpSignatureTest(ServerRequest request, ServerResponse response, Pet pet, String query1, String header1);
|
||||
|
||||
|
||||
/**
|
||||
* POST /fake/outer/boolean.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void fakeOuterBooleanSerialize(ServerRequest request, ServerResponse response) {
|
||||
Single.create(request.content().as(new GenericType<Boolean>() { }))
|
||||
.thenAccept(body -> {
|
||||
ValidatorUtils.checkNonNull(body);
|
||||
|
||||
handleFakeOuterBooleanSerialize(request, response, body);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle POST /fake/outer/boolean.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param body Input boolean as post body
|
||||
*/
|
||||
abstract void handleFakeOuterBooleanSerialize(ServerRequest request, ServerResponse response, Boolean body);
|
||||
|
||||
|
||||
/**
|
||||
* POST /fake/outer/composite.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param outerComposite Input composite as post body
|
||||
*/
|
||||
void fakeOuterCompositeSerialize(ServerRequest request, ServerResponse response, OuterComposite outerComposite) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
ValidatorUtils.checkNonNull(outerComposite);
|
||||
|
||||
handleFakeOuterCompositeSerialize(request, response, outerComposite);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle POST /fake/outer/composite.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param outerComposite Input composite as post body
|
||||
*/
|
||||
abstract void handleFakeOuterCompositeSerialize(ServerRequest request, ServerResponse response, OuterComposite outerComposite);
|
||||
|
||||
|
||||
/**
|
||||
* POST /fake/outer/number.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void fakeOuterNumberSerialize(ServerRequest request, ServerResponse response) {
|
||||
Single.create(request.content().as(new GenericType<BigDecimal>() { }))
|
||||
.thenAccept(body -> {
|
||||
ValidatorUtils.checkNonNull(body);
|
||||
|
||||
handleFakeOuterNumberSerialize(request, response, body);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle POST /fake/outer/number.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param body Input number as post body
|
||||
*/
|
||||
abstract void handleFakeOuterNumberSerialize(ServerRequest request, ServerResponse response, BigDecimal body);
|
||||
|
||||
|
||||
/**
|
||||
* POST /fake/outer/string.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void fakeOuterStringSerialize(ServerRequest request, ServerResponse response) {
|
||||
Single.create(request.content().as(new GenericType<String>() { }))
|
||||
.thenAccept(body -> {
|
||||
ValidatorUtils.checkNonNull(body);
|
||||
|
||||
handleFakeOuterStringSerialize(request, response, body);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle POST /fake/outer/string.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param body Input string as post body
|
||||
*/
|
||||
abstract void handleFakeOuterStringSerialize(ServerRequest request, ServerResponse response, String body);
|
||||
|
||||
|
||||
/**
|
||||
* POST /fake/property/enum-int.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param outerObjectWithEnumProperty Input enum (int) as post body
|
||||
*/
|
||||
void fakePropertyEnumIntegerSerialize(ServerRequest request, ServerResponse response, OuterObjectWithEnumProperty outerObjectWithEnumProperty) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
ValidatorUtils.checkNonNull(outerObjectWithEnumProperty);
|
||||
|
||||
handleFakePropertyEnumIntegerSerialize(request, response, outerObjectWithEnumProperty);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle POST /fake/property/enum-int.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param outerObjectWithEnumProperty Input enum (int) as post body
|
||||
*/
|
||||
abstract void handleFakePropertyEnumIntegerSerialize(ServerRequest request, ServerResponse response, OuterObjectWithEnumProperty outerObjectWithEnumProperty);
|
||||
|
||||
|
||||
/**
|
||||
* PUT /fake/body-with-binary.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void testBodyWithBinary(ServerRequest request, ServerResponse response) {
|
||||
Single.create(request.content().as(new GenericType<File>() { }))
|
||||
.thenAccept(body -> {
|
||||
ValidatorUtils.checkNonNull(body);
|
||||
|
||||
handleTestBodyWithBinary(request, response, body);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle PUT /fake/body-with-binary.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param body image to upload
|
||||
*/
|
||||
abstract void handleTestBodyWithBinary(ServerRequest request, ServerResponse response, InputStream body);
|
||||
|
||||
|
||||
/**
|
||||
* PUT /fake/body-with-file-schema.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param fileSchemaTestClass fileSchemaTestClass
|
||||
*/
|
||||
void testBodyWithFileSchema(ServerRequest request, ServerResponse response, FileSchemaTestClass fileSchemaTestClass) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
ValidatorUtils.checkNonNull(fileSchemaTestClass);
|
||||
|
||||
handleTestBodyWithFileSchema(request, response, fileSchemaTestClass);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle PUT /fake/body-with-file-schema.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param fileSchemaTestClass fileSchemaTestClass
|
||||
*/
|
||||
abstract void handleTestBodyWithFileSchema(ServerRequest request, ServerResponse response, FileSchemaTestClass fileSchemaTestClass);
|
||||
|
||||
|
||||
/**
|
||||
* PUT /fake/body-with-query-params.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param user user
|
||||
*/
|
||||
void testBodyWithQueryParams(ServerRequest request, ServerResponse response, User user) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
String query = request.queryParams().toMap().getOrDefault("query", List.of()).stream().findFirst().orElse(null);
|
||||
ValidatorUtils.checkNonNull(query);
|
||||
ValidatorUtils.checkNonNull(user);
|
||||
|
||||
handleTestBodyWithQueryParams(request, response, query, user);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle PUT /fake/body-with-query-params.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param query query
|
||||
* @param user user
|
||||
*/
|
||||
abstract void handleTestBodyWithQueryParams(ServerRequest request, ServerResponse response, String query, User user);
|
||||
|
||||
|
||||
/**
|
||||
* PATCH /fake : To test \"client\" model.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param client client model
|
||||
*/
|
||||
void testClientModel(ServerRequest request, ServerResponse response, Client client) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
ValidatorUtils.checkNonNull(client);
|
||||
|
||||
handleTestClientModel(request, response, client);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle PATCH /fake : To test \"client\" model.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param client client model
|
||||
*/
|
||||
abstract void handleTestClientModel(ServerRequest request, ServerResponse response, Client client);
|
||||
|
||||
|
||||
/**
|
||||
* POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 .
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void testEndpointParameters(ServerRequest request, ServerResponse response) {
|
||||
Map<String, List<String>> nonFileFormContent = new HashMap<>();
|
||||
Map<String, List<InputStream>> fileFormContent = new HashMap<>();
|
||||
Single<Void> formSingle = request.content().asStream(ReadableBodyPart.class)
|
||||
.forEach(part -> {
|
||||
String name = part.name();
|
||||
if ("integer".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
if ("int32".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
if ("int64".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
if ("number".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
if ("float".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
if ("double".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
if ("string".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
if ("pattern_without_delimiter".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
if ("byte".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
if ("binary".equals(name)) {
|
||||
processFileFormField(name, fileFormContent, part);
|
||||
}
|
||||
if ("date".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
if ("dateTime".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
if ("password".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
if ("callback".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
part.drain();
|
||||
});
|
||||
Single.create(formSingle)
|
||||
.thenAccept(val -> {
|
||||
BigDecimal number = Optional.ofNullable(nonFileFormContent.get("number")).flatMap(list->list.stream().findFirst()).map(BigDecimal::new).orElse(null);
|
||||
ValidatorUtils.checkNonNull(number);
|
||||
ValidatorUtils.validateMin(number, "32.1", true);
|
||||
ValidatorUtils.validateMax(number, "543.2", true);
|
||||
Double _double = Optional.ofNullable(nonFileFormContent.get("double")).flatMap(list->list.stream().findFirst()).map(Double::valueOf).orElse(null);
|
||||
ValidatorUtils.checkNonNull(_double);
|
||||
ValidatorUtils.validateMin(_double, "67.8", true);
|
||||
ValidatorUtils.validateMax(_double, "123.4", true);
|
||||
String patternWithoutDelimiter = Optional.ofNullable(nonFileFormContent.get("pattern_without_delimiter")).flatMap(list->list.stream().findFirst()).orElse(null);
|
||||
ValidatorUtils.checkNonNull(patternWithoutDelimiter);
|
||||
ValidatorUtils.validatePattern(patternWithoutDelimiter, "^[A-Z].*");
|
||||
byte[] _byte = Optional.ofNullable(nonFileFormContent.get("byte")).flatMap(list->list.stream().findFirst()).map(byte[]::valueOf).orElse(null);
|
||||
ValidatorUtils.checkNonNull(_byte);
|
||||
Integer integer = Optional.ofNullable(nonFileFormContent.get("integer")).flatMap(list->list.stream().findFirst()).map(Integer::valueOf).orElse(null);
|
||||
ValidatorUtils.validateMin(integer, 10);
|
||||
ValidatorUtils.validateMax(integer, 100);
|
||||
Integer int32 = Optional.ofNullable(nonFileFormContent.get("int32")).flatMap(list->list.stream().findFirst()).map(Integer::valueOf).orElse(null);
|
||||
ValidatorUtils.validateMin(int32, 20);
|
||||
ValidatorUtils.validateMax(int32, 200);
|
||||
Long int64 = Optional.ofNullable(nonFileFormContent.get("int64")).flatMap(list->list.stream().findFirst()).map(Long::valueOf).orElse(null);
|
||||
Float _float = Optional.ofNullable(nonFileFormContent.get("float")).flatMap(list->list.stream().findFirst()).map(Float::valueOf).orElse(null);
|
||||
ValidatorUtils.validateMax(_float, "987.6", true);
|
||||
String string = Optional.ofNullable(nonFileFormContent.get("string")).flatMap(list->list.stream().findFirst()).orElse(null);
|
||||
ValidatorUtils.validatePattern(string, "/[a-z]/i");
|
||||
InputStream binary = Optional.ofNullable(fileFormContent.get("binary")).flatMap(list->list.stream().findFirst()).orElse(null);
|
||||
LocalDate date = Optional.ofNullable(nonFileFormContent.get("date")).flatMap(list->list.stream().findFirst()).map(LocalDate::parse).orElse(null);
|
||||
OffsetDateTime dateTime = Optional.ofNullable(nonFileFormContent.get("dateTime")).flatMap(list->list.stream().findFirst()).map(OffsetDateTime::parse).orElse(null);
|
||||
String password = Optional.ofNullable(nonFileFormContent.get("password")).flatMap(list->list.stream().findFirst()).orElse(null);
|
||||
ValidatorUtils.validateSize(password, 10, 64);
|
||||
String paramCallback = Optional.ofNullable(nonFileFormContent.get("callback")).flatMap(list->list.stream().findFirst()).orElse(null);
|
||||
|
||||
handleTestEndpointParameters(request, response, number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 .
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param number None
|
||||
* @param _double None
|
||||
* @param patternWithoutDelimiter None
|
||||
* @param _byte None
|
||||
* @param integer None
|
||||
* @param int32 None
|
||||
* @param int64 None
|
||||
* @param _float None
|
||||
* @param string None
|
||||
* @param binary None
|
||||
* @param date None
|
||||
* @param dateTime None
|
||||
* @param password None
|
||||
* @param paramCallback None
|
||||
*/
|
||||
abstract void handleTestEndpointParameters(ServerRequest request, ServerResponse response, BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, InputStream binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback);
|
||||
|
||||
|
||||
/**
|
||||
* GET /fake : To test enum parameters.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void testEnumParameters(ServerRequest request, ServerResponse response) {
|
||||
Map<String, List<String>> nonFileFormContent = new HashMap<>();
|
||||
Map<String, List<InputStream>> fileFormContent = new HashMap<>();
|
||||
Single<Void> formSingle = request.content().asStream(ReadableBodyPart.class)
|
||||
.forEach(part -> {
|
||||
String name = part.name();
|
||||
if ("enum_form_string_array".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
if ("enum_form_string".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
part.drain();
|
||||
});
|
||||
Single.create(formSingle)
|
||||
.thenAccept(val -> {
|
||||
List<String> enumHeaderStringArray = request.headers().value("enum_header_string_array").orElse(null);
|
||||
String enumHeaderString = request.headers().value("enum_header_string").orElse(null);
|
||||
List<String> enumQueryStringArray = Optional.ofNullable(request.queryParams().toMap().get("enum_query_string_array")).orElse(null);
|
||||
String enumQueryString = request.queryParams().toMap().getOrDefault("enum_query_string", List.of()).stream().findFirst().orElse(null);
|
||||
Integer enumQueryInteger = request.queryParams().toMap().getOrDefault("enum_query_integer", List.of()).stream().findFirst().map(Integer::valueOf).orElse(null);
|
||||
Double enumQueryDouble = request.queryParams().toMap().getOrDefault("enum_query_double", List.of()).stream().findFirst().map(Double::valueOf).orElse(null);
|
||||
List<String> enumQueryModelArray = Optional.ofNullable(request.queryParams().toMap().get("enum_query_model_array")).orElse(null);
|
||||
List<String> enumFormStringArray = Optional.ofNullable(nonFileFormContent.get("enum_form_string_array")).orElse(null);
|
||||
String enumFormString = Optional.ofNullable(nonFileFormContent.get("enum_form_string")).flatMap(list->list.stream().findFirst()).orElse(null);
|
||||
|
||||
handleTestEnumParameters(request, response, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle GET /fake : To test enum parameters.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param enumHeaderStringArray Header parameter enum test (string array)
|
||||
* @param enumHeaderString Header parameter enum test (string)
|
||||
* @param enumQueryStringArray Query parameter enum test (string array)
|
||||
* @param enumQueryString Query parameter enum test (string)
|
||||
* @param enumQueryInteger Query parameter enum test (double)
|
||||
* @param enumQueryDouble Query parameter enum test (double)
|
||||
* @param enumQueryModelArray enumQueryModelArray
|
||||
* @param enumFormStringArray Form parameter enum test (string array)
|
||||
* @param enumFormString Form parameter enum test (string)
|
||||
*/
|
||||
abstract void handleTestEnumParameters(ServerRequest request, ServerResponse response, List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List<String> enumQueryModelArray, List<String> enumFormStringArray, String enumFormString);
|
||||
|
||||
|
||||
/**
|
||||
* DELETE /fake : Fake endpoint to test group parameters (optional).
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void testGroupParameters(ServerRequest request, ServerResponse response) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
Integer requiredStringGroup = request.queryParams().toMap().getOrDefault("required_string_group", List.of()).stream().findFirst().map(Integer::valueOf).orElse(null);
|
||||
ValidatorUtils.checkNonNull(requiredStringGroup);
|
||||
Boolean requiredBooleanGroup = request.headers().value("required_boolean_group").map(Boolean::valueOf).orElse(null);
|
||||
ValidatorUtils.checkNonNull(requiredBooleanGroup);
|
||||
Long requiredInt64Group = request.queryParams().toMap().getOrDefault("required_int64_group", List.of()).stream().findFirst().map(Long::valueOf).orElse(null);
|
||||
ValidatorUtils.checkNonNull(requiredInt64Group);
|
||||
Integer stringGroup = request.queryParams().toMap().getOrDefault("string_group", List.of()).stream().findFirst().map(Integer::valueOf).orElse(null);
|
||||
Boolean booleanGroup = request.headers().value("boolean_group").map(Boolean::valueOf).orElse(null);
|
||||
Long int64Group = request.queryParams().toMap().getOrDefault("int64_group", List.of()).stream().findFirst().map(Long::valueOf).orElse(null);
|
||||
|
||||
handleTestGroupParameters(request, response, requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle DELETE /fake : Fake endpoint to test group parameters (optional).
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param requiredStringGroup Required String in group parameters
|
||||
* @param requiredBooleanGroup Required Boolean in group parameters
|
||||
* @param requiredInt64Group Required Integer in group parameters
|
||||
* @param stringGroup String in group parameters
|
||||
* @param booleanGroup Boolean in group parameters
|
||||
* @param int64Group Integer in group parameters
|
||||
*/
|
||||
abstract void handleTestGroupParameters(ServerRequest request, ServerResponse response, Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group);
|
||||
|
||||
|
||||
/**
|
||||
* POST /fake/inline-additionalProperties : test inline additionalProperties.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void testInlineAdditionalProperties(ServerRequest request, ServerResponse response) {
|
||||
Single.create(request.content().as(new GenericType<Map<String, String>>() { }))
|
||||
.thenAccept(requestBody -> {
|
||||
ValidatorUtils.checkNonNull(requestBody);
|
||||
|
||||
handleTestInlineAdditionalProperties(request, response, requestBody);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle POST /fake/inline-additionalProperties : test inline additionalProperties.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param requestBody request body
|
||||
*/
|
||||
abstract void handleTestInlineAdditionalProperties(ServerRequest request, ServerResponse response, String requestBody);
|
||||
|
||||
|
||||
/**
|
||||
* GET /fake/jsonFormData : test json serialization of form data.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void testJsonFormData(ServerRequest request, ServerResponse response) {
|
||||
Map<String, List<String>> nonFileFormContent = new HashMap<>();
|
||||
Map<String, List<InputStream>> fileFormContent = new HashMap<>();
|
||||
Single<Void> formSingle = request.content().asStream(ReadableBodyPart.class)
|
||||
.forEach(part -> {
|
||||
String name = part.name();
|
||||
if ("param".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
if ("param2".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
part.drain();
|
||||
});
|
||||
Single.create(formSingle)
|
||||
.thenAccept(val -> {
|
||||
String param = Optional.ofNullable(nonFileFormContent.get("param")).flatMap(list->list.stream().findFirst()).orElse(null);
|
||||
ValidatorUtils.checkNonNull(param);
|
||||
String param2 = Optional.ofNullable(nonFileFormContent.get("param2")).flatMap(list->list.stream().findFirst()).orElse(null);
|
||||
ValidatorUtils.checkNonNull(param2);
|
||||
|
||||
handleTestJsonFormData(request, response, param, param2);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle GET /fake/jsonFormData : test json serialization of form data.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param param field1
|
||||
* @param param2 field2
|
||||
*/
|
||||
abstract void handleTestJsonFormData(ServerRequest request, ServerResponse response, String param, String param2);
|
||||
|
||||
|
||||
/**
|
||||
* PUT /fake/test-query-parameters.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void testQueryParameterCollectionFormat(ServerRequest request, ServerResponse response) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
List<String> pipe = Optional.ofNullable(request.queryParams().toMap().get("pipe")).orElse(null);
|
||||
ValidatorUtils.checkNonNull(pipe);
|
||||
List<String> ioutil = Optional.ofNullable(request.queryParams().toMap().get("ioutil")).orElse(null);
|
||||
ValidatorUtils.checkNonNull(ioutil);
|
||||
List<String> http = Optional.ofNullable(request.queryParams().toMap().get("http")).orElse(null);
|
||||
ValidatorUtils.checkNonNull(http);
|
||||
List<String> url = Optional.ofNullable(request.queryParams().toMap().get("url")).orElse(null);
|
||||
ValidatorUtils.checkNonNull(url);
|
||||
List<String> context = Optional.ofNullable(request.queryParams().toMap().get("context")).orElse(null);
|
||||
ValidatorUtils.checkNonNull(context);
|
||||
String allowEmpty = request.queryParams().toMap().getOrDefault("allowEmpty", List.of()).stream().findFirst().orElse(null);
|
||||
ValidatorUtils.checkNonNull(allowEmpty);
|
||||
String language = Optional.ofNullable(request.queryParams().toMap().get("language")).orElse(null);
|
||||
|
||||
handleTestQueryParameterCollectionFormat(request, response, pipe, ioutil, http, url, context, allowEmpty, language);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle PUT /fake/test-query-parameters.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param pipe pipe
|
||||
* @param ioutil ioutil
|
||||
* @param http http
|
||||
* @param url url
|
||||
* @param context context
|
||||
* @param allowEmpty allowEmpty
|
||||
* @param language language
|
||||
*/
|
||||
abstract void handleTestQueryParameterCollectionFormat(ServerRequest request, ServerResponse response, List<String> pipe, List<String> ioutil, List<String> http, List<String> url, List<String> context, String allowEmpty, String language);
|
||||
|
||||
|
||||
abstract Void handleError(ServerRequest request, ServerResponse response, Throwable throwable);
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package org.openapitools.server.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
|
||||
public class JsonProvider {
|
||||
|
||||
public static ObjectMapper objectMapper() {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.registerModule(new JavaTimeModule());
|
||||
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
||||
mapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
|
||||
mapper.configure(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE, false);
|
||||
return mapper;
|
||||
}
|
||||
}
|
@ -0,0 +1,352 @@
|
||||
package org.openapitools.server.api;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import io.helidon.common.http.DataChunk;
|
||||
import java.io.File;
|
||||
import io.helidon.webserver.Handler;
|
||||
import java.util.HashMap;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.openapitools.server.model.ModelApiResponse;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.openapitools.server.model.Pet;
|
||||
import io.helidon.media.multipart.ReadableBodyPart;
|
||||
import java.util.Set;
|
||||
import java.io.UncheckedIOException;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import io.helidon.common.GenericType;
|
||||
import io.helidon.common.reactive.Single;
|
||||
import io.helidon.config.Config;
|
||||
import io.helidon.webserver.Routing;
|
||||
import io.helidon.webserver.ServerRequest;
|
||||
import io.helidon.webserver.ServerResponse;
|
||||
import io.helidon.webserver.Service;
|
||||
|
||||
|
||||
public abstract class PetService implements Service {
|
||||
|
||||
protected static final Logger LOGGER = Logger.getLogger(PetService.class.getName());
|
||||
private static final ObjectMapper MAPPER = JsonProvider.objectMapper();
|
||||
|
||||
protected final Config config;
|
||||
|
||||
public PetService(Config config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
/**
|
||||
* A service registers itself by updating the routing rules.
|
||||
* @param rules the routing rules.
|
||||
*/
|
||||
@Override
|
||||
public void update(Routing.Rules rules) {
|
||||
rules.post("/pet", Handler.create(Pet.class, this::addPet));
|
||||
rules.delete("/pet/{petId}", this::deletePet);
|
||||
rules.get("/pet/findByStatus", this::findPetsByStatus);
|
||||
rules.get("/pet/findByTags", this::findPetsByTags);
|
||||
rules.get("/pet/{petId}", this::getPetById);
|
||||
rules.put("/pet", Handler.create(Pet.class, this::updatePet));
|
||||
rules.post("/pet/{petId}", this::updatePetWithForm);
|
||||
rules.post("/pet/{petId}/uploadImage", this::uploadFile);
|
||||
rules.post("/fake/{petId}/uploadImageWithRequiredFile", this::uploadFileWithRequiredFile);
|
||||
}
|
||||
|
||||
|
||||
private void processNonFileFormField(String name, Map<String, List<String>> nonFileFormContent, ReadableBodyPart part) {
|
||||
List<String> content = nonFileFormContent.computeIfAbsent(name, key -> new ArrayList<>());
|
||||
part.content().as(String.class).thenAccept(content::add);
|
||||
}
|
||||
|
||||
private void processFileFormField(String name, Map<String, List<InputStream>> fileFormContent, ReadableBodyPart part) {
|
||||
List<InputStream> content = fileFormContent.computeIfAbsent(name, key -> new ArrayList<>());
|
||||
part.content().map(DataChunk::bytes)
|
||||
.collect(ByteArrayOutputStream::new, (stream, bytes) -> {
|
||||
try {
|
||||
stream.write(bytes);
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
})
|
||||
.thenAccept(byteStream -> content.add(new ByteArrayInputStream(byteStream.toByteArray())));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* POST /pet : Add a new pet to the store.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
void addPet(ServerRequest request, ServerResponse response, Pet pet) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
ValidatorUtils.checkNonNull(pet);
|
||||
|
||||
handleAddPet(request, response, pet);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle POST /pet : Add a new pet to the store.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
abstract void handleAddPet(ServerRequest request, ServerResponse response, Pet pet);
|
||||
|
||||
|
||||
/**
|
||||
* DELETE /pet/{petId} : Deletes a pet.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void deletePet(ServerRequest request, ServerResponse response) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
Long petId = Optional.ofNullable(request.path().param("petId")).map(Long::valueOf).orElse(null);
|
||||
ValidatorUtils.checkNonNull(petId);
|
||||
String apiKey = request.headers().value("api_key").orElse(null);
|
||||
|
||||
handleDeletePet(request, response, petId, apiKey);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle DELETE /pet/{petId} : Deletes a pet.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey apiKey
|
||||
*/
|
||||
abstract void handleDeletePet(ServerRequest request, ServerResponse response, Long petId, String apiKey);
|
||||
|
||||
|
||||
/**
|
||||
* GET /pet/findByStatus : Finds Pets by status.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void findPetsByStatus(ServerRequest request, ServerResponse response) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
List<String> status = Optional.ofNullable(request.queryParams().toMap().get("status")).orElse(null);
|
||||
ValidatorUtils.checkNonNull(status);
|
||||
|
||||
handleFindPetsByStatus(request, response, status);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle GET /pet/findByStatus : Finds Pets by status.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param status Status values that need to be considered for filter
|
||||
*/
|
||||
abstract void handleFindPetsByStatus(ServerRequest request, ServerResponse response, List<String> status);
|
||||
|
||||
|
||||
/**
|
||||
* GET /pet/findByTags : Finds Pets by tags.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void findPetsByTags(ServerRequest request, ServerResponse response) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
List<String> tags = Optional.ofNullable(request.queryParams().toMap().get("tags")).orElse(null);
|
||||
ValidatorUtils.checkNonNull(tags);
|
||||
|
||||
handleFindPetsByTags(request, response, tags);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle GET /pet/findByTags : Finds Pets by tags.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param tags Tags to filter by
|
||||
*/
|
||||
abstract void handleFindPetsByTags(ServerRequest request, ServerResponse response, List<String> tags);
|
||||
|
||||
|
||||
/**
|
||||
* GET /pet/{petId} : Find pet by ID.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void getPetById(ServerRequest request, ServerResponse response) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
Long petId = Optional.ofNullable(request.path().param("petId")).map(Long::valueOf).orElse(null);
|
||||
ValidatorUtils.checkNonNull(petId);
|
||||
|
||||
handleGetPetById(request, response, petId);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle GET /pet/{petId} : Find pet by ID.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param petId ID of pet to return
|
||||
*/
|
||||
abstract void handleGetPetById(ServerRequest request, ServerResponse response, Long petId);
|
||||
|
||||
|
||||
/**
|
||||
* PUT /pet : Update an existing pet.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
void updatePet(ServerRequest request, ServerResponse response, Pet pet) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
ValidatorUtils.checkNonNull(pet);
|
||||
|
||||
handleUpdatePet(request, response, pet);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle PUT /pet : Update an existing pet.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
abstract void handleUpdatePet(ServerRequest request, ServerResponse response, Pet pet);
|
||||
|
||||
|
||||
/**
|
||||
* POST /pet/{petId} : Updates a pet in the store with form data.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void updatePetWithForm(ServerRequest request, ServerResponse response) {
|
||||
Map<String, List<String>> nonFileFormContent = new HashMap<>();
|
||||
Map<String, List<InputStream>> fileFormContent = new HashMap<>();
|
||||
Single<Void> formSingle = request.content().asStream(ReadableBodyPart.class)
|
||||
.forEach(part -> {
|
||||
String name = part.name();
|
||||
if ("name".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
if ("status".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
part.drain();
|
||||
});
|
||||
Single.create(formSingle)
|
||||
.thenAccept(val -> {
|
||||
Long petId = Optional.ofNullable(request.path().param("petId")).map(Long::valueOf).orElse(null);
|
||||
ValidatorUtils.checkNonNull(petId);
|
||||
String name = Optional.ofNullable(nonFileFormContent.get("name")).flatMap(list->list.stream().findFirst()).orElse(null);
|
||||
String status = Optional.ofNullable(nonFileFormContent.get("status")).flatMap(list->list.stream().findFirst()).orElse(null);
|
||||
|
||||
handleUpdatePetWithForm(request, response, petId, name, status);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle POST /pet/{petId} : Updates a pet in the store with form data.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
abstract void handleUpdatePetWithForm(ServerRequest request, ServerResponse response, Long petId, String name, String status);
|
||||
|
||||
|
||||
/**
|
||||
* POST /pet/{petId}/uploadImage : uploads an image.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void uploadFile(ServerRequest request, ServerResponse response) {
|
||||
Map<String, List<String>> nonFileFormContent = new HashMap<>();
|
||||
Map<String, List<InputStream>> fileFormContent = new HashMap<>();
|
||||
Single<Void> formSingle = request.content().asStream(ReadableBodyPart.class)
|
||||
.forEach(part -> {
|
||||
String name = part.name();
|
||||
if ("additionalMetadata".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
if ("file".equals(name)) {
|
||||
processFileFormField(name, fileFormContent, part);
|
||||
}
|
||||
part.drain();
|
||||
});
|
||||
Single.create(formSingle)
|
||||
.thenAccept(val -> {
|
||||
Long petId = Optional.ofNullable(request.path().param("petId")).map(Long::valueOf).orElse(null);
|
||||
ValidatorUtils.checkNonNull(petId);
|
||||
String additionalMetadata = Optional.ofNullable(nonFileFormContent.get("additionalMetadata")).flatMap(list->list.stream().findFirst()).orElse(null);
|
||||
InputStream _file = Optional.ofNullable(fileFormContent.get("file")).flatMap(list->list.stream().findFirst()).orElse(null);
|
||||
|
||||
handleUploadFile(request, response, petId, additionalMetadata, _file);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle POST /pet/{petId}/uploadImage : uploads an image.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param petId ID of pet to update
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param _file file to upload
|
||||
*/
|
||||
abstract void handleUploadFile(ServerRequest request, ServerResponse response, Long petId, String additionalMetadata, InputStream _file);
|
||||
|
||||
|
||||
/**
|
||||
* POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required).
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void uploadFileWithRequiredFile(ServerRequest request, ServerResponse response) {
|
||||
Map<String, List<String>> nonFileFormContent = new HashMap<>();
|
||||
Map<String, List<InputStream>> fileFormContent = new HashMap<>();
|
||||
Single<Void> formSingle = request.content().asStream(ReadableBodyPart.class)
|
||||
.forEach(part -> {
|
||||
String name = part.name();
|
||||
if ("additionalMetadata".equals(name)) {
|
||||
processNonFileFormField(name, nonFileFormContent, part);
|
||||
}
|
||||
if ("requiredFile".equals(name)) {
|
||||
processFileFormField(name, fileFormContent, part);
|
||||
}
|
||||
part.drain();
|
||||
});
|
||||
Single.create(formSingle)
|
||||
.thenAccept(val -> {
|
||||
Long petId = Optional.ofNullable(request.path().param("petId")).map(Long::valueOf).orElse(null);
|
||||
ValidatorUtils.checkNonNull(petId);
|
||||
InputStream requiredFile = Optional.ofNullable(fileFormContent.get("requiredFile")).flatMap(list->list.stream().findFirst()).orElse(null);
|
||||
ValidatorUtils.checkNonNull(requiredFile);
|
||||
String additionalMetadata = Optional.ofNullable(nonFileFormContent.get("additionalMetadata")).flatMap(list->list.stream().findFirst()).orElse(null);
|
||||
|
||||
handleUploadFileWithRequiredFile(request, response, petId, requiredFile, additionalMetadata);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required).
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param petId ID of pet to update
|
||||
* @param requiredFile file to upload
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
*/
|
||||
abstract void handleUploadFileWithRequiredFile(ServerRequest request, ServerResponse response, Long petId, InputStream requiredFile, String additionalMetadata);
|
||||
|
||||
|
||||
abstract Void handleError(ServerRequest request, ServerResponse response, Throwable throwable);
|
||||
}
|
@ -0,0 +1,140 @@
|
||||
package org.openapitools.server.api;
|
||||
|
||||
import io.helidon.webserver.Handler;
|
||||
import java.util.Map;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.openapitools.server.model.Order;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import io.helidon.common.GenericType;
|
||||
import io.helidon.common.reactive.Single;
|
||||
import io.helidon.config.Config;
|
||||
import io.helidon.webserver.Routing;
|
||||
import io.helidon.webserver.ServerRequest;
|
||||
import io.helidon.webserver.ServerResponse;
|
||||
import io.helidon.webserver.Service;
|
||||
|
||||
|
||||
public abstract class StoreService implements Service {
|
||||
|
||||
protected static final Logger LOGGER = Logger.getLogger(StoreService.class.getName());
|
||||
private static final ObjectMapper MAPPER = JsonProvider.objectMapper();
|
||||
|
||||
protected final Config config;
|
||||
|
||||
public StoreService(Config config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
/**
|
||||
* A service registers itself by updating the routing rules.
|
||||
* @param rules the routing rules.
|
||||
*/
|
||||
@Override
|
||||
public void update(Routing.Rules rules) {
|
||||
rules.delete("/store/order/{order_id}", this::deleteOrder);
|
||||
rules.get("/store/inventory", this::getInventory);
|
||||
rules.get("/store/order/{order_id}", this::getOrderById);
|
||||
rules.post("/store/order", Handler.create(Order.class, this::placeOrder));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* DELETE /store/order/{order_id} : Delete purchase order by ID.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void deleteOrder(ServerRequest request, ServerResponse response) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
String orderId = Optional.ofNullable(request.path().param("order_id")).orElse(null);
|
||||
ValidatorUtils.checkNonNull(orderId);
|
||||
|
||||
handleDeleteOrder(request, response, orderId);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle DELETE /store/order/{order_id} : Delete purchase order by ID.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
abstract void handleDeleteOrder(ServerRequest request, ServerResponse response, String orderId);
|
||||
|
||||
|
||||
/**
|
||||
* GET /store/inventory : Returns pet inventories by status.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void getInventory(ServerRequest request, ServerResponse response) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
|
||||
handleGetInventory(request, response);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle GET /store/inventory : Returns pet inventories by status.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
abstract void handleGetInventory(ServerRequest request, ServerResponse response);
|
||||
|
||||
|
||||
/**
|
||||
* GET /store/order/{order_id} : Find purchase order by ID.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void getOrderById(ServerRequest request, ServerResponse response) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
Long orderId = Optional.ofNullable(request.path().param("order_id")).map(Long::valueOf).orElse(null);
|
||||
ValidatorUtils.checkNonNull(orderId);
|
||||
ValidatorUtils.validateMin(orderId.intValue(), 1);
|
||||
ValidatorUtils.validateMax(orderId.intValue(), 5);
|
||||
|
||||
handleGetOrderById(request, response, orderId);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle GET /store/order/{order_id} : Find purchase order by ID.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
abstract void handleGetOrderById(ServerRequest request, ServerResponse response, Long orderId);
|
||||
|
||||
|
||||
/**
|
||||
* POST /store/order : Place an order for a pet.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
void placeOrder(ServerRequest request, ServerResponse response, Order order) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
ValidatorUtils.checkNonNull(order);
|
||||
|
||||
handlePlaceOrder(request, response, order);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle POST /store/order : Place an order for a pet.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
abstract void handlePlaceOrder(ServerRequest request, ServerResponse response, Order order);
|
||||
|
||||
|
||||
abstract Void handleError(ServerRequest request, ServerResponse response, Throwable throwable);
|
||||
}
|
@ -0,0 +1,243 @@
|
||||
package org.openapitools.server.api;
|
||||
|
||||
import io.helidon.webserver.Handler;
|
||||
import java.util.List;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.time.OffsetDateTime;
|
||||
import org.openapitools.server.model.User;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import io.helidon.common.GenericType;
|
||||
import io.helidon.common.reactive.Single;
|
||||
import io.helidon.config.Config;
|
||||
import io.helidon.webserver.Routing;
|
||||
import io.helidon.webserver.ServerRequest;
|
||||
import io.helidon.webserver.ServerResponse;
|
||||
import io.helidon.webserver.Service;
|
||||
|
||||
|
||||
public abstract class UserService implements Service {
|
||||
|
||||
protected static final Logger LOGGER = Logger.getLogger(UserService.class.getName());
|
||||
private static final ObjectMapper MAPPER = JsonProvider.objectMapper();
|
||||
|
||||
protected final Config config;
|
||||
|
||||
public UserService(Config config) {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
/**
|
||||
* A service registers itself by updating the routing rules.
|
||||
* @param rules the routing rules.
|
||||
*/
|
||||
@Override
|
||||
public void update(Routing.Rules rules) {
|
||||
rules.post("/user", Handler.create(User.class, this::createUser));
|
||||
rules.post("/user/createWithArray", this::createUsersWithArrayInput);
|
||||
rules.post("/user/createWithList", this::createUsersWithListInput);
|
||||
rules.delete("/user/{username}", this::deleteUser);
|
||||
rules.get("/user/{username}", this::getUserByName);
|
||||
rules.get("/user/login", this::loginUser);
|
||||
rules.get("/user/logout", this::logoutUser);
|
||||
rules.put("/user/{username}", Handler.create(User.class, this::updateUser));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* POST /user : Create user.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param user Created user object
|
||||
*/
|
||||
void createUser(ServerRequest request, ServerResponse response, User user) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
ValidatorUtils.checkNonNull(user);
|
||||
|
||||
handleCreateUser(request, response, user);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle POST /user : Create user.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param user Created user object
|
||||
*/
|
||||
abstract void handleCreateUser(ServerRequest request, ServerResponse response, User user);
|
||||
|
||||
|
||||
/**
|
||||
* POST /user/createWithArray : Creates list of users with given input array.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void createUsersWithArrayInput(ServerRequest request, ServerResponse response) {
|
||||
Single.create(request.content().as(new GenericType<List<User>>() { }))
|
||||
.thenAccept(user -> {
|
||||
ValidatorUtils.checkNonNull(user);
|
||||
|
||||
handleCreateUsersWithArrayInput(request, response, user);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle POST /user/createWithArray : Creates list of users with given input array.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param user List of user object
|
||||
*/
|
||||
abstract void handleCreateUsersWithArrayInput(ServerRequest request, ServerResponse response, List<User> user);
|
||||
|
||||
|
||||
/**
|
||||
* POST /user/createWithList : Creates list of users with given input array.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void createUsersWithListInput(ServerRequest request, ServerResponse response) {
|
||||
Single.create(request.content().as(new GenericType<List<User>>() { }))
|
||||
.thenAccept(user -> {
|
||||
ValidatorUtils.checkNonNull(user);
|
||||
|
||||
handleCreateUsersWithListInput(request, response, user);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle POST /user/createWithList : Creates list of users with given input array.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param user List of user object
|
||||
*/
|
||||
abstract void handleCreateUsersWithListInput(ServerRequest request, ServerResponse response, List<User> user);
|
||||
|
||||
|
||||
/**
|
||||
* DELETE /user/{username} : Delete user.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void deleteUser(ServerRequest request, ServerResponse response) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
String username = Optional.ofNullable(request.path().param("username")).orElse(null);
|
||||
ValidatorUtils.checkNonNull(username);
|
||||
|
||||
handleDeleteUser(request, response, username);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle DELETE /user/{username} : Delete user.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
abstract void handleDeleteUser(ServerRequest request, ServerResponse response, String username);
|
||||
|
||||
|
||||
/**
|
||||
* GET /user/{username} : Get user by user name.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void getUserByName(ServerRequest request, ServerResponse response) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
String username = Optional.ofNullable(request.path().param("username")).orElse(null);
|
||||
ValidatorUtils.checkNonNull(username);
|
||||
|
||||
handleGetUserByName(request, response, username);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle GET /user/{username} : Get user by user name.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
abstract void handleGetUserByName(ServerRequest request, ServerResponse response, String username);
|
||||
|
||||
|
||||
/**
|
||||
* GET /user/login : Logs user into the system.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void loginUser(ServerRequest request, ServerResponse response) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
String username = request.queryParams().toMap().getOrDefault("username", List.of()).stream().findFirst().orElse(null);
|
||||
ValidatorUtils.checkNonNull(username);
|
||||
String password = request.queryParams().toMap().getOrDefault("password", List.of()).stream().findFirst().orElse(null);
|
||||
ValidatorUtils.checkNonNull(password);
|
||||
|
||||
handleLoginUser(request, response, username, password);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle GET /user/login : Logs user into the system.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
*/
|
||||
abstract void handleLoginUser(ServerRequest request, ServerResponse response, String username, String password);
|
||||
|
||||
|
||||
/**
|
||||
* GET /user/logout : Logs out current logged in user session.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
void logoutUser(ServerRequest request, ServerResponse response) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
|
||||
handleLogoutUser(request, response);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle GET /user/logout : Logs out current logged in user session.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
*/
|
||||
abstract void handleLogoutUser(ServerRequest request, ServerResponse response);
|
||||
|
||||
|
||||
/**
|
||||
* PUT /user/{username} : Updated user.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param user Updated user object
|
||||
*/
|
||||
void updateUser(ServerRequest request, ServerResponse response, User user) {
|
||||
Single.create(Single.empty())
|
||||
.thenAccept(val -> {
|
||||
String username = Optional.ofNullable(request.path().param("username")).orElse(null);
|
||||
ValidatorUtils.checkNonNull(username);
|
||||
ValidatorUtils.checkNonNull(user);
|
||||
|
||||
handleUpdateUser(request, response, username, user);
|
||||
})
|
||||
.exceptionally(throwable -> handleError(request, response, throwable));
|
||||
}
|
||||
/**
|
||||
* Handle PUT /user/{username} : Updated user.
|
||||
* @param request the server request
|
||||
* @param response the server response
|
||||
* @param username name that need to be deleted
|
||||
* @param user Updated user object
|
||||
*/
|
||||
abstract void handleUpdateUser(ServerRequest request, ServerResponse response, String username, User user);
|
||||
|
||||
|
||||
abstract Void handleError(ServerRequest request, ServerResponse response, Throwable throwable);
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
package org.openapitools.server.api;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.validation.ValidationException;
|
||||
|
||||
/**
|
||||
* Validation utility methods.
|
||||
*/
|
||||
public final class ValidatorUtils {
|
||||
|
||||
public static boolean validateMin(Integer value, Integer min) {
|
||||
checkNonNull(value);
|
||||
if (value < min) {
|
||||
throw new ValidationException(String.format("%s is less than %s", value, min));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean validateMax(Integer value, Integer max) {
|
||||
checkNonNull(value);
|
||||
if (value > max) {
|
||||
throw new ValidationException(String.format("%s is more than %s", value, max));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean validateSize(Object value, Integer min, Integer max) {
|
||||
checkNonNull(value);
|
||||
Integer size = -1;
|
||||
if (value instanceof Map) {
|
||||
size = ((Map<?, ?>) value).size();
|
||||
}
|
||||
if (value instanceof CharSequence) {
|
||||
size = ((CharSequence) value).length();
|
||||
}
|
||||
if (value instanceof Collection) {
|
||||
size = ((Collection<?>) value).size();
|
||||
}
|
||||
if (value.getClass().isArray()) {
|
||||
size = Array.getLength(value);
|
||||
}
|
||||
if (size == -1) {
|
||||
throw new ValidationException("Value has incorrect type");
|
||||
}
|
||||
if (min != null) {
|
||||
validateMin(size, min);
|
||||
}
|
||||
if (max != null) {
|
||||
validateMax(size, max);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean validatePattern(String value, String pattern) {
|
||||
checkNonNull(value, pattern);
|
||||
if (value.matches(pattern)) {
|
||||
return true;
|
||||
}
|
||||
throw new ValidationException(String.format("'%s' does not match the pattern '%s'", value, pattern));
|
||||
}
|
||||
|
||||
public static boolean validateMin(BigDecimal value, String stringMinValue, boolean inclusive) {
|
||||
checkNonNull(value);
|
||||
BigDecimal minValue = new BigDecimal(stringMinValue);
|
||||
int result = value.compareTo(minValue);
|
||||
if (inclusive) {
|
||||
if (result >= 0) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (result > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
throw new ValidationException(
|
||||
String.format("%s is not valid value. Min value '%s'. Inclusive - %s.", value, stringMinValue, inclusive)
|
||||
);
|
||||
}
|
||||
|
||||
public static boolean validateMax(BigDecimal value, String stringMaxValue, boolean inclusive) {
|
||||
checkNonNull(value);
|
||||
BigDecimal maxValue = new BigDecimal(stringMaxValue);
|
||||
int result = value.compareTo(maxValue);
|
||||
if (inclusive) {
|
||||
if (result <= 0) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (result < 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
throw new ValidationException(
|
||||
String.format("%s is not valid value. Max value '%s'. Inclusive - %s.", value, stringMaxValue, inclusive)
|
||||
);
|
||||
}
|
||||
|
||||
public static void checkNonNull(Object... args) {
|
||||
try {
|
||||
for (Object o : args) {
|
||||
Objects.requireNonNull(o);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new ValidationException(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
||||
public class AdditionalPropertiesClass {
|
||||
|
||||
private Map<String, String> mapProperty = new HashMap<>();
|
||||
private Map<String, Map<String, String>> mapOfMapProperty = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public AdditionalPropertiesClass() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create AdditionalPropertiesClass.
|
||||
*
|
||||
* @param mapProperty mapProperty
|
||||
* @param mapOfMapProperty mapOfMapProperty
|
||||
*/
|
||||
public AdditionalPropertiesClass(
|
||||
Map<String, String> mapProperty,
|
||||
Map<String, Map<String, String>> mapOfMapProperty
|
||||
) {
|
||||
this.mapProperty = mapProperty;
|
||||
this.mapOfMapProperty = mapOfMapProperty;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get mapProperty
|
||||
* @return mapProperty
|
||||
*/
|
||||
public Map<String, String> getMapProperty() {
|
||||
return mapProperty;
|
||||
}
|
||||
|
||||
public void setMapProperty(Map<String, String> mapProperty) {
|
||||
this.mapProperty = mapProperty;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mapOfMapProperty
|
||||
* @return mapOfMapProperty
|
||||
*/
|
||||
public Map<String, Map<String, String>> getMapOfMapProperty() {
|
||||
return mapOfMapProperty;
|
||||
}
|
||||
|
||||
public void setMapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
|
||||
this.mapOfMapProperty = mapOfMapProperty;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class AdditionalPropertiesClass {\n");
|
||||
|
||||
sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n");
|
||||
sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,85 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import org.openapitools.server.model.SingleRefType;
|
||||
|
||||
|
||||
|
||||
public class AllOfWithSingleRef {
|
||||
|
||||
private String username;
|
||||
private SingleRefType singleRefType;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public AllOfWithSingleRef() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create AllOfWithSingleRef.
|
||||
*
|
||||
* @param username username
|
||||
* @param singleRefType singleRefType
|
||||
*/
|
||||
public AllOfWithSingleRef(
|
||||
String username,
|
||||
SingleRefType singleRefType
|
||||
) {
|
||||
this.username = username;
|
||||
this.singleRefType = singleRefType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get username
|
||||
* @return username
|
||||
*/
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get singleRefType
|
||||
* @return singleRefType
|
||||
*/
|
||||
public SingleRefType getSingleRefType() {
|
||||
return singleRefType;
|
||||
}
|
||||
|
||||
public void setSingleRefType(SingleRefType singleRefType) {
|
||||
this.singleRefType = singleRefType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class AllOfWithSingleRef {\n");
|
||||
|
||||
sb.append(" username: ").append(toIndentedString(username)).append("\n");
|
||||
sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,88 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import org.openapitools.server.model.Cat;
|
||||
import org.openapitools.server.model.Dog;
|
||||
|
||||
|
||||
|
||||
public class Animal {
|
||||
|
||||
private String className;
|
||||
private String color = "red";
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public Animal() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Animal.
|
||||
*
|
||||
* @param className className
|
||||
* @param color color
|
||||
*/
|
||||
public Animal(
|
||||
String className,
|
||||
String color
|
||||
) {
|
||||
this.className = className;
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get className
|
||||
* @return className
|
||||
*/
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
public void setClassName(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
*/
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Animal {\n");
|
||||
|
||||
sb.append(" className: ").append(toIndentedString(className)).append("\n");
|
||||
sb.append(" color: ").append(toIndentedString(color)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,69 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public ArrayOfArrayOfNumberOnly() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create ArrayOfArrayOfNumberOnly.
|
||||
*
|
||||
* @param arrayArrayNumber arrayArrayNumber
|
||||
*/
|
||||
public ArrayOfArrayOfNumberOnly(
|
||||
List<List<BigDecimal>> arrayArrayNumber
|
||||
) {
|
||||
this.arrayArrayNumber = arrayArrayNumber;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get arrayArrayNumber
|
||||
* @return arrayArrayNumber
|
||||
*/
|
||||
public List<List<BigDecimal>> getArrayArrayNumber() {
|
||||
return arrayArrayNumber;
|
||||
}
|
||||
|
||||
public void setArrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
|
||||
this.arrayArrayNumber = arrayArrayNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ArrayOfArrayOfNumberOnly {\n");
|
||||
|
||||
sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,69 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
public class ArrayOfNumberOnly {
|
||||
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public ArrayOfNumberOnly() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create ArrayOfNumberOnly.
|
||||
*
|
||||
* @param arrayNumber arrayNumber
|
||||
*/
|
||||
public ArrayOfNumberOnly(
|
||||
List<BigDecimal> arrayNumber
|
||||
) {
|
||||
this.arrayNumber = arrayNumber;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get arrayNumber
|
||||
* @return arrayNumber
|
||||
*/
|
||||
public List<BigDecimal> getArrayNumber() {
|
||||
return arrayNumber;
|
||||
}
|
||||
|
||||
public void setArrayNumber(List<BigDecimal> arrayNumber) {
|
||||
this.arrayNumber = arrayNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ArrayOfNumberOnly {\n");
|
||||
|
||||
sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,103 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.server.model.ReadOnlyFirst;
|
||||
|
||||
|
||||
|
||||
public class ArrayTest {
|
||||
|
||||
private List<String> arrayOfString = new ArrayList<>();
|
||||
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public ArrayTest() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create ArrayTest.
|
||||
*
|
||||
* @param arrayOfString arrayOfString
|
||||
* @param arrayArrayOfInteger arrayArrayOfInteger
|
||||
* @param arrayArrayOfModel arrayArrayOfModel
|
||||
*/
|
||||
public ArrayTest(
|
||||
List<String> arrayOfString,
|
||||
List<List<Long>> arrayArrayOfInteger,
|
||||
List<List<ReadOnlyFirst>> arrayArrayOfModel
|
||||
) {
|
||||
this.arrayOfString = arrayOfString;
|
||||
this.arrayArrayOfInteger = arrayArrayOfInteger;
|
||||
this.arrayArrayOfModel = arrayArrayOfModel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get arrayOfString
|
||||
* @return arrayOfString
|
||||
*/
|
||||
public List<String> getArrayOfString() {
|
||||
return arrayOfString;
|
||||
}
|
||||
|
||||
public void setArrayOfString(List<String> arrayOfString) {
|
||||
this.arrayOfString = arrayOfString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayArrayOfInteger
|
||||
* @return arrayArrayOfInteger
|
||||
*/
|
||||
public List<List<Long>> getArrayArrayOfInteger() {
|
||||
return arrayArrayOfInteger;
|
||||
}
|
||||
|
||||
public void setArrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
|
||||
this.arrayArrayOfInteger = arrayArrayOfInteger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayArrayOfModel
|
||||
* @return arrayArrayOfModel
|
||||
*/
|
||||
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
|
||||
return arrayArrayOfModel;
|
||||
}
|
||||
|
||||
public void setArrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
|
||||
this.arrayArrayOfModel = arrayArrayOfModel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ArrayTest {\n");
|
||||
|
||||
sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n");
|
||||
sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n");
|
||||
sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,151 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
|
||||
|
||||
|
||||
public class Capitalization {
|
||||
|
||||
private String smallCamel;
|
||||
private String capitalCamel;
|
||||
private String smallSnake;
|
||||
private String capitalSnake;
|
||||
private String scAETHFlowPoints;
|
||||
private String ATT_NAME;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public Capitalization() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Capitalization.
|
||||
*
|
||||
* @param smallCamel smallCamel
|
||||
* @param capitalCamel capitalCamel
|
||||
* @param smallSnake smallSnake
|
||||
* @param capitalSnake capitalSnake
|
||||
* @param scAETHFlowPoints scAETHFlowPoints
|
||||
* @param ATT_NAME Name of the pet
|
||||
*/
|
||||
public Capitalization(
|
||||
String smallCamel,
|
||||
String capitalCamel,
|
||||
String smallSnake,
|
||||
String capitalSnake,
|
||||
String scAETHFlowPoints,
|
||||
String ATT_NAME
|
||||
) {
|
||||
this.smallCamel = smallCamel;
|
||||
this.capitalCamel = capitalCamel;
|
||||
this.smallSnake = smallSnake;
|
||||
this.capitalSnake = capitalSnake;
|
||||
this.scAETHFlowPoints = scAETHFlowPoints;
|
||||
this.ATT_NAME = ATT_NAME;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get smallCamel
|
||||
* @return smallCamel
|
||||
*/
|
||||
public String getSmallCamel() {
|
||||
return smallCamel;
|
||||
}
|
||||
|
||||
public void setSmallCamel(String smallCamel) {
|
||||
this.smallCamel = smallCamel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get capitalCamel
|
||||
* @return capitalCamel
|
||||
*/
|
||||
public String getCapitalCamel() {
|
||||
return capitalCamel;
|
||||
}
|
||||
|
||||
public void setCapitalCamel(String capitalCamel) {
|
||||
this.capitalCamel = capitalCamel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get smallSnake
|
||||
* @return smallSnake
|
||||
*/
|
||||
public String getSmallSnake() {
|
||||
return smallSnake;
|
||||
}
|
||||
|
||||
public void setSmallSnake(String smallSnake) {
|
||||
this.smallSnake = smallSnake;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get capitalSnake
|
||||
* @return capitalSnake
|
||||
*/
|
||||
public String getCapitalSnake() {
|
||||
return capitalSnake;
|
||||
}
|
||||
|
||||
public void setCapitalSnake(String capitalSnake) {
|
||||
this.capitalSnake = capitalSnake;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get scAETHFlowPoints
|
||||
* @return scAETHFlowPoints
|
||||
*/
|
||||
public String getScAETHFlowPoints() {
|
||||
return scAETHFlowPoints;
|
||||
}
|
||||
|
||||
public void setScAETHFlowPoints(String scAETHFlowPoints) {
|
||||
this.scAETHFlowPoints = scAETHFlowPoints;
|
||||
}
|
||||
|
||||
/**
|
||||
* Name of the pet
|
||||
* @return ATT_NAME
|
||||
*/
|
||||
public String getATTNAME() {
|
||||
return ATT_NAME;
|
||||
}
|
||||
|
||||
public void setATTNAME(String ATT_NAME) {
|
||||
this.ATT_NAME = ATT_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Capitalization {\n");
|
||||
|
||||
sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n");
|
||||
sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n");
|
||||
sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n");
|
||||
sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n");
|
||||
sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n");
|
||||
sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,71 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import org.openapitools.server.model.Animal;
|
||||
import org.openapitools.server.model.CatAllOf;
|
||||
|
||||
|
||||
|
||||
public class Cat extends Animal {
|
||||
|
||||
private Boolean declawed;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public Cat() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Cat.
|
||||
*
|
||||
* @param declawed declawed
|
||||
*/
|
||||
public Cat(
|
||||
Boolean declawed
|
||||
) {
|
||||
this.declawed = declawed;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get declawed
|
||||
* @return declawed
|
||||
*/
|
||||
public Boolean getDeclawed() {
|
||||
return declawed;
|
||||
}
|
||||
|
||||
public void setDeclawed(Boolean declawed) {
|
||||
this.declawed = declawed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Cat {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,67 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
|
||||
|
||||
public class CatAllOf {
|
||||
|
||||
private Boolean declawed;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public CatAllOf() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create CatAllOf.
|
||||
*
|
||||
* @param declawed declawed
|
||||
*/
|
||||
public CatAllOf(
|
||||
Boolean declawed
|
||||
) {
|
||||
this.declawed = declawed;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get declawed
|
||||
* @return declawed
|
||||
*/
|
||||
public Boolean getDeclawed() {
|
||||
return declawed;
|
||||
}
|
||||
|
||||
public void setDeclawed(Boolean declawed) {
|
||||
this.declawed = declawed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class CatAllOf {\n");
|
||||
|
||||
sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,83 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
|
||||
|
||||
|
||||
public class Category {
|
||||
|
||||
private Long id;
|
||||
private String name = "default-name";
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public Category() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Category.
|
||||
*
|
||||
* @param id id
|
||||
* @param name name
|
||||
*/
|
||||
public Category(
|
||||
Long id,
|
||||
String name
|
||||
) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Category {\n");
|
||||
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,68 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Model for testing model with \"_class\" property
|
||||
*/
|
||||
public class ClassModel {
|
||||
|
||||
private String propertyClass;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public ClassModel() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create ClassModel.
|
||||
*
|
||||
* @param propertyClass propertyClass
|
||||
*/
|
||||
public ClassModel(
|
||||
String propertyClass
|
||||
) {
|
||||
this.propertyClass = propertyClass;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get propertyClass
|
||||
* @return propertyClass
|
||||
*/
|
||||
public String getPropertyClass() {
|
||||
return propertyClass;
|
||||
}
|
||||
|
||||
public void setPropertyClass(String propertyClass) {
|
||||
this.propertyClass = propertyClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ClassModel {\n");
|
||||
|
||||
sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,66 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
|
||||
|
||||
|
||||
public class Client {
|
||||
|
||||
private String client;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public Client() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Client.
|
||||
*
|
||||
* @param client client
|
||||
*/
|
||||
public Client(
|
||||
String client
|
||||
) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get client
|
||||
* @return client
|
||||
*/
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
||||
public void setClient(String client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Client {\n");
|
||||
|
||||
sb.append(" client: ").append(toIndentedString(client)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,66 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
|
||||
|
||||
|
||||
public class DeprecatedObject {
|
||||
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public DeprecatedObject() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create DeprecatedObject.
|
||||
*
|
||||
* @param name name
|
||||
*/
|
||||
public DeprecatedObject(
|
||||
String name
|
||||
) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class DeprecatedObject {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,71 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import org.openapitools.server.model.Animal;
|
||||
import org.openapitools.server.model.DogAllOf;
|
||||
|
||||
|
||||
|
||||
public class Dog extends Animal {
|
||||
|
||||
private String breed;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public Dog() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Dog.
|
||||
*
|
||||
* @param breed breed
|
||||
*/
|
||||
public Dog(
|
||||
String breed
|
||||
) {
|
||||
this.breed = breed;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get breed
|
||||
* @return breed
|
||||
*/
|
||||
public String getBreed() {
|
||||
return breed;
|
||||
}
|
||||
|
||||
public void setBreed(String breed) {
|
||||
this.breed = breed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Dog {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append(" breed: ").append(toIndentedString(breed)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,67 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
|
||||
|
||||
public class DogAllOf {
|
||||
|
||||
private String breed;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public DogAllOf() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create DogAllOf.
|
||||
*
|
||||
* @param breed breed
|
||||
*/
|
||||
public DogAllOf(
|
||||
String breed
|
||||
) {
|
||||
this.breed = breed;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get breed
|
||||
* @return breed
|
||||
*/
|
||||
public String getBreed() {
|
||||
return breed;
|
||||
}
|
||||
|
||||
public void setBreed(String breed) {
|
||||
this.breed = breed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class DogAllOf {\n");
|
||||
|
||||
sb.append(" breed: ").append(toIndentedString(breed)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,161 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
public class EnumArrays {
|
||||
|
||||
|
||||
/**
|
||||
* Gets or Sets justSymbol
|
||||
*/
|
||||
public enum JustSymbolEnum {
|
||||
GREATER_THAN_OR_EQUAL_TO(">="),
|
||||
DOLLAR("$");
|
||||
|
||||
private String value;
|
||||
|
||||
JustSymbolEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
|
||||
@JsonCreator
|
||||
public static JustSymbolEnum fromValue(String text) {
|
||||
for (JustSymbolEnum b : JustSymbolEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + text + "'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private JustSymbolEnum justSymbol;
|
||||
|
||||
/**
|
||||
* Gets or Sets arrayEnum
|
||||
*/
|
||||
public enum ArrayEnumEnum {
|
||||
FISH("fish"),
|
||||
CRAB("crab");
|
||||
|
||||
private String value;
|
||||
|
||||
ArrayEnumEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
|
||||
@JsonCreator
|
||||
public static ArrayEnumEnum fromValue(String text) {
|
||||
for (ArrayEnumEnum b : ArrayEnumEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + text + "'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public EnumArrays() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create EnumArrays.
|
||||
*
|
||||
* @param justSymbol justSymbol
|
||||
* @param arrayEnum arrayEnum
|
||||
*/
|
||||
public EnumArrays(
|
||||
JustSymbolEnum justSymbol,
|
||||
List<ArrayEnumEnum> arrayEnum
|
||||
) {
|
||||
this.justSymbol = justSymbol;
|
||||
this.arrayEnum = arrayEnum;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get justSymbol
|
||||
* @return justSymbol
|
||||
*/
|
||||
public JustSymbolEnum getJustSymbol() {
|
||||
return justSymbol;
|
||||
}
|
||||
|
||||
public void setJustSymbol(JustSymbolEnum justSymbol) {
|
||||
this.justSymbol = justSymbol;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayEnum
|
||||
* @return arrayEnum
|
||||
*/
|
||||
public List<ArrayEnumEnum> getArrayEnum() {
|
||||
return arrayEnum;
|
||||
}
|
||||
|
||||
public void setArrayEnum(List<ArrayEnumEnum> arrayEnum) {
|
||||
this.arrayEnum = arrayEnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class EnumArrays {\n");
|
||||
|
||||
sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n");
|
||||
sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,44 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
/**
|
||||
* Gets or Sets EnumClass
|
||||
*/
|
||||
|
||||
public enum EnumClass {
|
||||
|
||||
_ABC("_abc"),
|
||||
_EFG("-efg"),
|
||||
_XYZ_("(xyz)");
|
||||
|
||||
private String value;
|
||||
|
||||
EnumClass(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static EnumClass fromValue(String text) {
|
||||
for (EnumClass b : EnumClass.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + text + "'");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,343 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
import org.openapitools.server.model.OuterEnum;
|
||||
import org.openapitools.server.model.OuterEnumDefaultValue;
|
||||
import org.openapitools.server.model.OuterEnumInteger;
|
||||
import org.openapitools.server.model.OuterEnumIntegerDefaultValue;
|
||||
|
||||
|
||||
|
||||
public class EnumTest {
|
||||
|
||||
|
||||
/**
|
||||
* Gets or Sets enumString
|
||||
*/
|
||||
public enum EnumStringEnum {
|
||||
UPPER("UPPER"),
|
||||
LOWER("lower"),
|
||||
EMPTY("");
|
||||
|
||||
private String value;
|
||||
|
||||
EnumStringEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
|
||||
@JsonCreator
|
||||
public static EnumStringEnum fromValue(String text) {
|
||||
for (EnumStringEnum b : EnumStringEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + text + "'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private EnumStringEnum enumString;
|
||||
|
||||
/**
|
||||
* Gets or Sets enumStringRequired
|
||||
*/
|
||||
public enum EnumStringRequiredEnum {
|
||||
UPPER("UPPER"),
|
||||
LOWER("lower"),
|
||||
EMPTY("");
|
||||
|
||||
private String value;
|
||||
|
||||
EnumStringRequiredEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
|
||||
@JsonCreator
|
||||
public static EnumStringRequiredEnum fromValue(String text) {
|
||||
for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + text + "'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private EnumStringRequiredEnum enumStringRequired;
|
||||
|
||||
/**
|
||||
* Gets or Sets enumInteger
|
||||
*/
|
||||
public enum EnumIntegerEnum {
|
||||
NUMBER_1(1),
|
||||
NUMBER_MINUS_1(-1);
|
||||
|
||||
private Integer value;
|
||||
|
||||
EnumIntegerEnum(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
|
||||
@JsonCreator
|
||||
public static EnumIntegerEnum fromValue(String text) {
|
||||
for (EnumIntegerEnum b : EnumIntegerEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + text + "'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private EnumIntegerEnum enumInteger;
|
||||
|
||||
/**
|
||||
* Gets or Sets enumNumber
|
||||
*/
|
||||
public enum EnumNumberEnum {
|
||||
NUMBER_1_DOT_1(1.1),
|
||||
NUMBER_MINUS_1_DOT_2(-1.2);
|
||||
|
||||
private Double value;
|
||||
|
||||
EnumNumberEnum(Double value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Double getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
|
||||
@JsonCreator
|
||||
public static EnumNumberEnum fromValue(String text) {
|
||||
for (EnumNumberEnum b : EnumNumberEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + text + "'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private EnumNumberEnum enumNumber;
|
||||
private OuterEnum outerEnum;
|
||||
private OuterEnumInteger outerEnumInteger;
|
||||
private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED;
|
||||
private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public EnumTest() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create EnumTest.
|
||||
*
|
||||
* @param enumString enumString
|
||||
* @param enumStringRequired enumStringRequired
|
||||
* @param enumInteger enumInteger
|
||||
* @param enumNumber enumNumber
|
||||
* @param outerEnum outerEnum
|
||||
* @param outerEnumInteger outerEnumInteger
|
||||
* @param outerEnumDefaultValue outerEnumDefaultValue
|
||||
* @param outerEnumIntegerDefaultValue outerEnumIntegerDefaultValue
|
||||
*/
|
||||
public EnumTest(
|
||||
EnumStringEnum enumString,
|
||||
EnumStringRequiredEnum enumStringRequired,
|
||||
EnumIntegerEnum enumInteger,
|
||||
EnumNumberEnum enumNumber,
|
||||
OuterEnum outerEnum,
|
||||
OuterEnumInteger outerEnumInteger,
|
||||
OuterEnumDefaultValue outerEnumDefaultValue,
|
||||
OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue
|
||||
) {
|
||||
this.enumString = enumString;
|
||||
this.enumStringRequired = enumStringRequired;
|
||||
this.enumInteger = enumInteger;
|
||||
this.enumNumber = enumNumber;
|
||||
this.outerEnum = outerEnum;
|
||||
this.outerEnumInteger = outerEnumInteger;
|
||||
this.outerEnumDefaultValue = outerEnumDefaultValue;
|
||||
this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get enumString
|
||||
* @return enumString
|
||||
*/
|
||||
public EnumStringEnum getEnumString() {
|
||||
return enumString;
|
||||
}
|
||||
|
||||
public void setEnumString(EnumStringEnum enumString) {
|
||||
this.enumString = enumString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get enumStringRequired
|
||||
* @return enumStringRequired
|
||||
*/
|
||||
public EnumStringRequiredEnum getEnumStringRequired() {
|
||||
return enumStringRequired;
|
||||
}
|
||||
|
||||
public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) {
|
||||
this.enumStringRequired = enumStringRequired;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get enumInteger
|
||||
* @return enumInteger
|
||||
*/
|
||||
public EnumIntegerEnum getEnumInteger() {
|
||||
return enumInteger;
|
||||
}
|
||||
|
||||
public void setEnumInteger(EnumIntegerEnum enumInteger) {
|
||||
this.enumInteger = enumInteger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get enumNumber
|
||||
* @return enumNumber
|
||||
*/
|
||||
public EnumNumberEnum getEnumNumber() {
|
||||
return enumNumber;
|
||||
}
|
||||
|
||||
public void setEnumNumber(EnumNumberEnum enumNumber) {
|
||||
this.enumNumber = enumNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get outerEnum
|
||||
* @return outerEnum
|
||||
*/
|
||||
public OuterEnum getOuterEnum() {
|
||||
return outerEnum;
|
||||
}
|
||||
|
||||
public void setOuterEnum(OuterEnum outerEnum) {
|
||||
this.outerEnum = outerEnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get outerEnumInteger
|
||||
* @return outerEnumInteger
|
||||
*/
|
||||
public OuterEnumInteger getOuterEnumInteger() {
|
||||
return outerEnumInteger;
|
||||
}
|
||||
|
||||
public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) {
|
||||
this.outerEnumInteger = outerEnumInteger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get outerEnumDefaultValue
|
||||
* @return outerEnumDefaultValue
|
||||
*/
|
||||
public OuterEnumDefaultValue getOuterEnumDefaultValue() {
|
||||
return outerEnumDefaultValue;
|
||||
}
|
||||
|
||||
public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) {
|
||||
this.outerEnumDefaultValue = outerEnumDefaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get outerEnumIntegerDefaultValue
|
||||
* @return outerEnumIntegerDefaultValue
|
||||
*/
|
||||
public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() {
|
||||
return outerEnumIntegerDefaultValue;
|
||||
}
|
||||
|
||||
public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) {
|
||||
this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class EnumTest {\n");
|
||||
|
||||
sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n");
|
||||
sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n");
|
||||
sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n");
|
||||
sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n");
|
||||
sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n");
|
||||
sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n");
|
||||
sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n");
|
||||
sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,86 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.server.model.ModelFile;
|
||||
|
||||
|
||||
|
||||
public class FileSchemaTestClass {
|
||||
|
||||
private ModelFile _file;
|
||||
private List<ModelFile> files = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public FileSchemaTestClass() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create FileSchemaTestClass.
|
||||
*
|
||||
* @param _file _file
|
||||
* @param files files
|
||||
*/
|
||||
public FileSchemaTestClass(
|
||||
ModelFile _file,
|
||||
List<ModelFile> files
|
||||
) {
|
||||
this._file = _file;
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get _file
|
||||
* @return _file
|
||||
*/
|
||||
public ModelFile getFile() {
|
||||
return _file;
|
||||
}
|
||||
|
||||
public void setFile(ModelFile _file) {
|
||||
this._file = _file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get files
|
||||
* @return files
|
||||
*/
|
||||
public List<ModelFile> getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(List<ModelFile> files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FileSchemaTestClass {\n");
|
||||
|
||||
sb.append(" _file: ").append(toIndentedString(_file)).append("\n");
|
||||
sb.append(" files: ").append(toIndentedString(files)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,66 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
|
||||
|
||||
|
||||
public class Foo {
|
||||
|
||||
private String bar = "bar";
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public Foo() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Foo.
|
||||
*
|
||||
* @param bar bar
|
||||
*/
|
||||
public Foo(
|
||||
String bar
|
||||
) {
|
||||
this.bar = bar;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get bar
|
||||
* @return bar
|
||||
*/
|
||||
public String getBar() {
|
||||
return bar;
|
||||
}
|
||||
|
||||
public void setBar(String bar) {
|
||||
this.bar = bar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Foo {\n");
|
||||
|
||||
sb.append(" bar: ").append(toIndentedString(bar)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,68 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import org.openapitools.server.model.Foo;
|
||||
|
||||
|
||||
|
||||
public class FooGetDefaultResponse {
|
||||
|
||||
private Foo string;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public FooGetDefaultResponse() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create FooGetDefaultResponse.
|
||||
*
|
||||
* @param string string
|
||||
*/
|
||||
public FooGetDefaultResponse(
|
||||
Foo string
|
||||
) {
|
||||
this.string = string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get string
|
||||
* @return string
|
||||
*/
|
||||
public Foo getString() {
|
||||
return string;
|
||||
}
|
||||
|
||||
public void setString(Foo string) {
|
||||
this.string = string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FooGetDefaultResponse {\n");
|
||||
|
||||
sb.append(" string: ").append(toIndentedString(string)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,337 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
|
||||
public class FormatTest {
|
||||
|
||||
private Integer integer;
|
||||
private Integer int32;
|
||||
private Long int64;
|
||||
private BigDecimal number;
|
||||
private Float _float;
|
||||
private Double _double;
|
||||
private BigDecimal decimal;
|
||||
private String string;
|
||||
private byte[] _byte;
|
||||
private File binary;
|
||||
private LocalDate date;
|
||||
private OffsetDateTime dateTime;
|
||||
private UUID uuid;
|
||||
private String password;
|
||||
private String patternWithDigits;
|
||||
private String patternWithDigitsAndDelimiter;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public FormatTest() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create FormatTest.
|
||||
*
|
||||
* @param integer integer
|
||||
* @param int32 int32
|
||||
* @param int64 int64
|
||||
* @param number number
|
||||
* @param _float _float
|
||||
* @param _double _double
|
||||
* @param decimal decimal
|
||||
* @param string string
|
||||
* @param _byte _byte
|
||||
* @param binary binary
|
||||
* @param date date
|
||||
* @param dateTime dateTime
|
||||
* @param uuid uuid
|
||||
* @param password password
|
||||
* @param patternWithDigits A string that is a 10 digit number. Can have leading zeros.
|
||||
* @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
|
||||
*/
|
||||
public FormatTest(
|
||||
Integer integer,
|
||||
Integer int32,
|
||||
Long int64,
|
||||
BigDecimal number,
|
||||
Float _float,
|
||||
Double _double,
|
||||
BigDecimal decimal,
|
||||
String string,
|
||||
byte[] _byte,
|
||||
File binary,
|
||||
LocalDate date,
|
||||
OffsetDateTime dateTime,
|
||||
UUID uuid,
|
||||
String password,
|
||||
String patternWithDigits,
|
||||
String patternWithDigitsAndDelimiter
|
||||
) {
|
||||
this.integer = integer;
|
||||
this.int32 = int32;
|
||||
this.int64 = int64;
|
||||
this.number = number;
|
||||
this._float = _float;
|
||||
this._double = _double;
|
||||
this.decimal = decimal;
|
||||
this.string = string;
|
||||
this._byte = _byte;
|
||||
this.binary = binary;
|
||||
this.date = date;
|
||||
this.dateTime = dateTime;
|
||||
this.uuid = uuid;
|
||||
this.password = password;
|
||||
this.patternWithDigits = patternWithDigits;
|
||||
this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get integer
|
||||
* minimum: 10
|
||||
* maximum: 100
|
||||
* @return integer
|
||||
*/
|
||||
public Integer getInteger() {
|
||||
return integer;
|
||||
}
|
||||
|
||||
public void setInteger(Integer integer) {
|
||||
this.integer = integer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get int32
|
||||
* minimum: 20
|
||||
* maximum: 200
|
||||
* @return int32
|
||||
*/
|
||||
public Integer getInt32() {
|
||||
return int32;
|
||||
}
|
||||
|
||||
public void setInt32(Integer int32) {
|
||||
this.int32 = int32;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get int64
|
||||
* @return int64
|
||||
*/
|
||||
public Long getInt64() {
|
||||
return int64;
|
||||
}
|
||||
|
||||
public void setInt64(Long int64) {
|
||||
this.int64 = int64;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get number
|
||||
* minimum: 32.1
|
||||
* maximum: 543.2
|
||||
* @return number
|
||||
*/
|
||||
public BigDecimal getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(BigDecimal number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _float
|
||||
* minimum: 54.3
|
||||
* maximum: 987.6
|
||||
* @return _float
|
||||
*/
|
||||
public Float getFloat() {
|
||||
return _float;
|
||||
}
|
||||
|
||||
public void setFloat(Float _float) {
|
||||
this._float = _float;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _double
|
||||
* minimum: 67.8
|
||||
* maximum: 123.4
|
||||
* @return _double
|
||||
*/
|
||||
public Double getDouble() {
|
||||
return _double;
|
||||
}
|
||||
|
||||
public void setDouble(Double _double) {
|
||||
this._double = _double;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get decimal
|
||||
* @return decimal
|
||||
*/
|
||||
public BigDecimal getDecimal() {
|
||||
return decimal;
|
||||
}
|
||||
|
||||
public void setDecimal(BigDecimal decimal) {
|
||||
this.decimal = decimal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get string
|
||||
* @return string
|
||||
*/
|
||||
public String getString() {
|
||||
return string;
|
||||
}
|
||||
|
||||
public void setString(String string) {
|
||||
this.string = string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _byte
|
||||
* @return _byte
|
||||
*/
|
||||
public byte[] getByte() {
|
||||
return _byte;
|
||||
}
|
||||
|
||||
public void setByte(byte[] _byte) {
|
||||
this._byte = _byte;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get binary
|
||||
* @return binary
|
||||
*/
|
||||
public File getBinary() {
|
||||
return binary;
|
||||
}
|
||||
|
||||
public void setBinary(File binary) {
|
||||
this.binary = binary;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get date
|
||||
* @return date
|
||||
*/
|
||||
public LocalDate getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public void setDate(LocalDate date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dateTime
|
||||
* @return dateTime
|
||||
*/
|
||||
public OffsetDateTime getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
|
||||
public void setDateTime(OffsetDateTime dateTime) {
|
||||
this.dateTime = dateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get uuid
|
||||
* @return uuid
|
||||
*/
|
||||
public UUID getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(UUID uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get password
|
||||
* @return password
|
||||
*/
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
/**
|
||||
* A string that is a 10 digit number. Can have leading zeros.
|
||||
* @return patternWithDigits
|
||||
*/
|
||||
public String getPatternWithDigits() {
|
||||
return patternWithDigits;
|
||||
}
|
||||
|
||||
public void setPatternWithDigits(String patternWithDigits) {
|
||||
this.patternWithDigits = patternWithDigits;
|
||||
}
|
||||
|
||||
/**
|
||||
* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
|
||||
* @return patternWithDigitsAndDelimiter
|
||||
*/
|
||||
public String getPatternWithDigitsAndDelimiter() {
|
||||
return patternWithDigitsAndDelimiter;
|
||||
}
|
||||
|
||||
public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) {
|
||||
this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FormatTest {\n");
|
||||
|
||||
sb.append(" integer: ").append(toIndentedString(integer)).append("\n");
|
||||
sb.append(" int32: ").append(toIndentedString(int32)).append("\n");
|
||||
sb.append(" int64: ").append(toIndentedString(int64)).append("\n");
|
||||
sb.append(" number: ").append(toIndentedString(number)).append("\n");
|
||||
sb.append(" _float: ").append(toIndentedString(_float)).append("\n");
|
||||
sb.append(" _double: ").append(toIndentedString(_double)).append("\n");
|
||||
sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n");
|
||||
sb.append(" string: ").append(toIndentedString(string)).append("\n");
|
||||
sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n");
|
||||
sb.append(" binary: ").append(toIndentedString(binary)).append("\n");
|
||||
sb.append(" date: ").append(toIndentedString(date)).append("\n");
|
||||
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
|
||||
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
|
||||
sb.append(" password: ").append(toIndentedString(password)).append("\n");
|
||||
sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n");
|
||||
sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,84 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
|
||||
|
||||
public class HasOnlyReadOnly {
|
||||
|
||||
private String bar;
|
||||
private String foo;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public HasOnlyReadOnly() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create HasOnlyReadOnly.
|
||||
*
|
||||
* @param bar bar
|
||||
* @param foo foo
|
||||
*/
|
||||
public HasOnlyReadOnly(
|
||||
String bar,
|
||||
String foo
|
||||
) {
|
||||
this.bar = bar;
|
||||
this.foo = foo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get bar
|
||||
* @return bar
|
||||
*/
|
||||
public String getBar() {
|
||||
return bar;
|
||||
}
|
||||
|
||||
public void setBar(String bar) {
|
||||
this.bar = bar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get foo
|
||||
* @return foo
|
||||
*/
|
||||
public String getFoo() {
|
||||
return foo;
|
||||
}
|
||||
|
||||
public void setFoo(String foo) {
|
||||
this.foo = foo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class HasOnlyReadOnly {\n");
|
||||
|
||||
sb.append(" bar: ").append(toIndentedString(bar)).append("\n");
|
||||
sb.append(" foo: ").append(toIndentedString(foo)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,69 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
|
||||
|
||||
/**
|
||||
* Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
|
||||
*/
|
||||
public class HealthCheckResult {
|
||||
|
||||
private String nullableMessage;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public HealthCheckResult() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create HealthCheckResult.
|
||||
*
|
||||
* @param nullableMessage nullableMessage
|
||||
*/
|
||||
public HealthCheckResult(
|
||||
String nullableMessage
|
||||
) {
|
||||
this.nullableMessage = nullableMessage;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get nullableMessage
|
||||
* @return nullableMessage
|
||||
*/
|
||||
public String getNullableMessage() {
|
||||
return nullableMessage;
|
||||
}
|
||||
|
||||
public void setNullableMessage(String nullableMessage) {
|
||||
this.nullableMessage = nullableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class HealthCheckResult {\n");
|
||||
|
||||
sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,159 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
||||
public class MapTest {
|
||||
|
||||
private Map<String, Map<String, String>> mapMapOfString = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Gets or Sets inner
|
||||
*/
|
||||
public enum InnerEnum {
|
||||
UPPER("UPPER"),
|
||||
LOWER("lower");
|
||||
|
||||
private String value;
|
||||
|
||||
InnerEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
|
||||
@JsonCreator
|
||||
public static InnerEnum fromValue(String text) {
|
||||
for (InnerEnum b : InnerEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + text + "'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Map<String, InnerEnum> mapOfEnumString = new HashMap<>();
|
||||
private Map<String, Boolean> directMap = new HashMap<>();
|
||||
private Map<String, Boolean> indirectMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public MapTest() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create MapTest.
|
||||
*
|
||||
* @param mapMapOfString mapMapOfString
|
||||
* @param mapOfEnumString mapOfEnumString
|
||||
* @param directMap directMap
|
||||
* @param indirectMap indirectMap
|
||||
*/
|
||||
public MapTest(
|
||||
Map<String, Map<String, String>> mapMapOfString,
|
||||
Map<String, InnerEnum> mapOfEnumString,
|
||||
Map<String, Boolean> directMap,
|
||||
Map<String, Boolean> indirectMap
|
||||
) {
|
||||
this.mapMapOfString = mapMapOfString;
|
||||
this.mapOfEnumString = mapOfEnumString;
|
||||
this.directMap = directMap;
|
||||
this.indirectMap = indirectMap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get mapMapOfString
|
||||
* @return mapMapOfString
|
||||
*/
|
||||
public Map<String, Map<String, String>> getMapMapOfString() {
|
||||
return mapMapOfString;
|
||||
}
|
||||
|
||||
public void setMapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
|
||||
this.mapMapOfString = mapMapOfString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mapOfEnumString
|
||||
* @return mapOfEnumString
|
||||
*/
|
||||
public Map<String, InnerEnum> getMapOfEnumString() {
|
||||
return mapOfEnumString;
|
||||
}
|
||||
|
||||
public void setMapOfEnumString(Map<String, InnerEnum> mapOfEnumString) {
|
||||
this.mapOfEnumString = mapOfEnumString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get directMap
|
||||
* @return directMap
|
||||
*/
|
||||
public Map<String, Boolean> getDirectMap() {
|
||||
return directMap;
|
||||
}
|
||||
|
||||
public void setDirectMap(Map<String, Boolean> directMap) {
|
||||
this.directMap = directMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get indirectMap
|
||||
* @return indirectMap
|
||||
*/
|
||||
public Map<String, Boolean> getIndirectMap() {
|
||||
return indirectMap;
|
||||
}
|
||||
|
||||
public void setIndirectMap(Map<String, Boolean> indirectMap) {
|
||||
this.indirectMap = indirectMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class MapTest {\n");
|
||||
|
||||
sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
|
||||
sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
|
||||
sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n");
|
||||
sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,106 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import org.openapitools.server.model.Animal;
|
||||
|
||||
|
||||
|
||||
public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
|
||||
private UUID uuid;
|
||||
private OffsetDateTime dateTime;
|
||||
private Map<String, Animal> map = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public MixedPropertiesAndAdditionalPropertiesClass() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create MixedPropertiesAndAdditionalPropertiesClass.
|
||||
*
|
||||
* @param uuid uuid
|
||||
* @param dateTime dateTime
|
||||
* @param map map
|
||||
*/
|
||||
public MixedPropertiesAndAdditionalPropertiesClass(
|
||||
UUID uuid,
|
||||
OffsetDateTime dateTime,
|
||||
Map<String, Animal> map
|
||||
) {
|
||||
this.uuid = uuid;
|
||||
this.dateTime = dateTime;
|
||||
this.map = map;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get uuid
|
||||
* @return uuid
|
||||
*/
|
||||
public UUID getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(UUID uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dateTime
|
||||
* @return dateTime
|
||||
*/
|
||||
public OffsetDateTime getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
|
||||
public void setDateTime(OffsetDateTime dateTime) {
|
||||
this.dateTime = dateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get map
|
||||
* @return map
|
||||
*/
|
||||
public Map<String, Animal> getMap() {
|
||||
return map;
|
||||
}
|
||||
|
||||
public void setMap(Map<String, Animal> map) {
|
||||
this.map = map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n");
|
||||
|
||||
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
|
||||
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
|
||||
sb.append(" map: ").append(toIndentedString(map)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,86 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
|
||||
/**
|
||||
* Model for testing model name starting with number
|
||||
*/
|
||||
public class Model200Response {
|
||||
|
||||
private Integer name;
|
||||
private String propertyClass;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public Model200Response() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Model200Response.
|
||||
*
|
||||
* @param name name
|
||||
* @param propertyClass propertyClass
|
||||
*/
|
||||
public Model200Response(
|
||||
Integer name,
|
||||
String propertyClass
|
||||
) {
|
||||
this.name = name;
|
||||
this.propertyClass = propertyClass;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
*/
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(Integer name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get propertyClass
|
||||
* @return propertyClass
|
||||
*/
|
||||
public String getPropertyClass() {
|
||||
return propertyClass;
|
||||
}
|
||||
|
||||
public void setPropertyClass(String propertyClass) {
|
||||
this.propertyClass = propertyClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Model200Response {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,101 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
|
||||
|
||||
public class ModelApiResponse {
|
||||
|
||||
private Integer code;
|
||||
private String type;
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public ModelApiResponse() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create ModelApiResponse.
|
||||
*
|
||||
* @param code code
|
||||
* @param type type
|
||||
* @param message message
|
||||
*/
|
||||
public ModelApiResponse(
|
||||
Integer code,
|
||||
String type,
|
||||
String message
|
||||
) {
|
||||
this.code = code;
|
||||
this.type = type;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get code
|
||||
* @return code
|
||||
*/
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type
|
||||
* @return type
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get message
|
||||
* @return message
|
||||
*/
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelApiResponse {\n");
|
||||
|
||||
sb.append(" code: ").append(toIndentedString(code)).append("\n");
|
||||
sb.append(" type: ").append(toIndentedString(type)).append("\n");
|
||||
sb.append(" message: ").append(toIndentedString(message)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,69 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
|
||||
/**
|
||||
* Must be named `File` for test.
|
||||
*/
|
||||
public class ModelFile {
|
||||
|
||||
private String sourceURI;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public ModelFile() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create ModelFile.
|
||||
*
|
||||
* @param sourceURI Test capitalization
|
||||
*/
|
||||
public ModelFile(
|
||||
String sourceURI
|
||||
) {
|
||||
this.sourceURI = sourceURI;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Test capitalization
|
||||
* @return sourceURI
|
||||
*/
|
||||
public String getSourceURI() {
|
||||
return sourceURI;
|
||||
}
|
||||
|
||||
public void setSourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelFile {\n");
|
||||
|
||||
sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,67 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
|
||||
|
||||
public class ModelList {
|
||||
|
||||
private String _123list;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public ModelList() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create ModelList.
|
||||
*
|
||||
* @param _123list _123list
|
||||
*/
|
||||
public ModelList(
|
||||
String _123list
|
||||
) {
|
||||
this._123list = _123list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get _123list
|
||||
* @return _123list
|
||||
*/
|
||||
public String get123list() {
|
||||
return _123list;
|
||||
}
|
||||
|
||||
public void set123list(String _123list) {
|
||||
this._123list = _123list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelList {\n");
|
||||
|
||||
sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,69 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
|
||||
/**
|
||||
* Model for testing reserved words
|
||||
*/
|
||||
public class ModelReturn {
|
||||
|
||||
private Integer _return;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public ModelReturn() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create ModelReturn.
|
||||
*
|
||||
* @param _return _return
|
||||
*/
|
||||
public ModelReturn(
|
||||
Integer _return
|
||||
) {
|
||||
this._return = _return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get _return
|
||||
* @return _return
|
||||
*/
|
||||
public Integer getReturn() {
|
||||
return _return;
|
||||
}
|
||||
|
||||
public void setReturn(Integer _return) {
|
||||
this._return = _return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelReturn {\n");
|
||||
|
||||
sb.append(" _return: ").append(toIndentedString(_return)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,119 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Model for testing model name same as property name
|
||||
*/
|
||||
public class Name {
|
||||
|
||||
private Integer name;
|
||||
private Integer snakeCase;
|
||||
private String property;
|
||||
private Integer _123number;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public Name() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Name.
|
||||
*
|
||||
* @param name name
|
||||
* @param snakeCase snakeCase
|
||||
* @param property property
|
||||
* @param _123number _123number
|
||||
*/
|
||||
public Name(
|
||||
Integer name,
|
||||
Integer snakeCase,
|
||||
String property,
|
||||
Integer _123number
|
||||
) {
|
||||
this.name = name;
|
||||
this.snakeCase = snakeCase;
|
||||
this.property = property;
|
||||
this._123number = _123number;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
*/
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(Integer name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get snakeCase
|
||||
* @return snakeCase
|
||||
*/
|
||||
public Integer getSnakeCase() {
|
||||
return snakeCase;
|
||||
}
|
||||
|
||||
public void setSnakeCase(Integer snakeCase) {
|
||||
this.snakeCase = snakeCase;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get property
|
||||
* @return property
|
||||
*/
|
||||
public String getProperty() {
|
||||
return property;
|
||||
}
|
||||
|
||||
public void setProperty(String property) {
|
||||
this.property = property;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _123number
|
||||
* @return _123number
|
||||
*/
|
||||
public Integer get123number() {
|
||||
return _123number;
|
||||
}
|
||||
|
||||
public void set123number(Integer _123number) {
|
||||
this._123number = _123number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Name {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n");
|
||||
sb.append(" property: ").append(toIndentedString(property)).append("\n");
|
||||
sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,261 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.openapitools.jackson.nullable.JsonNullable;
|
||||
|
||||
|
||||
|
||||
public class NullableClass extends HashMap<String, Object> {
|
||||
|
||||
private Integer integerProp;
|
||||
private BigDecimal numberProp;
|
||||
private Boolean booleanProp;
|
||||
private String stringProp;
|
||||
private LocalDate dateProp;
|
||||
private OffsetDateTime datetimeProp;
|
||||
private List<Object> arrayNullableProp = new ArrayList<>();
|
||||
private List<Object> arrayAndItemsNullableProp = new ArrayList<>();
|
||||
private List<Object> arrayItemsNullable = new ArrayList<>();
|
||||
private Map<String, Object> objectNullableProp = new HashMap<>();
|
||||
private Map<String, Object> objectAndItemsNullableProp = new HashMap<>();
|
||||
private Map<String, Object> objectItemsNullable = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public NullableClass() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create NullableClass.
|
||||
*
|
||||
* @param integerProp integerProp
|
||||
* @param numberProp numberProp
|
||||
* @param booleanProp booleanProp
|
||||
* @param stringProp stringProp
|
||||
* @param dateProp dateProp
|
||||
* @param datetimeProp datetimeProp
|
||||
* @param arrayNullableProp arrayNullableProp
|
||||
* @param arrayAndItemsNullableProp arrayAndItemsNullableProp
|
||||
* @param arrayItemsNullable arrayItemsNullable
|
||||
* @param objectNullableProp objectNullableProp
|
||||
* @param objectAndItemsNullableProp objectAndItemsNullableProp
|
||||
* @param objectItemsNullable objectItemsNullable
|
||||
*/
|
||||
public NullableClass(
|
||||
Integer integerProp,
|
||||
BigDecimal numberProp,
|
||||
Boolean booleanProp,
|
||||
String stringProp,
|
||||
LocalDate dateProp,
|
||||
OffsetDateTime datetimeProp,
|
||||
List<Object> arrayNullableProp,
|
||||
List<Object> arrayAndItemsNullableProp,
|
||||
List<Object> arrayItemsNullable,
|
||||
Map<String, Object> objectNullableProp,
|
||||
Map<String, Object> objectAndItemsNullableProp,
|
||||
Map<String, Object> objectItemsNullable
|
||||
) {
|
||||
this.integerProp = integerProp;
|
||||
this.numberProp = numberProp;
|
||||
this.booleanProp = booleanProp;
|
||||
this.stringProp = stringProp;
|
||||
this.dateProp = dateProp;
|
||||
this.datetimeProp = datetimeProp;
|
||||
this.arrayNullableProp = arrayNullableProp;
|
||||
this.arrayAndItemsNullableProp = arrayAndItemsNullableProp;
|
||||
this.arrayItemsNullable = arrayItemsNullable;
|
||||
this.objectNullableProp = objectNullableProp;
|
||||
this.objectAndItemsNullableProp = objectAndItemsNullableProp;
|
||||
this.objectItemsNullable = objectItemsNullable;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get integerProp
|
||||
* @return integerProp
|
||||
*/
|
||||
public Integer getIntegerProp() {
|
||||
return integerProp;
|
||||
}
|
||||
|
||||
public void setIntegerProp(Integer integerProp) {
|
||||
this.integerProp = integerProp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get numberProp
|
||||
* @return numberProp
|
||||
*/
|
||||
public BigDecimal getNumberProp() {
|
||||
return numberProp;
|
||||
}
|
||||
|
||||
public void setNumberProp(BigDecimal numberProp) {
|
||||
this.numberProp = numberProp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get booleanProp
|
||||
* @return booleanProp
|
||||
*/
|
||||
public Boolean getBooleanProp() {
|
||||
return booleanProp;
|
||||
}
|
||||
|
||||
public void setBooleanProp(Boolean booleanProp) {
|
||||
this.booleanProp = booleanProp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get stringProp
|
||||
* @return stringProp
|
||||
*/
|
||||
public String getStringProp() {
|
||||
return stringProp;
|
||||
}
|
||||
|
||||
public void setStringProp(String stringProp) {
|
||||
this.stringProp = stringProp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dateProp
|
||||
* @return dateProp
|
||||
*/
|
||||
public LocalDate getDateProp() {
|
||||
return dateProp;
|
||||
}
|
||||
|
||||
public void setDateProp(LocalDate dateProp) {
|
||||
this.dateProp = dateProp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get datetimeProp
|
||||
* @return datetimeProp
|
||||
*/
|
||||
public OffsetDateTime getDatetimeProp() {
|
||||
return datetimeProp;
|
||||
}
|
||||
|
||||
public void setDatetimeProp(OffsetDateTime datetimeProp) {
|
||||
this.datetimeProp = datetimeProp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayNullableProp
|
||||
* @return arrayNullableProp
|
||||
*/
|
||||
public List<Object> getArrayNullableProp() {
|
||||
return arrayNullableProp;
|
||||
}
|
||||
|
||||
public void setArrayNullableProp(List<Object> arrayNullableProp) {
|
||||
this.arrayNullableProp = arrayNullableProp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayAndItemsNullableProp
|
||||
* @return arrayAndItemsNullableProp
|
||||
*/
|
||||
public List<Object> getArrayAndItemsNullableProp() {
|
||||
return arrayAndItemsNullableProp;
|
||||
}
|
||||
|
||||
public void setArrayAndItemsNullableProp(List<Object> arrayAndItemsNullableProp) {
|
||||
this.arrayAndItemsNullableProp = arrayAndItemsNullableProp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayItemsNullable
|
||||
* @return arrayItemsNullable
|
||||
*/
|
||||
public List<Object> getArrayItemsNullable() {
|
||||
return arrayItemsNullable;
|
||||
}
|
||||
|
||||
public void setArrayItemsNullable(List<Object> arrayItemsNullable) {
|
||||
this.arrayItemsNullable = arrayItemsNullable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get objectNullableProp
|
||||
* @return objectNullableProp
|
||||
*/
|
||||
public Map<String, Object> getObjectNullableProp() {
|
||||
return objectNullableProp;
|
||||
}
|
||||
|
||||
public void setObjectNullableProp(Map<String, Object> objectNullableProp) {
|
||||
this.objectNullableProp = objectNullableProp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get objectAndItemsNullableProp
|
||||
* @return objectAndItemsNullableProp
|
||||
*/
|
||||
public Map<String, Object> getObjectAndItemsNullableProp() {
|
||||
return objectAndItemsNullableProp;
|
||||
}
|
||||
|
||||
public void setObjectAndItemsNullableProp(Map<String, Object> objectAndItemsNullableProp) {
|
||||
this.objectAndItemsNullableProp = objectAndItemsNullableProp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get objectItemsNullable
|
||||
* @return objectItemsNullable
|
||||
*/
|
||||
public Map<String, Object> getObjectItemsNullable() {
|
||||
return objectItemsNullable;
|
||||
}
|
||||
|
||||
public void setObjectItemsNullable(Map<String, Object> objectItemsNullable) {
|
||||
this.objectItemsNullable = objectItemsNullable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class NullableClass {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n");
|
||||
sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n");
|
||||
sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n");
|
||||
sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n");
|
||||
sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n");
|
||||
sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n");
|
||||
sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n");
|
||||
sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n");
|
||||
sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n");
|
||||
sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n");
|
||||
sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n");
|
||||
sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,67 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
|
||||
public class NumberOnly {
|
||||
|
||||
private BigDecimal justNumber;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public NumberOnly() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create NumberOnly.
|
||||
*
|
||||
* @param justNumber justNumber
|
||||
*/
|
||||
public NumberOnly(
|
||||
BigDecimal justNumber
|
||||
) {
|
||||
this.justNumber = justNumber;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get justNumber
|
||||
* @return justNumber
|
||||
*/
|
||||
public BigDecimal getJustNumber() {
|
||||
return justNumber;
|
||||
}
|
||||
|
||||
public void setJustNumber(BigDecimal justNumber) {
|
||||
this.justNumber = justNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class NumberOnly {\n");
|
||||
|
||||
sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,121 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.openapitools.server.model.DeprecatedObject;
|
||||
|
||||
|
||||
|
||||
public class ObjectWithDeprecatedFields {
|
||||
|
||||
private String uuid;
|
||||
private BigDecimal id;
|
||||
private DeprecatedObject deprecatedRef;
|
||||
private List<String> bars = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public ObjectWithDeprecatedFields() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create ObjectWithDeprecatedFields.
|
||||
*
|
||||
* @param uuid uuid
|
||||
* @param id id
|
||||
* @param deprecatedRef deprecatedRef
|
||||
* @param bars bars
|
||||
*/
|
||||
public ObjectWithDeprecatedFields(
|
||||
String uuid,
|
||||
BigDecimal id,
|
||||
DeprecatedObject deprecatedRef,
|
||||
List<String> bars
|
||||
) {
|
||||
this.uuid = uuid;
|
||||
this.id = id;
|
||||
this.deprecatedRef = deprecatedRef;
|
||||
this.bars = bars;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get uuid
|
||||
* @return uuid
|
||||
*/
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
*/
|
||||
public BigDecimal getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(BigDecimal id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get deprecatedRef
|
||||
* @return deprecatedRef
|
||||
*/
|
||||
public DeprecatedObject getDeprecatedRef() {
|
||||
return deprecatedRef;
|
||||
}
|
||||
|
||||
public void setDeprecatedRef(DeprecatedObject deprecatedRef) {
|
||||
this.deprecatedRef = deprecatedRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get bars
|
||||
* @return bars
|
||||
*/
|
||||
public List<String> getBars() {
|
||||
return bars;
|
||||
}
|
||||
|
||||
public void setBars(List<String> bars) {
|
||||
this.bars = bars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ObjectWithDeprecatedFields {\n");
|
||||
|
||||
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n");
|
||||
sb.append(" bars: ").append(toIndentedString(bars)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,192 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.time.OffsetDateTime;
|
||||
|
||||
|
||||
|
||||
public class Order {
|
||||
|
||||
private Long id;
|
||||
private Long petId;
|
||||
private Integer quantity;
|
||||
private OffsetDateTime shipDate;
|
||||
|
||||
/**
|
||||
* Order Status
|
||||
*/
|
||||
public enum StatusEnum {
|
||||
PLACED("placed"),
|
||||
APPROVED("approved"),
|
||||
DELIVERED("delivered");
|
||||
|
||||
private String value;
|
||||
|
||||
StatusEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
|
||||
@JsonCreator
|
||||
public static StatusEnum fromValue(String text) {
|
||||
for (StatusEnum b : StatusEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + text + "'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private StatusEnum status;
|
||||
private Boolean complete = false;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public Order() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Order.
|
||||
*
|
||||
* @param id id
|
||||
* @param petId petId
|
||||
* @param quantity quantity
|
||||
* @param shipDate shipDate
|
||||
* @param status Order Status
|
||||
* @param complete complete
|
||||
*/
|
||||
public Order(
|
||||
Long id,
|
||||
Long petId,
|
||||
Integer quantity,
|
||||
OffsetDateTime shipDate,
|
||||
StatusEnum status,
|
||||
Boolean complete
|
||||
) {
|
||||
this.id = id;
|
||||
this.petId = petId;
|
||||
this.quantity = quantity;
|
||||
this.shipDate = shipDate;
|
||||
this.status = status;
|
||||
this.complete = complete;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get petId
|
||||
* @return petId
|
||||
*/
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
}
|
||||
|
||||
public void setPetId(Long petId) {
|
||||
this.petId = petId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get quantity
|
||||
* @return quantity
|
||||
*/
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get shipDate
|
||||
* @return shipDate
|
||||
*/
|
||||
public OffsetDateTime getShipDate() {
|
||||
return shipDate;
|
||||
}
|
||||
|
||||
public void setShipDate(OffsetDateTime shipDate) {
|
||||
this.shipDate = shipDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Order Status
|
||||
* @return status
|
||||
*/
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(StatusEnum status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get complete
|
||||
* @return complete
|
||||
*/
|
||||
public Boolean getComplete() {
|
||||
return complete;
|
||||
}
|
||||
|
||||
public void setComplete(Boolean complete) {
|
||||
this.complete = complete;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Order {\n");
|
||||
|
||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
||||
sb.append(" petId: ").append(toIndentedString(petId)).append("\n");
|
||||
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
|
||||
sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n");
|
||||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
||||
sb.append(" complete: ").append(toIndentedString(complete)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,101 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
|
||||
public class OuterComposite {
|
||||
|
||||
private BigDecimal myNumber;
|
||||
private String myString;
|
||||
private Boolean myBoolean;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public OuterComposite() {
|
||||
// JSON-B / Jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Create OuterComposite.
|
||||
*
|
||||
* @param myNumber myNumber
|
||||
* @param myString myString
|
||||
* @param myBoolean myBoolean
|
||||
*/
|
||||
public OuterComposite(
|
||||
BigDecimal myNumber,
|
||||
String myString,
|
||||
Boolean myBoolean
|
||||
) {
|
||||
this.myNumber = myNumber;
|
||||
this.myString = myString;
|
||||
this.myBoolean = myBoolean;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get myNumber
|
||||
* @return myNumber
|
||||
*/
|
||||
public BigDecimal getMyNumber() {
|
||||
return myNumber;
|
||||
}
|
||||
|
||||
public void setMyNumber(BigDecimal myNumber) {
|
||||
this.myNumber = myNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get myString
|
||||
* @return myString
|
||||
*/
|
||||
public String getMyString() {
|
||||
return myString;
|
||||
}
|
||||
|
||||
public void setMyString(String myString) {
|
||||
this.myString = myString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get myBoolean
|
||||
* @return myBoolean
|
||||
*/
|
||||
public Boolean getMyBoolean() {
|
||||
return myBoolean;
|
||||
}
|
||||
|
||||
public void setMyBoolean(Boolean myBoolean) {
|
||||
this.myBoolean = myBoolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a string representation of this pojo.
|
||||
**/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class OuterComposite {\n");
|
||||
|
||||
sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n");
|
||||
sb.append(" myString: ").append(toIndentedString(myString)).append("\n");
|
||||
sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private static String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,44 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
/**
|
||||
* Gets or Sets OuterEnum
|
||||
*/
|
||||
|
||||
public enum OuterEnum {
|
||||
|
||||
PLACED("placed"),
|
||||
APPROVED("approved"),
|
||||
DELIVERED("delivered");
|
||||
|
||||
private String value;
|
||||
|
||||
OuterEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static OuterEnum fromValue(String text) {
|
||||
for (OuterEnum b : OuterEnum.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + text + "'");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,44 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
/**
|
||||
* Gets or Sets OuterEnumDefaultValue
|
||||
*/
|
||||
|
||||
public enum OuterEnumDefaultValue {
|
||||
|
||||
PLACED("placed"),
|
||||
APPROVED("approved"),
|
||||
DELIVERED("delivered");
|
||||
|
||||
private String value;
|
||||
|
||||
OuterEnumDefaultValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static OuterEnumDefaultValue fromValue(String text) {
|
||||
for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + text + "'");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,44 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
/**
|
||||
* Gets or Sets OuterEnumInteger
|
||||
*/
|
||||
|
||||
public enum OuterEnumInteger {
|
||||
|
||||
NUMBER_0(0),
|
||||
NUMBER_1(1),
|
||||
NUMBER_2(2);
|
||||
|
||||
private Integer value;
|
||||
|
||||
OuterEnumInteger(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static OuterEnumInteger fromValue(String text) {
|
||||
for (OuterEnumInteger b : OuterEnumInteger.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + text + "'");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,44 @@
|
||||
package org.openapitools.server.model;
|
||||
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
/**
|
||||
* Gets or Sets OuterEnumIntegerDefaultValue
|
||||
*/
|
||||
|
||||
public enum OuterEnumIntegerDefaultValue {
|
||||
|
||||
NUMBER_0(0),
|
||||
NUMBER_1(1),
|
||||
NUMBER_2(2);
|
||||
|
||||
private Integer value;
|
||||
|
||||
OuterEnumIntegerDefaultValue(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static OuterEnumIntegerDefaultValue fromValue(String text) {
|
||||
for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) {
|
||||
if (String.valueOf(b.value).equals(text)) {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected value '" + text + "'");
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user