forked from loafle/openapi-generator-original
Merge pull request #3506 from wing328/fix_array_enum
[JaxRS][PHP] Fix issue with enum
This commit is contained in:
commit
81f981c54d
1
.gitignore
vendored
1
.gitignore
vendored
@ -56,6 +56,7 @@ samples/client/petstore/qt5cpp/PetStore/Makefile
|
||||
#Java/Android
|
||||
**/.gradle
|
||||
samples/client/petstore/java/hello.txt
|
||||
samples/client/petstore/java/okhttp-gson/hello.txt
|
||||
samples/client/petstore/java/jersey2-java8/hello.txt
|
||||
samples/client/petstore/android/default/hello.txt
|
||||
samples/client/petstore/android/volley/.gradle/
|
||||
|
@ -26,7 +26,7 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaJaxRS -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l jaxrs -o samples/server/petstore/jaxrs/jersey2 -DhideGenerationTimestamp=true"
|
||||
ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaJaxRS -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs -o samples/server/petstore/jaxrs/jersey2 -DhideGenerationTimestamp=true"
|
||||
|
||||
echo "Removing files and folders under samples/server/petstore/jaxrs/jersey2/src/main"
|
||||
rm -rf samples/server/petstore/jaxrs/jersey2/src/main
|
||||
|
@ -46,6 +46,8 @@ public class CodegenProperty implements Cloneable {
|
||||
public Boolean hasValidation; // true if pattern, maximum, etc are set (only used in the mustache template)
|
||||
public Boolean isInherited;
|
||||
public String nameInCamelCase; // property name in camel case
|
||||
// enum name based on the property name, usually use as a prefix (e.g. VAR_NAME) for enum name (e.g. VAR_NAME_VALUE1)
|
||||
public String enumName;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
@ -111,6 +113,7 @@ public class CodegenProperty implements Cloneable {
|
||||
result = prime * result + ((isListContainer == null) ? 0 : isListContainer.hashCode());
|
||||
result = prime * result + Objects.hashCode(isInherited);
|
||||
result = prime * result + Objects.hashCode(nameInCamelCase);
|
||||
result = prime * result + Objects.hashCode(enumName);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -271,6 +274,9 @@ public class CodegenProperty implements Cloneable {
|
||||
if (!Objects.equals(this.nameInCamelCase, other.nameInCamelCase)) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.enumName, other.enumName)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1334,7 +1334,7 @@ public class DefaultCodegen {
|
||||
|
||||
property.name = toVarName(name);
|
||||
property.baseName = name;
|
||||
property.nameInCamelCase = camelize(name, false);
|
||||
property.nameInCamelCase = camelize(property.name, false);
|
||||
property.description = escapeText(p.getDescription());
|
||||
property.unescapedDescription = p.getDescription();
|
||||
property.getter = "get" + getterAndSetterCapitalize(name);
|
||||
@ -1559,6 +1559,7 @@ public class DefaultCodegen {
|
||||
// this can cause issues for clients which don't support enums
|
||||
if (property.isEnum) {
|
||||
property.datatypeWithEnum = toEnumName(property);
|
||||
property.enumName = toEnumName(property);
|
||||
} else {
|
||||
property.datatypeWithEnum = property.datatype;
|
||||
}
|
||||
@ -1606,11 +1607,14 @@ public class DefaultCodegen {
|
||||
property.items = innerProperty;
|
||||
// inner item is Enum
|
||||
if (isPropertyInnerMostEnum(property)) {
|
||||
// isEnum is set to true when the type is an enum
|
||||
// or the inner type of an array/map is an enum
|
||||
property.isEnum = true;
|
||||
// update datatypeWithEnum and default value for array
|
||||
// e.g. List<string> => List<StatusEnum>
|
||||
updateDataTypeWithEnumForArray(property);
|
||||
|
||||
// set allowable values to enum values (including array/map of enum)
|
||||
property.allowableValues = getInnerEnumAllowableValues(property);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1633,10 +1637,14 @@ public class DefaultCodegen {
|
||||
property.items = innerProperty;
|
||||
// inner item is Enum
|
||||
if (isPropertyInnerMostEnum(property)) {
|
||||
// isEnum is set to true when the type is an enum
|
||||
// or the inner type of an array/map is an enum
|
||||
property.isEnum = true;
|
||||
// update datatypeWithEnum and default value for map
|
||||
// e.g. Dictionary<string, string> => Dictionary<string, StatusEnum>
|
||||
updateDataTypeWithEnumForMap(property);
|
||||
// set allowable values to enum values (including array/map of enum)
|
||||
property.allowableValues = getInnerEnumAllowableValues(property);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1657,6 +1665,17 @@ public class DefaultCodegen {
|
||||
return currentProperty.isEnum;
|
||||
}
|
||||
|
||||
protected Map<String, Object> getInnerEnumAllowableValues(CodegenProperty property) {
|
||||
CodegenProperty currentProperty = property;
|
||||
while (currentProperty != null && (Boolean.TRUE.equals(currentProperty.isMapContainer)
|
||||
|| Boolean.TRUE.equals(currentProperty.isListContainer))) {
|
||||
currentProperty = currentProperty.items;
|
||||
}
|
||||
|
||||
return currentProperty.allowableValues;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update datatypeWithEnum for array container
|
||||
* @param property Codegen property
|
||||
@ -1670,9 +1689,13 @@ public class DefaultCodegen {
|
||||
// set both datatype and datetypeWithEnum as only the inner type is enum
|
||||
property.datatypeWithEnum = property.datatypeWithEnum.replace(baseItem.baseType, toEnumName(baseItem));
|
||||
|
||||
// naming the enum with respect to the language enum naming convention
|
||||
// e.g. remove [], {} from array/map of enum
|
||||
property.enumName = toEnumName(property);
|
||||
|
||||
// set default value for variable with inner enum
|
||||
if (property.defaultValue != null) {
|
||||
property.defaultValue = property.defaultValue.replace(property.items.baseType, toEnumName(property.items));
|
||||
property.defaultValue = property.defaultValue.replace(baseItem.baseType, toEnumName(baseItem));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1689,6 +1712,10 @@ public class DefaultCodegen {
|
||||
// set both datatype and datetypeWithEnum as only the inner type is enum
|
||||
property.datatypeWithEnum = property.datatypeWithEnum.replace(", " + baseItem.baseType, ", " + toEnumName(baseItem));
|
||||
|
||||
// naming the enum with respect to the language enum naming convention
|
||||
// e.g. remove [], {} from array/map of enum
|
||||
property.enumName = toEnumName(property);
|
||||
|
||||
// set default value for variable with inner enum
|
||||
if (property.defaultValue != null) {
|
||||
property.defaultValue = property.defaultValue.replace(", " + property.items.baseType, ", " + toEnumName(property.items));
|
||||
|
@ -645,6 +645,9 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
public String toEnumName(CodegenProperty property) {
|
||||
String enumName = underscore(toModelName(property.name)).toUpperCase();
|
||||
|
||||
// remove [] for array or map of enum
|
||||
enumName = enumName.replace("[]", "");
|
||||
|
||||
if (enumName.matches("\\d.*")) { // starts with number
|
||||
return "_" + enumName;
|
||||
} else {
|
||||
|
@ -5,6 +5,7 @@ import {{package}}.{{classname}}Service;
|
||||
import {{package}}.factories.{{classname}}ServiceFactory;
|
||||
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.jaxrs.*;
|
||||
|
||||
{{#imports}}import {{import}};
|
||||
{{/imports}}
|
||||
|
@ -1,17 +1,33 @@
|
||||
/**
|
||||
* {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}}
|
||||
*/
|
||||
public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} {
|
||||
{{#gson}}
|
||||
{{#allowableValues}}
|
||||
{{#enumVars}}
|
||||
@SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}})
|
||||
{{{name}}}({{{value}}}){{^-last}},
|
||||
{{/-last}}{{#-last}};{{/-last}}
|
||||
{{/enumVars}}
|
||||
{{/allowableValues}}
|
||||
{{/gson}}
|
||||
{{^gson}}
|
||||
{{#allowableValues}}
|
||||
{{#enumVars}}
|
||||
{{{name}}}({{{value}}}){{^-last}},
|
||||
{{/-last}}{{#-last}};{{/-last}}
|
||||
{{/enumVars}}
|
||||
{{/allowableValues}}
|
||||
{{/gson}}
|
||||
|
||||
public enum {{{datatypeWithEnum}}} {
|
||||
{{#allowableValues}}{{#enumVars}}{{{name}}}({{{value}}}){{^-last}},
|
||||
{{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}}
|
||||
private {{{datatype}}} value;
|
||||
|
||||
private String value;
|
||||
|
||||
{{{datatypeWithEnum}}}(String value) {
|
||||
{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{datatype}}} value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public String toString() {
|
||||
return value;
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,27 @@
|
||||
public enum {{classname}} {
|
||||
{{#allowableValues}}{{.}}{{^-last}}, {{/-last}}{{/allowableValues}}
|
||||
/**
|
||||
* {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}}
|
||||
*/
|
||||
public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} {
|
||||
{{#gson}}
|
||||
{{#allowableValues}}{{#enumVars}}
|
||||
@SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}})
|
||||
{{{name}}}({{{value}}}){{^-last}},
|
||||
{{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}}
|
||||
{{/gson}}
|
||||
{{^gson}}
|
||||
{{#allowableValues}}{{#enumVars}}
|
||||
{{{name}}}({{{value}}}){{^-last}},
|
||||
{{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}}
|
||||
{{/gson}}
|
||||
|
||||
private {{{dataType}}} value;
|
||||
|
||||
{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
@ -1,53 +1,102 @@
|
||||
{{#description}}@ApiModel(description = "{{{description}}}"){{/description}}
|
||||
/**
|
||||
* {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}
|
||||
*/{{#description}}
|
||||
@ApiModel(description = "{{{description}}}"){{/description}}
|
||||
{{>generatedAnnotation}}
|
||||
public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} {
|
||||
{{#vars}}{{#isEnum}}
|
||||
|
||||
{{>enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}}
|
||||
|
||||
{{>enumClass}}{{/items}}{{/items.isEnum}}
|
||||
private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};{{/vars}}
|
||||
|
||||
{{#vars}}
|
||||
/**{{#description}}
|
||||
* {{{description}}}{{/description}}{{#minimum}}
|
||||
* minimum: {{minimum}}{{/minimum}}{{#maximum}}
|
||||
* maximum: {{maximum}}{{/maximum}}
|
||||
**/
|
||||
{{#isEnum}}
|
||||
{{^isContainer}}
|
||||
{{>enumClass}}
|
||||
{{/isContainer}}
|
||||
{{/isEnum}}
|
||||
{{#items.isEnum}}
|
||||
{{#items}}
|
||||
{{^isContainer}}
|
||||
{{>enumClass}}
|
||||
{{/isContainer}}
|
||||
{{/items}}
|
||||
{{/items.isEnum}}
|
||||
{{#jackson}}
|
||||
@JsonProperty("{{baseName}}")
|
||||
{{/jackson}}
|
||||
{{#gson}}
|
||||
@SerializedName("{{baseName}}")
|
||||
{{/gson}}
|
||||
private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};
|
||||
|
||||
{{/vars}}
|
||||
{{#vars}}
|
||||
{{^isReadOnly}}
|
||||
public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) {
|
||||
this.{{name}} = {{name}};
|
||||
return this;
|
||||
}
|
||||
{{#isListContainer}}
|
||||
|
||||
{{#vendorExtensions.extraAnnotation}}{{vendorExtensions.extraAnnotation}}{{/vendorExtensions.extraAnnotation}}
|
||||
public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) {
|
||||
this.{{name}}.add({{name}}Item);
|
||||
return this;
|
||||
}
|
||||
{{/isListContainer}}
|
||||
{{#isMapContainer}}
|
||||
|
||||
public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) {
|
||||
this.{{name}}.put(key, {{name}}Item);
|
||||
return this;
|
||||
}
|
||||
{{/isMapContainer}}
|
||||
|
||||
{{/isReadOnly}}
|
||||
/**
|
||||
{{#description}}
|
||||
* {{{description}}}
|
||||
{{/description}}
|
||||
{{^description}}
|
||||
* Get {{name}}
|
||||
{{/description}}
|
||||
{{#minimum}}
|
||||
* minimum: {{minimum}}
|
||||
{{/minimum}}
|
||||
{{#maximum}}
|
||||
* maximum: {{maximum}}
|
||||
{{/maximum}}
|
||||
* @return {{name}}
|
||||
**/
|
||||
{{#vendorExtensions.extraAnnotation}}
|
||||
{{vendorExtensions.extraAnnotation}}
|
||||
{{/vendorExtensions.extraAnnotation}}
|
||||
@ApiModelProperty({{#example}}example = "{{example}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}")
|
||||
@JsonProperty("{{baseName}}")
|
||||
public {{{datatypeWithEnum}}} {{getter}}() {
|
||||
return {{name}};
|
||||
}
|
||||
{{^isReadOnly}}
|
||||
|
||||
public void {{setter}}({{{datatypeWithEnum}}} {{name}}) {
|
||||
this.{{name}} = {{name}};
|
||||
}
|
||||
{{/isReadOnly}}
|
||||
|
||||
{{/vars}}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
{{classname}} {{classVarName}} = ({{classname}}) o;{{#hasVars}}
|
||||
return {{#vars}}Objects.equals({{name}}, {{classVarName}}.{{name}}){{#hasMore}} &&
|
||||
{{/hasMore}}{{^hasMore}};{{/hasMore}}{{/vars}}{{/hasVars}}{{^hasVars}}
|
||||
}{{#hasVars}}
|
||||
{{classname}} {{classVarName}} = ({{classname}}) o;
|
||||
return {{#vars}}Objects.equals(this.{{name}}, {{classVarName}}.{{name}}){{#hasMore}} &&
|
||||
{{/hasMore}}{{/vars}}{{#parent}} &&
|
||||
super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}}
|
||||
return true;{{/hasVars}}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash({{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}});
|
||||
return Objects.hash({{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}});
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -64,7 +113,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
|
||||
return {{#parentSchema}}parent::getters() + {{/parentSchema}}self::$getters;
|
||||
}
|
||||
|
||||
{{#vars}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}const {{datatypeWithEnum}}_{{{name}}} = {{{value}}};
|
||||
{{#vars}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}const {{enumName}}_{{{name}}} = {{{value}}};
|
||||
{{/enumVars}}{{/allowableValues}}{{/isEnum}}{{/vars}}
|
||||
|
||||
{{#vars}}{{#isEnum}}
|
||||
@ -73,7 +73,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
|
||||
public function {{getter}}AllowableValues()
|
||||
{
|
||||
return [
|
||||
{{#allowableValues}}{{#enumVars}}self::{{datatypeWithEnum}}_{{{name}}},{{^-last}}
|
||||
{{#allowableValues}}{{#enumVars}}self::{{enumName}}_{{{name}}},{{^-last}}
|
||||
{{/-last}}{{/enumVars}}{{/allowableValues}}
|
||||
];
|
||||
}
|
||||
@ -121,36 +121,44 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
|
||||
}
|
||||
{{/required}}
|
||||
{{#isEnum}}
|
||||
{{^isContainer}}
|
||||
$allowed_values = array({{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}});
|
||||
if (!in_array($this->container['{{name}}'], $allowed_values)) {
|
||||
$invalid_properties[] = "invalid value for '{{name}}', must be one of #{allowed_values}.";
|
||||
}
|
||||
|
||||
{{/isContainer}}
|
||||
{{/isEnum}}
|
||||
{{#hasValidation}}
|
||||
{{#maxLength}}
|
||||
if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}(strlen($this->container['{{name}}']) > {{maxLength}})) {
|
||||
$invalid_properties[] = "invalid value for '{{name}}', the character length must be smaller than or equal to {{{maxLength}}}.";
|
||||
}
|
||||
|
||||
{{/maxLength}}
|
||||
{{#minLength}}
|
||||
if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}(strlen($this->container['{{name}}']) < {{minLength}})) {
|
||||
$invalid_properties[] = "invalid value for '{{name}}', the character length must be bigger than or equal to {{{minLength}}}.";
|
||||
}
|
||||
|
||||
{{/minLength}}
|
||||
{{#maximum}}
|
||||
if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}($this->container['{{name}}'] > {{maximum}})) {
|
||||
$invalid_properties[] = "invalid value for '{{name}}', must be smaller than or equal to {{maximum}}.";
|
||||
}
|
||||
|
||||
{{/maximum}}
|
||||
{{#minimum}}
|
||||
if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}($this->container['{{name}}'] < {{minimum}})) {
|
||||
$invalid_properties[] = "invalid value for '{{name}}', must be bigger than or equal to {{minimum}}.";
|
||||
}
|
||||
|
||||
{{/minimum}}
|
||||
{{#pattern}}
|
||||
if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}!preg_match("{{pattern}}", $this->container['{{name}}'])) {
|
||||
$invalid_properties[] = "invalid value for '{{name}}', must be conform to the pattern {{pattern}}.";
|
||||
}
|
||||
|
||||
{{/pattern}}
|
||||
{{/hasValidation}}
|
||||
{{/vars}}
|
||||
@ -172,10 +180,12 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
|
||||
}
|
||||
{{/required}}
|
||||
{{#isEnum}}
|
||||
{{^isContainer}}
|
||||
$allowed_values = array({{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}});
|
||||
if (!in_array($this->container['{{name}}'], $allowed_values)) {
|
||||
return false;
|
||||
}
|
||||
{{/isContainer}}
|
||||
{{/isEnum}}
|
||||
{{#hasValidation}}
|
||||
{{#maxLength}}
|
||||
|
@ -111,9 +111,8 @@ public class CodegenTest {
|
||||
final CodegenParameter statusParam = op.queryParams.get(0);
|
||||
Assert.assertEquals(statusParam.datatypeWithEnum, "List");
|
||||
Assert.assertEquals(statusParam.baseType, "String");
|
||||
// currently there's no way to tell if the inner type of a list is a enum
|
||||
//Assert.assertTrue(statusParam.isEnum);
|
||||
//Assert.assertEquals(statusParam._enum.size(), 3);
|
||||
Assert.assertTrue(statusParam.isEnum);
|
||||
Assert.assertEquals(((List)statusParam.allowableValues.get("values")).size(), 3);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1143,6 +1143,31 @@ definitions:
|
||||
type: array
|
||||
items:
|
||||
type: number
|
||||
EnumArrays:
|
||||
type: object
|
||||
properties:
|
||||
just_enum:
|
||||
type: string
|
||||
enum:
|
||||
- bird
|
||||
- eagle
|
||||
array_enum:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
enum:
|
||||
- fish
|
||||
- crab
|
||||
# comment out the following as 2d array of enum is not supported at the moment
|
||||
#array_array_enum:
|
||||
# type: array
|
||||
# items:
|
||||
# type: array
|
||||
# items:
|
||||
# type: string
|
||||
# enum:
|
||||
# - Cat
|
||||
# - Dog
|
||||
externalDocs:
|
||||
description: Find out more about Swagger
|
||||
url: 'http://swagger.io'
|
||||
|
27
samples/client/petstore/java/okhttp-gson/docs/EnumArrays.md
Normal file
27
samples/client/petstore/java/okhttp-gson/docs/EnumArrays.md
Normal file
@ -0,0 +1,27 @@
|
||||
|
||||
# EnumArrays
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**justEnum** | [**JustEnumEnum**](#JustEnumEnum) | | [optional]
|
||||
**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional]
|
||||
|
||||
|
||||
<a name="JustEnumEnum"></a>
|
||||
## Enum: JustEnumEnum
|
||||
Name | Value
|
||||
---- | -----
|
||||
BIRD | "bird"
|
||||
EAGLE | "eagle"
|
||||
|
||||
|
||||
<a name="List<ArrayEnumEnum>"></a>
|
||||
## Enum: List<ArrayEnumEnum>
|
||||
Name | Value
|
||||
---- | -----
|
||||
FISH | "fish"
|
||||
CRAB | "crab"
|
||||
|
||||
|
||||
|
@ -12,6 +12,8 @@ Name | Type | Description | Notes
|
||||
## Enum: Map<String, InnerEnum>
|
||||
Name | Value
|
||||
---- | -----
|
||||
UPPER | "UPPER"
|
||||
LOWER | "lower"
|
||||
|
||||
|
||||
|
||||
|
@ -158,7 +158,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**status** | [**List<String>**](String.md)| Status values that need to be considered for filter |
|
||||
**status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
|
||||
|
||||
### Return type
|
||||
|
||||
|
@ -173,8 +173,8 @@ public class ApiClient {
|
||||
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
authentications = new HashMap<String, Authentication>();
|
||||
authentications.put("petstore_auth", new OAuth());
|
||||
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
||||
authentications.put("petstore_auth", new OAuth());
|
||||
// Prevent the authentications from being modified.
|
||||
authentications = Collections.unmodifiableMap(authentications);
|
||||
}
|
||||
|
@ -40,8 +40,8 @@ import java.io.IOException;
|
||||
|
||||
import io.swagger.client.model.Client;
|
||||
import org.joda.time.LocalDate;
|
||||
import java.math.BigDecimal;
|
||||
import org.joda.time.DateTime;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
|
@ -39,8 +39,8 @@ import com.google.gson.reflect.TypeToken;
|
||||
import java.io.IOException;
|
||||
|
||||
import io.swagger.client.model.Pet;
|
||||
import io.swagger.client.model.ModelApiResponse;
|
||||
import java.io.File;
|
||||
import io.swagger.client.model.ModelApiResponse;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
|
@ -0,0 +1,173 @@
|
||||
/**
|
||||
* Swagger 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: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
package io.swagger.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* EnumArrays
|
||||
*/
|
||||
|
||||
public class EnumArrays {
|
||||
/**
|
||||
* Gets or Sets justEnum
|
||||
*/
|
||||
public enum JustEnumEnum {
|
||||
@SerializedName("bird")
|
||||
BIRD("bird"),
|
||||
|
||||
@SerializedName("eagle")
|
||||
EAGLE("eagle");
|
||||
|
||||
private String value;
|
||||
|
||||
JustEnumEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
@SerializedName("just_enum")
|
||||
private JustEnumEnum justEnum = null;
|
||||
|
||||
/**
|
||||
* Gets or Sets arrayEnum
|
||||
*/
|
||||
public enum ArrayEnumEnum {
|
||||
@SerializedName("fish")
|
||||
FISH("fish"),
|
||||
|
||||
@SerializedName("crab")
|
||||
CRAB("crab");
|
||||
|
||||
private String value;
|
||||
|
||||
ArrayEnumEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
@SerializedName("array_enum")
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<ArrayEnumEnum>();
|
||||
|
||||
public EnumArrays justEnum(JustEnumEnum justEnum) {
|
||||
this.justEnum = justEnum;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get justEnum
|
||||
* @return justEnum
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public JustEnumEnum getJustEnum() {
|
||||
return justEnum;
|
||||
}
|
||||
|
||||
public void setJustEnum(JustEnumEnum justEnum) {
|
||||
this.justEnum = justEnum;
|
||||
}
|
||||
|
||||
public EnumArrays arrayEnum(List<ArrayEnumEnum> arrayEnum) {
|
||||
this.arrayEnum = arrayEnum;
|
||||
return this;
|
||||
}
|
||||
|
||||
public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
|
||||
this.arrayEnum.add(arrayEnumItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayEnum
|
||||
* @return arrayEnum
|
||||
**/
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
public List<ArrayEnumEnum> getArrayEnum() {
|
||||
return arrayEnum;
|
||||
}
|
||||
|
||||
public void setArrayEnum(List<ArrayEnumEnum> arrayEnum) {
|
||||
this.arrayEnum = arrayEnum;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
EnumArrays enumArrays = (EnumArrays) o;
|
||||
return Objects.equals(this.justEnum, enumArrays.justEnum) &&
|
||||
Objects.equals(this.arrayEnum, enumArrays.arrayEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(justEnum, arrayEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class EnumArrays {\n");
|
||||
|
||||
sb.append(" justEnum: ").append(toIndentedString(justEnum)).append("\n");
|
||||
sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,11 @@
|
||||
# EnumArrays
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**just_enum** | **string** | | [optional]
|
||||
**array_enum** | **string[]** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -0,0 +1,308 @@
|
||||
<?php
|
||||
/**
|
||||
* EnumArrays
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author http://github.com/swagger-api/swagger-codegen
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
* Swagger 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: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client\Model;
|
||||
|
||||
use \ArrayAccess;
|
||||
|
||||
/**
|
||||
* EnumArrays Class Doc Comment
|
||||
*
|
||||
* @category Class */
|
||||
/**
|
||||
* @package Swagger\Client
|
||||
* @author http://github.com/swagger-api/swagger-codegen
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class EnumArrays implements ArrayAccess
|
||||
{
|
||||
/**
|
||||
* The original name of the model.
|
||||
* @var string
|
||||
*/
|
||||
protected static $swaggerModelName = 'EnumArrays';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $swaggerTypes = array(
|
||||
'just_enum' => 'string',
|
||||
'array_enum' => 'string[]'
|
||||
);
|
||||
|
||||
public static function swaggerTypes()
|
||||
{
|
||||
return self::$swaggerTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name, and the value is the original name
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $attributeMap = array(
|
||||
'just_enum' => 'just_enum',
|
||||
'array_enum' => 'array_enum'
|
||||
);
|
||||
|
||||
public static function attributeMap()
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $setters = array(
|
||||
'just_enum' => 'setJustEnum',
|
||||
'array_enum' => 'setArrayEnum'
|
||||
);
|
||||
|
||||
public static function setters()
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
* @var string[]
|
||||
*/
|
||||
protected static $getters = array(
|
||||
'just_enum' => 'getJustEnum',
|
||||
'array_enum' => 'getArrayEnum'
|
||||
);
|
||||
|
||||
public static function getters()
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
const JUST_ENUM_BIRD = 'bird';
|
||||
const JUST_ENUM_EAGLE = 'eagle';
|
||||
const ARRAY_ENUM_FISH = 'fish';
|
||||
const ARRAY_ENUM_CRAB = 'crab';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
* @return string[]
|
||||
*/
|
||||
public function getJustEnumAllowableValues()
|
||||
{
|
||||
return [
|
||||
self::JUST_ENUM_BIRD,
|
||||
self::JUST_ENUM_EAGLE,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
* @return string[]
|
||||
*/
|
||||
public function getArrayEnumAllowableValues()
|
||||
{
|
||||
return [
|
||||
self::ARRAY_ENUM_FISH,
|
||||
self::ARRAY_ENUM_CRAB,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
* @var mixed[]
|
||||
*/
|
||||
protected $container = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param mixed[] $data Associated array of property value initalizing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->container['just_enum'] = isset($data['just_enum']) ? $data['just_enum'] : null;
|
||||
$this->container['array_enum'] = isset($data['array_enum']) ? $data['array_enum'] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
$allowed_values = array("bird", "eagle");
|
||||
if (!in_array($this->container['just_enum'], $allowed_values)) {
|
||||
$invalid_properties[] = "invalid value for 'just_enum', must be one of #{allowed_values}.";
|
||||
}
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool True if all properteis are valid
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
$allowed_values = array("bird", "eagle");
|
||||
if (!in_array($this->container['just_enum'], $allowed_values)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets just_enum
|
||||
* @return string
|
||||
*/
|
||||
public function getJustEnum()
|
||||
{
|
||||
return $this->container['just_enum'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets just_enum
|
||||
* @param string $just_enum
|
||||
* @return $this
|
||||
*/
|
||||
public function setJustEnum($just_enum)
|
||||
{
|
||||
$allowed_values = array('bird', 'eagle');
|
||||
if (!in_array($just_enum, $allowed_values)) {
|
||||
throw new \InvalidArgumentException("Invalid value for 'just_enum', must be one of 'bird', 'eagle'");
|
||||
}
|
||||
$this->container['just_enum'] = $just_enum;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets array_enum
|
||||
* @return string[]
|
||||
*/
|
||||
public function getArrayEnum()
|
||||
{
|
||||
return $this->container['array_enum'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets array_enum
|
||||
* @param string[] $array_enum
|
||||
* @return $this
|
||||
*/
|
||||
public function setArrayEnum($array_enum)
|
||||
{
|
||||
$allowed_values = array('fish', 'crab');
|
||||
if (!in_array($array_enum, $allowed_values)) {
|
||||
throw new \InvalidArgumentException("Invalid value for 'array_enum', must be one of 'fish', 'crab'");
|
||||
}
|
||||
$this->container['array_enum'] = $array_enum;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
* @param integer $offset Offset
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
* @param integer $offset Offset
|
||||
* @return mixed
|
||||
*/
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets value based on offset.
|
||||
* @param integer $offset Offset
|
||||
* @param mixed $value Value to be set
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
if (is_null($offset)) {
|
||||
$this->container[] = $value;
|
||||
} else {
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unsets offset.
|
||||
* @param integer $offset Offset
|
||||
* @return void
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
|
||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
|
||||
}
|
||||
|
||||
return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -196,14 +196,17 @@ class EnumTest implements ArrayAccess
|
||||
if (!in_array($this->container['enum_string'], $allowed_values)) {
|
||||
$invalid_properties[] = "invalid value for 'enum_string', must be one of #{allowed_values}.";
|
||||
}
|
||||
|
||||
$allowed_values = array("1", "-1");
|
||||
if (!in_array($this->container['enum_integer'], $allowed_values)) {
|
||||
$invalid_properties[] = "invalid value for 'enum_integer', must be one of #{allowed_values}.";
|
||||
}
|
||||
|
||||
$allowed_values = array("1.1", "-1.2");
|
||||
if (!in_array($this->container['enum_number'], $allowed_values)) {
|
||||
$invalid_properties[] = "invalid value for 'enum_number', must be one of #{allowed_values}.";
|
||||
}
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
|
@ -117,6 +117,8 @@ class MapTest implements ArrayAccess
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
const MAP_OF_ENUM_STRING_UPPER = 'UPPER';
|
||||
const MAP_OF_ENUM_STRING_LOWER = 'lower';
|
||||
|
||||
|
||||
|
||||
@ -127,7 +129,8 @@ class MapTest implements ArrayAccess
|
||||
public function getMapOfEnumStringAllowableValues()
|
||||
{
|
||||
return [
|
||||
|
||||
self::MAP_OF_ENUM_STRING_UPPER,
|
||||
self::MAP_OF_ENUM_STRING_LOWER,
|
||||
];
|
||||
}
|
||||
|
||||
@ -156,10 +159,6 @@ class MapTest implements ArrayAccess
|
||||
public function listInvalidProperties()
|
||||
{
|
||||
$invalid_properties = array();
|
||||
$allowed_values = array();
|
||||
if (!in_array($this->container['map_of_enum_string'], $allowed_values)) {
|
||||
$invalid_properties[] = "invalid value for 'map_of_enum_string', must be one of #{allowed_values}.";
|
||||
}
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
@ -171,10 +170,6 @@ class MapTest implements ArrayAccess
|
||||
*/
|
||||
public function valid()
|
||||
{
|
||||
$allowed_values = array();
|
||||
if (!in_array($this->container['map_of_enum_string'], $allowed_values)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -216,9 +211,9 @@ class MapTest implements ArrayAccess
|
||||
*/
|
||||
public function setMapOfEnumString($map_of_enum_string)
|
||||
{
|
||||
$allowed_values = array();
|
||||
$allowed_values = array('UPPER', 'lower');
|
||||
if (!in_array($map_of_enum_string, $allowed_values)) {
|
||||
throw new \InvalidArgumentException("Invalid value for 'map_of_enum_string', must be one of ");
|
||||
throw new \InvalidArgumentException("Invalid value for 'map_of_enum_string', must be one of 'UPPER', 'lower'");
|
||||
}
|
||||
$this->container['map_of_enum_string'] = $map_of_enum_string;
|
||||
|
||||
|
@ -185,6 +185,7 @@ class Order implements ArrayAccess
|
||||
if (!in_array($this->container['status'], $allowed_values)) {
|
||||
$invalid_properties[] = "invalid value for 'status', must be one of #{allowed_values}.";
|
||||
}
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
|
@ -191,6 +191,7 @@ class Pet implements ArrayAccess
|
||||
if (!in_array($this->container['status'], $allowed_values)) {
|
||||
$invalid_properties[] = "invalid value for 'status', must be one of #{allowed_values}.";
|
||||
}
|
||||
|
||||
return $invalid_properties;
|
||||
}
|
||||
|
||||
|
@ -264,7 +264,7 @@ class ObjectSerializer
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} elseif (in_array($class, array('void', 'bool', 'string', 'double', 'byte', 'mixed', 'integer', 'float', 'int', 'DateTime', 'number', 'boolean', 'object'))) {
|
||||
} elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) {
|
||||
settype($data, $class);
|
||||
return $data;
|
||||
} elseif ($class === '\SplFileObject') {
|
||||
|
@ -0,0 +1,114 @@
|
||||
<?php
|
||||
/**
|
||||
* EnumArraysTest
|
||||
*
|
||||
* PHP version 5
|
||||
*
|
||||
* @category Class
|
||||
* @package Swagger\Client
|
||||
* @author http://github.com/swagger-api/swagger-codegen
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
|
||||
/**
|
||||
* Swagger 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: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace Swagger\Client;
|
||||
|
||||
/**
|
||||
* EnumArraysTest Class Doc Comment
|
||||
*
|
||||
* @category Class */
|
||||
// * @description EnumArrays
|
||||
/**
|
||||
* @package Swagger\Client
|
||||
* @author http://github.com/swagger-api/swagger-codegen
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
|
||||
* @link https://github.com/swagger-api/swagger-codegen
|
||||
*/
|
||||
class EnumArraysTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "EnumArrays"
|
||||
*/
|
||||
public function testEnumArrays()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "array_enum"
|
||||
*/
|
||||
public function testPropertyArrayEnum()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "array_array_enum"
|
||||
*/
|
||||
public function testPropertyArrayArrayEnum()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -98,7 +98,7 @@ class ModelListTest extends \PHPUnit_Framework_TestCase
|
||||
/**
|
||||
* Test attribute "_123_list"
|
||||
*/
|
||||
public function testProperty123-list()
|
||||
public function testProperty123List()
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/
|
||||
|
||||
- API version: 1.0.0
|
||||
- Package version: 1.0.0
|
||||
- Build date: 2016-08-01T16:37:23.828+08:00
|
||||
- Build date: 2016-08-03T00:39:31.384+08:00
|
||||
- Build package: class io.swagger.codegen.languages.RubyClientCodegen
|
||||
|
||||
## Installation
|
||||
@ -114,6 +114,7 @@ Class | Method | HTTP request | Description
|
||||
- [Petstore::Category](docs/Category.md)
|
||||
- [Petstore::Client](docs/Client.md)
|
||||
- [Petstore::Dog](docs/Dog.md)
|
||||
- [Petstore::EnumArrays](docs/EnumArrays.md)
|
||||
- [Petstore::EnumClass](docs/EnumClass.md)
|
||||
- [Petstore::EnumTest](docs/EnumTest.md)
|
||||
- [Petstore::FormatTest](docs/FormatTest.md)
|
||||
|
9
samples/client/petstore/ruby/docs/EnumArrays.md
Normal file
9
samples/client/petstore/ruby/docs/EnumArrays.md
Normal file
@ -0,0 +1,9 @@
|
||||
# Petstore::EnumArrays
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**just_enum** | **String** | | [optional]
|
||||
**array_enum** | **Array<String>** | | [optional]
|
||||
|
||||
|
@ -39,6 +39,7 @@ require 'petstore/models/cat'
|
||||
require 'petstore/models/category'
|
||||
require 'petstore/models/client'
|
||||
require 'petstore/models/dog'
|
||||
require 'petstore/models/enum_arrays'
|
||||
require 'petstore/models/enum_class'
|
||||
require 'petstore/models/enum_test'
|
||||
require 'petstore/models/format_test'
|
||||
|
243
samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb
Normal file
243
samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb
Normal file
@ -0,0 +1,243 @@
|
||||
=begin
|
||||
#Swagger 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: \" \\
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
=end
|
||||
|
||||
require 'date'
|
||||
|
||||
module Petstore
|
||||
|
||||
class EnumArrays
|
||||
attr_accessor :just_enum
|
||||
|
||||
attr_accessor :array_enum
|
||||
|
||||
class EnumAttributeValidator
|
||||
attr_reader :datatype
|
||||
attr_reader :allowable_values
|
||||
|
||||
def initialize(datatype, allowable_values)
|
||||
@allowable_values = allowable_values.map do |value|
|
||||
case datatype.to_s
|
||||
when /Integer/i
|
||||
value.to_i
|
||||
when /Float/i
|
||||
value.to_f
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def valid?(value)
|
||||
!value || allowable_values.include?(value)
|
||||
end
|
||||
end
|
||||
|
||||
# Attribute mapping from ruby-style variable name to JSON key.
|
||||
def self.attribute_map
|
||||
{
|
||||
:'just_enum' => :'just_enum',
|
||||
:'array_enum' => :'array_enum'
|
||||
}
|
||||
end
|
||||
|
||||
# Attribute type mapping.
|
||||
def self.swagger_types
|
||||
{
|
||||
:'just_enum' => :'String',
|
||||
:'array_enum' => :'Array<String>'
|
||||
}
|
||||
end
|
||||
|
||||
# Initializes the object
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
def initialize(attributes = {})
|
||||
return unless attributes.is_a?(Hash)
|
||||
|
||||
# convert string to symbol for hash key
|
||||
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
||||
|
||||
if attributes.has_key?(:'just_enum')
|
||||
self.just_enum = attributes[:'just_enum']
|
||||
end
|
||||
|
||||
if attributes.has_key?(:'array_enum')
|
||||
if (value = attributes[:'array_enum']).is_a?(Array)
|
||||
self.array_enum = value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# Show invalid properties with the reasons. Usually used together with valid?
|
||||
# @return Array for valid properies with the reasons
|
||||
def list_invalid_properties
|
||||
invalid_properties = Array.new
|
||||
return invalid_properties
|
||||
end
|
||||
|
||||
# Check to see if the all the properties in the model are valid
|
||||
# @return true if the model is valid
|
||||
def valid?
|
||||
just_enum_validator = EnumAttributeValidator.new('String', ["bird", "eagle"])
|
||||
return false unless just_enum_validator.valid?(@just_enum)
|
||||
return true
|
||||
end
|
||||
|
||||
# Custom attribute writer method checking allowed values (enum).
|
||||
# @param [Object] just_enum Object to be assigned
|
||||
def just_enum=(just_enum)
|
||||
validator = EnumAttributeValidator.new('String', ["bird", "eagle"])
|
||||
unless validator.valid?(just_enum)
|
||||
fail ArgumentError, "invalid value for 'just_enum', must be one of #{validator.allowable_values}."
|
||||
end
|
||||
@just_enum = just_enum
|
||||
end
|
||||
|
||||
# Checks equality by comparing each attribute.
|
||||
# @param [Object] Object to be compared
|
||||
def ==(o)
|
||||
return true if self.equal?(o)
|
||||
self.class == o.class &&
|
||||
just_enum == o.just_enum &&
|
||||
array_enum == o.array_enum
|
||||
end
|
||||
|
||||
# @see the `==` method
|
||||
# @param [Object] Object to be compared
|
||||
def eql?(o)
|
||||
self == o
|
||||
end
|
||||
|
||||
# Calculates hash code according to all attributes.
|
||||
# @return [Fixnum] Hash code
|
||||
def hash
|
||||
[just_enum, array_enum].hash
|
||||
end
|
||||
|
||||
# Builds the object from hash
|
||||
# @param [Hash] attributes Model attributes in the form of hash
|
||||
# @return [Object] Returns the model itself
|
||||
def build_from_hash(attributes)
|
||||
return nil unless attributes.is_a?(Hash)
|
||||
self.class.swagger_types.each_pair do |key, type|
|
||||
if type =~ /^Array<(.*)>/i
|
||||
# check to ensure the input is an array given that the the attribute
|
||||
# is documented as an array but the input is not
|
||||
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
||||
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
||||
end
|
||||
elsif !attributes[self.class.attribute_map[key]].nil?
|
||||
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
||||
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
||||
end
|
||||
|
||||
self
|
||||
end
|
||||
|
||||
# Deserializes the data based on type
|
||||
# @param string type Data type
|
||||
# @param string value Value to be deserialized
|
||||
# @return [Object] Deserialized data
|
||||
def _deserialize(type, value)
|
||||
case type.to_sym
|
||||
when :DateTime
|
||||
DateTime.parse(value)
|
||||
when :Date
|
||||
Date.parse(value)
|
||||
when :String
|
||||
value.to_s
|
||||
when :Integer
|
||||
value.to_i
|
||||
when :Float
|
||||
value.to_f
|
||||
when :BOOLEAN
|
||||
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
when :Object
|
||||
# generic object (usually a Hash), return directly
|
||||
value
|
||||
when /\AArray<(?<inner_type>.+)>\z/
|
||||
inner_type = Regexp.last_match[:inner_type]
|
||||
value.map { |v| _deserialize(inner_type, v) }
|
||||
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
||||
k_type = Regexp.last_match[:k_type]
|
||||
v_type = Regexp.last_match[:v_type]
|
||||
{}.tap do |hash|
|
||||
value.each do |k, v|
|
||||
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
||||
end
|
||||
end
|
||||
else # model
|
||||
temp_model = Petstore.const_get(type).new
|
||||
temp_model.build_from_hash(value)
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the string representation of the object
|
||||
# @return [String] String presentation of the object
|
||||
def to_s
|
||||
to_hash.to_s
|
||||
end
|
||||
|
||||
# to_body is an alias to to_hash (backward compatibility)
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_body
|
||||
to_hash
|
||||
end
|
||||
|
||||
# Returns the object in the form of hash
|
||||
# @return [Hash] Returns the object in the form of hash
|
||||
def to_hash
|
||||
hash = {}
|
||||
self.class.attribute_map.each_pair do |attr, param|
|
||||
value = self.send(attr)
|
||||
next if value.nil?
|
||||
hash[param] = _to_hash(value)
|
||||
end
|
||||
hash
|
||||
end
|
||||
|
||||
# Outputs non-array value in the form of hash
|
||||
# For object, use to_hash. Otherwise, just return the value
|
||||
# @param [Object] value Any valid value
|
||||
# @return [Hash] Returns the value in the form of hash
|
||||
def _to_hash(value)
|
||||
if value.is_a?(Array)
|
||||
value.compact.map{ |v| _to_hash(v) }
|
||||
elsif value.is_a?(Hash)
|
||||
{}.tap do |hash|
|
||||
value.each { |k, v| hash[k] = _to_hash(v) }
|
||||
end
|
||||
elsif value.respond_to? :to_hash
|
||||
value.to_hash
|
||||
else
|
||||
value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
67
samples/client/petstore/ruby/spec/models/enum_arrays_spec.rb
Normal file
67
samples/client/petstore/ruby/spec/models/enum_arrays_spec.rb
Normal file
@ -0,0 +1,67 @@
|
||||
=begin
|
||||
#Swagger 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: \" \\
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
=end
|
||||
|
||||
require 'spec_helper'
|
||||
require 'json'
|
||||
require 'date'
|
||||
|
||||
# Unit tests for Petstore::EnumArrays
|
||||
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
||||
# Please update as you see appropriate
|
||||
describe 'EnumArrays' do
|
||||
before do
|
||||
# run before each test
|
||||
@instance = Petstore::EnumArrays.new
|
||||
end
|
||||
|
||||
after do
|
||||
# run after each test
|
||||
end
|
||||
|
||||
describe 'test an instance of EnumArrays' do
|
||||
it 'should create an instact of EnumArrays' do
|
||||
expect(@instance).to be_instance_of(Petstore::EnumArrays)
|
||||
end
|
||||
end
|
||||
describe 'test attribute "array_enum"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
||||
#validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', [])
|
||||
#validator.allowable_values.each do |value|
|
||||
# expect { @instance.array_enum = value }.not_to raise_error
|
||||
#end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'test attribute "array_array_enum"' do
|
||||
it 'should work' do
|
||||
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
||||
#validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<Array<String>>', [])
|
||||
#validator.allowable_values.each do |value|
|
||||
# expect { @instance.array_array_enum = value }.not_to raise_error
|
||||
#end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -0,0 +1,88 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.model.*;
|
||||
import io.swagger.api.FakeApiService;
|
||||
import io.swagger.api.factories.FakeApiServiceFactory;
|
||||
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.jaxrs.*;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
||||
import org.glassfish.jersey.media.multipart.FormDataParam;
|
||||
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
import javax.ws.rs.*;
|
||||
|
||||
@Path("/fake")
|
||||
|
||||
|
||||
@io.swagger.annotations.Api(description = "the fake API")
|
||||
|
||||
public class FakeApi {
|
||||
private final FakeApiService delegate = FakeApiServiceFactory.getFakeApi();
|
||||
|
||||
@PATCH
|
||||
|
||||
@Consumes({ "application/json" })
|
||||
@Produces({ "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "To test \"client\" model", notes = "", response = Client.class, tags={ "fake", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Client.class) })
|
||||
public Response testClientModel(@ApiParam(value = "client model" ,required=true) Client body
|
||||
,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.testClientModel(body,securityContext);
|
||||
}
|
||||
@POST
|
||||
|
||||
@Consumes({ "application/xml; charset=utf-8", "application/json; charset=utf-8" })
|
||||
@Produces({ "application/xml; charset=utf-8", "application/json; charset=utf-8" })
|
||||
@io.swagger.annotations.ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = void.class, tags={ "fake", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = void.class) })
|
||||
public Response testEndpointParameters(@ApiParam(value = "None", required=true) @FormParam("number") BigDecimal number
|
||||
,@ApiParam(value = "None", required=true) @FormParam("double") Double _double
|
||||
,@ApiParam(value = "None", required=true) @FormParam("string") String string
|
||||
,@ApiParam(value = "None", required=true) @FormParam("byte") byte[] _byte
|
||||
,@ApiParam(value = "None") @FormParam("integer") Integer integer
|
||||
,@ApiParam(value = "None") @FormParam("int32") Integer int32
|
||||
,@ApiParam(value = "None") @FormParam("int64") Long int64
|
||||
,@ApiParam(value = "None") @FormParam("float") Float _float
|
||||
,@ApiParam(value = "None") @FormParam("binary") byte[] binary
|
||||
,@ApiParam(value = "None") @FormParam("date") Date date
|
||||
,@ApiParam(value = "None") @FormParam("dateTime") Date dateTime
|
||||
,@ApiParam(value = "None") @FormParam("password") String password
|
||||
,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.testEndpointParameters(number,_double,string,_byte,integer,int32,int64,_float,binary,date,dateTime,password,securityContext);
|
||||
}
|
||||
@GET
|
||||
|
||||
@Consumes({ "application/json" })
|
||||
@Produces({ "application/json" })
|
||||
@io.swagger.annotations.ApiOperation(value = "To test enum query parameters", notes = "", response = void.class, tags={ "fake", })
|
||||
@io.swagger.annotations.ApiResponses(value = {
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid request", response = void.class),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Not found", response = void.class) })
|
||||
public Response testEnumQueryParameters(@ApiParam(value = "Query parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @DefaultValue("-efg") @FormParam("enum_query_string") String enumQueryString
|
||||
,@ApiParam(value = "Query parameter enum test (double)") @QueryParam("enum_query_integer") BigDecimal enumQueryInteger
|
||||
,@ApiParam(value = "Query parameter enum test (double)") @FormParam("enum_query_double") Double enumQueryDouble
|
||||
,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.testEnumQueryParameters(enumQueryString,enumQueryInteger,enumQueryDouble,securityContext);
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package io.swagger.api;
|
||||
|
||||
import io.swagger.api.*;
|
||||
import io.swagger.model.*;
|
||||
|
||||
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
|
||||
|
||||
public abstract class FakeApiService {
|
||||
public abstract Response testClientModel(Client body,SecurityContext securityContext) throws NotFoundException;
|
||||
public abstract Response testEndpointParameters(BigDecimal number,Double _double,String string,byte[] _byte,Integer integer,Integer int32,Long int64,Float _float,byte[] binary,Date date,Date dateTime,String password,SecurityContext securityContext) throws NotFoundException;
|
||||
public abstract Response testEnumQueryParameters(String enumQueryString,BigDecimal enumQueryInteger,Double enumQueryDouble,SecurityContext securityContext) throws NotFoundException;
|
||||
}
|
@ -5,6 +5,7 @@ import io.swagger.api.PetApiService;
|
||||
import io.swagger.api.factories.PetApiServiceFactory;
|
||||
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.jaxrs.*;
|
||||
|
||||
import io.swagger.model.Pet;
|
||||
import java.io.File;
|
||||
@ -80,7 +81,7 @@ public class PetApi {
|
||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
|
||||
|
||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid status value", response = Pet.class, responseContainer = "List") })
|
||||
public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter",required=true) @QueryParam("status") List<String> status
|
||||
public Response findPetsByStatus(@ApiParam(value = "Status values that need to be considered for filter",required=true, allowableValues="available, pending, sold") @QueryParam("status") List<String> status
|
||||
,@Context SecurityContext securityContext)
|
||||
throws NotFoundException {
|
||||
return delegate.findPetsByStatus(status,securityContext);
|
||||
|
@ -5,6 +5,7 @@ import io.swagger.api.StoreApiService;
|
||||
import io.swagger.api.factories.StoreApiServiceFactory;
|
||||
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.jaxrs.*;
|
||||
|
||||
import java.util.Map;
|
||||
import io.swagger.model.Order;
|
||||
|
@ -5,6 +5,7 @@ import io.swagger.api.UserApiService;
|
||||
import io.swagger.api.factories.UserApiServiceFactory;
|
||||
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.jaxrs.*;
|
||||
|
||||
import io.swagger.model.User;
|
||||
import java.util.List;
|
||||
|
@ -0,0 +1,110 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* AdditionalPropertiesClass
|
||||
*/
|
||||
|
||||
public class AdditionalPropertiesClass {
|
||||
private Map<String, String> mapProperty = new HashMap<String, String>();
|
||||
|
||||
private Map<String, Map<String, String>> mapOfMapProperty = new HashMap<String, Map<String, String>>();
|
||||
|
||||
public AdditionalPropertiesClass mapProperty(Map<String, String> mapProperty) {
|
||||
this.mapProperty = mapProperty;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) {
|
||||
this.mapProperty.put(key, mapPropertyItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mapProperty
|
||||
* @return mapProperty
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Map<String, String> getMapProperty() {
|
||||
return mapProperty;
|
||||
}
|
||||
|
||||
public void setMapProperty(Map<String, String> mapProperty) {
|
||||
this.mapProperty = mapProperty;
|
||||
}
|
||||
|
||||
public AdditionalPropertiesClass mapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
|
||||
this.mapOfMapProperty = mapOfMapProperty;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map<String, String> mapOfMapPropertyItem) {
|
||||
this.mapOfMapProperty.put(key, mapOfMapPropertyItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mapOfMapProperty
|
||||
* @return mapOfMapProperty
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Map<String, Map<String, String>> getMapOfMapProperty() {
|
||||
return mapOfMapProperty;
|
||||
}
|
||||
|
||||
public void setMapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
|
||||
this.mapOfMapProperty = mapOfMapProperty;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o;
|
||||
return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) &&
|
||||
Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(mapProperty, mapOfMapProperty);
|
||||
}
|
||||
|
||||
@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 String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,97 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Animal
|
||||
*/
|
||||
|
||||
public class Animal {
|
||||
private String className = null;
|
||||
|
||||
private String color = "red";
|
||||
|
||||
public Animal className(String className) {
|
||||
this.className = className;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get className
|
||||
* @return className
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
public void setClassName(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
public Animal color(String color) {
|
||||
this.color = color;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Animal animal = (Animal) o;
|
||||
return Objects.equals(this.className, animal.className) &&
|
||||
Objects.equals(this.color, animal.color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(className, color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Animal {\n");
|
||||
|
||||
sb.append(" className: ").append(toIndentedString(className)).append("\n");
|
||||
sb.append(" color: ").append(toIndentedString(color)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,53 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import io.swagger.model.Animal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* AnimalFarm
|
||||
*/
|
||||
|
||||
public class AnimalFarm extends ArrayList<Animal> {
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(super.hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class AnimalFarm {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,83 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ArrayOfArrayOfNumberOnly
|
||||
*/
|
||||
|
||||
public class ArrayOfArrayOfNumberOnly {
|
||||
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<List<BigDecimal>>();
|
||||
|
||||
public ArrayOfArrayOfNumberOnly arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
|
||||
this.arrayArrayNumber = arrayArrayNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
|
||||
this.arrayArrayNumber.add(arrayArrayNumberItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayArrayNumber
|
||||
* @return arrayArrayNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<List<BigDecimal>> getArrayArrayNumber() {
|
||||
return arrayArrayNumber;
|
||||
}
|
||||
|
||||
public void setArrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
|
||||
this.arrayArrayNumber = arrayArrayNumber;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o;
|
||||
return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(arrayArrayNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ArrayOfArrayOfNumberOnly {\n");
|
||||
|
||||
sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,83 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ArrayOfNumberOnly
|
||||
*/
|
||||
|
||||
public class ArrayOfNumberOnly {
|
||||
private List<BigDecimal> arrayNumber = new ArrayList<BigDecimal>();
|
||||
|
||||
public ArrayOfNumberOnly arrayNumber(List<BigDecimal> arrayNumber) {
|
||||
this.arrayNumber = arrayNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
|
||||
this.arrayNumber.add(arrayNumberItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayNumber
|
||||
* @return arrayNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<BigDecimal> getArrayNumber() {
|
||||
return arrayNumber;
|
||||
}
|
||||
|
||||
public void setArrayNumber(List<BigDecimal> arrayNumber) {
|
||||
this.arrayNumber = arrayNumber;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o;
|
||||
return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(arrayNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ArrayOfNumberOnly {\n");
|
||||
|
||||
sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,137 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.ReadOnlyFirst;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ArrayTest
|
||||
*/
|
||||
|
||||
public class ArrayTest {
|
||||
private List<String> arrayOfString = new ArrayList<String>();
|
||||
|
||||
private List<List<Long>> arrayArrayOfInteger = new ArrayList<List<Long>>();
|
||||
|
||||
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
|
||||
|
||||
public ArrayTest arrayOfString(List<String> arrayOfString) {
|
||||
this.arrayOfString = arrayOfString;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
|
||||
this.arrayOfString.add(arrayOfStringItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayOfString
|
||||
* @return arrayOfString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<String> getArrayOfString() {
|
||||
return arrayOfString;
|
||||
}
|
||||
|
||||
public void setArrayOfString(List<String> arrayOfString) {
|
||||
this.arrayOfString = arrayOfString;
|
||||
}
|
||||
|
||||
public ArrayTest arrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
|
||||
this.arrayArrayOfInteger = arrayArrayOfInteger;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
|
||||
this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayArrayOfInteger
|
||||
* @return arrayArrayOfInteger
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<List<Long>> getArrayArrayOfInteger() {
|
||||
return arrayArrayOfInteger;
|
||||
}
|
||||
|
||||
public void setArrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
|
||||
this.arrayArrayOfInteger = arrayArrayOfInteger;
|
||||
}
|
||||
|
||||
public ArrayTest arrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
|
||||
this.arrayArrayOfModel = arrayArrayOfModel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
|
||||
this.arrayArrayOfModel.add(arrayArrayOfModelItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayArrayOfModel
|
||||
* @return arrayArrayOfModel
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
|
||||
return arrayArrayOfModel;
|
||||
}
|
||||
|
||||
public void setArrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
|
||||
this.arrayArrayOfModel = arrayArrayOfModel;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ArrayTest arrayTest = (ArrayTest) o;
|
||||
return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) &&
|
||||
Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) &&
|
||||
Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ArrayTest {\n");
|
||||
|
||||
sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n");
|
||||
sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n");
|
||||
sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,77 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.Animal;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Cat
|
||||
*/
|
||||
|
||||
public class Cat extends Animal {
|
||||
private Boolean declawed = null;
|
||||
|
||||
public Cat declawed(Boolean declawed) {
|
||||
this.declawed = declawed;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get declawed
|
||||
* @return declawed
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Boolean getDeclawed() {
|
||||
return declawed;
|
||||
}
|
||||
|
||||
public void setDeclawed(Boolean declawed) {
|
||||
this.declawed = declawed;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Cat cat = (Cat) o;
|
||||
return Objects.equals(this.declawed, cat.declawed) &&
|
||||
super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(declawed, super.hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Cat {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -8,50 +8,54 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Category
|
||||
*/
|
||||
|
||||
public class Category {
|
||||
|
||||
private Long id = null;
|
||||
|
||||
private String name = null;
|
||||
|
||||
/**
|
||||
**/
|
||||
public Category id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("id")
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
public Category name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("name")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
@ -59,8 +63,8 @@ public class Category {
|
||||
return false;
|
||||
}
|
||||
Category category = (Category) o;
|
||||
return Objects.equals(id, category.id) &&
|
||||
Objects.equals(name, category.name);
|
||||
return Objects.equals(this.id, category.id) &&
|
||||
Objects.equals(this.name, category.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -83,7 +87,7 @@ public class Category {
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
|
@ -0,0 +1,75 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Client
|
||||
*/
|
||||
|
||||
public class Client {
|
||||
private String client = null;
|
||||
|
||||
public Client client(String client) {
|
||||
this.client = client;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get client
|
||||
* @return client
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
||||
public void setClient(String client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Client client = (Client) o;
|
||||
return Objects.equals(this.client, client.client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Client {\n");
|
||||
|
||||
sb.append(" client: ").append(toIndentedString(client)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,77 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.Animal;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Dog
|
||||
*/
|
||||
|
||||
public class Dog extends Animal {
|
||||
private String breed = null;
|
||||
|
||||
public Dog breed(String breed) {
|
||||
this.breed = breed;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get breed
|
||||
* @return breed
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getBreed() {
|
||||
return breed;
|
||||
}
|
||||
|
||||
public void setBreed(String breed) {
|
||||
this.breed = breed;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Dog dog = (Dog) o;
|
||||
return Objects.equals(this.breed, dog.breed) &&
|
||||
super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(breed, super.hashCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Dog {\n");
|
||||
sb.append(" ").append(toIndentedString(super.toString())).append("\n");
|
||||
sb.append(" breed: ").append(toIndentedString(breed)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,145 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* EnumArrays
|
||||
*/
|
||||
|
||||
public class EnumArrays {
|
||||
/**
|
||||
* Gets or Sets justEnum
|
||||
*/
|
||||
public enum JustEnumEnum {
|
||||
BIRD("bird"),
|
||||
|
||||
EAGLE("eagle");
|
||||
|
||||
private String value;
|
||||
|
||||
JustEnumEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
private JustEnumEnum justEnum = null;
|
||||
|
||||
/**
|
||||
* Gets or Sets arrayEnum
|
||||
*/
|
||||
public enum ArrayEnumEnum {
|
||||
FISH("fish"),
|
||||
|
||||
CRAB("crab");
|
||||
|
||||
private String value;
|
||||
|
||||
ArrayEnumEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
private List<ArrayEnumEnum> arrayEnum = new ArrayList<ArrayEnumEnum>();
|
||||
|
||||
public EnumArrays justEnum(JustEnumEnum justEnum) {
|
||||
this.justEnum = justEnum;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get justEnum
|
||||
* @return justEnum
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public JustEnumEnum getJustEnum() {
|
||||
return justEnum;
|
||||
}
|
||||
|
||||
public void setJustEnum(JustEnumEnum justEnum) {
|
||||
this.justEnum = justEnum;
|
||||
}
|
||||
|
||||
public EnumArrays arrayEnum(List<ArrayEnumEnum> arrayEnum) {
|
||||
this.arrayEnum = arrayEnum;
|
||||
return this;
|
||||
}
|
||||
|
||||
public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
|
||||
this.arrayEnum.add(arrayEnumItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get arrayEnum
|
||||
* @return arrayEnum
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public List<ArrayEnumEnum> getArrayEnum() {
|
||||
return arrayEnum;
|
||||
}
|
||||
|
||||
public void setArrayEnum(List<ArrayEnumEnum> arrayEnum) {
|
||||
this.arrayEnum = arrayEnum;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
EnumArrays enumArrays = (EnumArrays) o;
|
||||
return Objects.equals(this.justEnum, enumArrays.justEnum) &&
|
||||
Objects.equals(this.arrayEnum, enumArrays.arrayEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(justEnum, arrayEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class EnumArrays {\n");
|
||||
|
||||
sb.append(" justEnum: ").append(toIndentedString(justEnum)).append("\n");
|
||||
sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,31 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,180 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* EnumTest
|
||||
*/
|
||||
|
||||
public class EnumTest {
|
||||
/**
|
||||
* Gets or Sets enumString
|
||||
*/
|
||||
public enum EnumStringEnum {
|
||||
UPPER("UPPER"),
|
||||
|
||||
LOWER("lower");
|
||||
|
||||
private String value;
|
||||
|
||||
EnumStringEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
private EnumStringEnum enumString = null;
|
||||
|
||||
/**
|
||||
* Gets or Sets enumInteger
|
||||
*/
|
||||
public enum EnumIntegerEnum {
|
||||
NUMBER_1(1),
|
||||
|
||||
NUMBER_MINUS_1(-1);
|
||||
|
||||
private Integer value;
|
||||
|
||||
EnumIntegerEnum(Integer value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
private EnumIntegerEnum enumInteger = null;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
private EnumNumberEnum enumNumber = null;
|
||||
|
||||
public EnumTest enumString(EnumStringEnum enumString) {
|
||||
this.enumString = enumString;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get enumString
|
||||
* @return enumString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public EnumStringEnum getEnumString() {
|
||||
return enumString;
|
||||
}
|
||||
|
||||
public void setEnumString(EnumStringEnum enumString) {
|
||||
this.enumString = enumString;
|
||||
}
|
||||
|
||||
public EnumTest enumInteger(EnumIntegerEnum enumInteger) {
|
||||
this.enumInteger = enumInteger;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get enumInteger
|
||||
* @return enumInteger
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public EnumIntegerEnum getEnumInteger() {
|
||||
return enumInteger;
|
||||
}
|
||||
|
||||
public void setEnumInteger(EnumIntegerEnum enumInteger) {
|
||||
this.enumInteger = enumInteger;
|
||||
}
|
||||
|
||||
public EnumTest enumNumber(EnumNumberEnum enumNumber) {
|
||||
this.enumNumber = enumNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get enumNumber
|
||||
* @return enumNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public EnumNumberEnum getEnumNumber() {
|
||||
return enumNumber;
|
||||
}
|
||||
|
||||
public void setEnumNumber(EnumNumberEnum enumNumber) {
|
||||
this.enumNumber = enumNumber;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
EnumTest enumTest = (EnumTest) o;
|
||||
return Objects.equals(this.enumString, enumTest.enumString) &&
|
||||
Objects.equals(this.enumInteger, enumTest.enumInteger) &&
|
||||
Objects.equals(this.enumNumber, enumTest.enumNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(enumString, enumInteger, enumNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class EnumTest {\n");
|
||||
|
||||
sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n");
|
||||
sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n");
|
||||
sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,351 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* FormatTest
|
||||
*/
|
||||
|
||||
public class FormatTest {
|
||||
private Integer integer = null;
|
||||
|
||||
private Integer int32 = null;
|
||||
|
||||
private Long int64 = null;
|
||||
|
||||
private BigDecimal number = null;
|
||||
|
||||
private Float _float = null;
|
||||
|
||||
private Double _double = null;
|
||||
|
||||
private String string = null;
|
||||
|
||||
private byte[] _byte = null;
|
||||
|
||||
private byte[] binary = null;
|
||||
|
||||
private Date date = null;
|
||||
|
||||
private Date dateTime = null;
|
||||
|
||||
private String uuid = null;
|
||||
|
||||
private String password = null;
|
||||
|
||||
public FormatTest integer(Integer integer) {
|
||||
this.integer = integer;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get integer
|
||||
* minimum: 10.0
|
||||
* maximum: 100.0
|
||||
* @return integer
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Integer getInteger() {
|
||||
return integer;
|
||||
}
|
||||
|
||||
public void setInteger(Integer integer) {
|
||||
this.integer = integer;
|
||||
}
|
||||
|
||||
public FormatTest int32(Integer int32) {
|
||||
this.int32 = int32;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get int32
|
||||
* minimum: 20.0
|
||||
* maximum: 200.0
|
||||
* @return int32
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Integer getInt32() {
|
||||
return int32;
|
||||
}
|
||||
|
||||
public void setInt32(Integer int32) {
|
||||
this.int32 = int32;
|
||||
}
|
||||
|
||||
public FormatTest int64(Long int64) {
|
||||
this.int64 = int64;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get int64
|
||||
* @return int64
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Long getInt64() {
|
||||
return int64;
|
||||
}
|
||||
|
||||
public void setInt64(Long int64) {
|
||||
this.int64 = int64;
|
||||
}
|
||||
|
||||
public FormatTest number(BigDecimal number) {
|
||||
this.number = number;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get number
|
||||
* minimum: 32.1
|
||||
* maximum: 543.2
|
||||
* @return number
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
public BigDecimal getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(BigDecimal number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public FormatTest _float(Float _float) {
|
||||
this._float = _float;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _float
|
||||
* minimum: 54.3
|
||||
* maximum: 987.6
|
||||
* @return _float
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Float getFloat() {
|
||||
return _float;
|
||||
}
|
||||
|
||||
public void setFloat(Float _float) {
|
||||
this._float = _float;
|
||||
}
|
||||
|
||||
public FormatTest _double(Double _double) {
|
||||
this._double = _double;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _double
|
||||
* minimum: 67.8
|
||||
* maximum: 123.4
|
||||
* @return _double
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Double getDouble() {
|
||||
return _double;
|
||||
}
|
||||
|
||||
public void setDouble(Double _double) {
|
||||
this._double = _double;
|
||||
}
|
||||
|
||||
public FormatTest string(String string) {
|
||||
this.string = string;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get string
|
||||
* @return string
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getString() {
|
||||
return string;
|
||||
}
|
||||
|
||||
public void setString(String string) {
|
||||
this.string = string;
|
||||
}
|
||||
|
||||
public FormatTest _byte(byte[] _byte) {
|
||||
this._byte = _byte;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _byte
|
||||
* @return _byte
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
public byte[] getByte() {
|
||||
return _byte;
|
||||
}
|
||||
|
||||
public void setByte(byte[] _byte) {
|
||||
this._byte = _byte;
|
||||
}
|
||||
|
||||
public FormatTest binary(byte[] binary) {
|
||||
this.binary = binary;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get binary
|
||||
* @return binary
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public byte[] getBinary() {
|
||||
return binary;
|
||||
}
|
||||
|
||||
public void setBinary(byte[] binary) {
|
||||
this.binary = binary;
|
||||
}
|
||||
|
||||
public FormatTest date(Date date) {
|
||||
this.date = date;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get date
|
||||
* @return date
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
public Date getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public void setDate(Date date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public FormatTest dateTime(Date dateTime) {
|
||||
this.dateTime = dateTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dateTime
|
||||
* @return dateTime
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Date getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
|
||||
public void setDateTime(Date dateTime) {
|
||||
this.dateTime = dateTime;
|
||||
}
|
||||
|
||||
public FormatTest uuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get uuid
|
||||
* @return uuid
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public FormatTest password(String password) {
|
||||
this.password = password;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get password
|
||||
* @return password
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FormatTest formatTest = (FormatTest) o;
|
||||
return Objects.equals(this.integer, formatTest.integer) &&
|
||||
Objects.equals(this.int32, formatTest.int32) &&
|
||||
Objects.equals(this.int64, formatTest.int64) &&
|
||||
Objects.equals(this.number, formatTest.number) &&
|
||||
Objects.equals(this._float, formatTest._float) &&
|
||||
Objects.equals(this._double, formatTest._double) &&
|
||||
Objects.equals(this.string, formatTest.string) &&
|
||||
Objects.equals(this._byte, formatTest._byte) &&
|
||||
Objects.equals(this.binary, formatTest.binary) &&
|
||||
Objects.equals(this.date, formatTest.date) &&
|
||||
Objects.equals(this.dateTime, formatTest.dateTime) &&
|
||||
Objects.equals(this.uuid, formatTest.uuid) &&
|
||||
Objects.equals(this.password, formatTest.password);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class FormatTest {\n");
|
||||
|
||||
sb.append(" integer: ").append(toIndentedString(integer)).append("\n");
|
||||
sb.append(" int32: ").append(toIndentedString(int32)).append("\n");
|
||||
sb.append(" int64: ").append(toIndentedString(int64)).append("\n");
|
||||
sb.append(" number: ").append(toIndentedString(number)).append("\n");
|
||||
sb.append(" _float: ").append(toIndentedString(_float)).append("\n");
|
||||
sb.append(" _double: ").append(toIndentedString(_double)).append("\n");
|
||||
sb.append(" string: ").append(toIndentedString(string)).append("\n");
|
||||
sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n");
|
||||
sb.append(" binary: ").append(toIndentedString(binary)).append("\n");
|
||||
sb.append(" date: ").append(toIndentedString(date)).append("\n");
|
||||
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
|
||||
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
|
||||
sb.append(" password: ").append(toIndentedString(password)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,79 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* HasOnlyReadOnly
|
||||
*/
|
||||
|
||||
public class HasOnlyReadOnly {
|
||||
private String bar = null;
|
||||
|
||||
private String foo = null;
|
||||
|
||||
/**
|
||||
* Get bar
|
||||
* @return bar
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getBar() {
|
||||
return bar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get foo
|
||||
* @return foo
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getFoo() {
|
||||
return foo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o;
|
||||
return Objects.equals(this.bar, hasOnlyReadOnly.bar) &&
|
||||
Objects.equals(this.foo, hasOnlyReadOnly.foo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(bar, foo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class HasOnlyReadOnly {\n");
|
||||
|
||||
sb.append(" bar: ").append(toIndentedString(bar)).append("\n");
|
||||
sb.append(" foo: ").append(toIndentedString(foo)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,131 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* MapTest
|
||||
*/
|
||||
|
||||
public class MapTest {
|
||||
private Map<String, Map<String, String>> mapMapOfString = new HashMap<String, Map<String, String>>();
|
||||
|
||||
/**
|
||||
* Gets or Sets inner
|
||||
*/
|
||||
public enum InnerEnum {
|
||||
UPPER("UPPER"),
|
||||
|
||||
LOWER("lower");
|
||||
|
||||
private String value;
|
||||
|
||||
InnerEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, InnerEnum> mapOfEnumString = new HashMap<String, InnerEnum>();
|
||||
|
||||
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
|
||||
this.mapMapOfString = mapMapOfString;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MapTest putMapMapOfStringItem(String key, Map<String, String> mapMapOfStringItem) {
|
||||
this.mapMapOfString.put(key, mapMapOfStringItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mapMapOfString
|
||||
* @return mapMapOfString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Map<String, Map<String, String>> getMapMapOfString() {
|
||||
return mapMapOfString;
|
||||
}
|
||||
|
||||
public void setMapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
|
||||
this.mapMapOfString = mapMapOfString;
|
||||
}
|
||||
|
||||
public MapTest mapOfEnumString(Map<String, InnerEnum> mapOfEnumString) {
|
||||
this.mapOfEnumString = mapOfEnumString;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
|
||||
this.mapOfEnumString.put(key, mapOfEnumStringItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mapOfEnumString
|
||||
* @return mapOfEnumString
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Map<String, InnerEnum> getMapOfEnumString() {
|
||||
return mapOfEnumString;
|
||||
}
|
||||
|
||||
public void setMapOfEnumString(Map<String, InnerEnum> mapOfEnumString) {
|
||||
this.mapOfEnumString = mapOfEnumString;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
MapTest mapTest = (MapTest) o;
|
||||
return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
|
||||
Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(mapMapOfString, mapOfEnumString);
|
||||
}
|
||||
|
||||
@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("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,129 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.model.Animal;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* MixedPropertiesAndAdditionalPropertiesClass
|
||||
*/
|
||||
|
||||
public class MixedPropertiesAndAdditionalPropertiesClass {
|
||||
private String uuid = null;
|
||||
|
||||
private Date dateTime = null;
|
||||
|
||||
private Map<String, Animal> map = new HashMap<String, Animal>();
|
||||
|
||||
public MixedPropertiesAndAdditionalPropertiesClass uuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get uuid
|
||||
* @return uuid
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) {
|
||||
this.dateTime = dateTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get dateTime
|
||||
* @return dateTime
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Date getDateTime() {
|
||||
return dateTime;
|
||||
}
|
||||
|
||||
public void setDateTime(Date dateTime) {
|
||||
this.dateTime = dateTime;
|
||||
}
|
||||
|
||||
public MixedPropertiesAndAdditionalPropertiesClass map(Map<String, Animal> map) {
|
||||
this.map = map;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
|
||||
this.map.put(key, mapItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get map
|
||||
* @return map
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Map<String, Animal> getMap() {
|
||||
return map;
|
||||
}
|
||||
|
||||
public void setMap(Map<String, Animal> map) {
|
||||
this.map = map;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o;
|
||||
return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) &&
|
||||
Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) &&
|
||||
Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(uuid, dateTime, map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n");
|
||||
|
||||
sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
|
||||
sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
|
||||
sb.append(" map: ").append(toIndentedString(map)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,101 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Model for testing model name starting with number
|
||||
**/
|
||||
|
||||
/**
|
||||
* Model for testing model name starting with number
|
||||
*/
|
||||
@ApiModel(description = "Model for testing model name starting with number")
|
||||
|
||||
public class Model200Response {
|
||||
private Integer name = null;
|
||||
|
||||
private String PropertyClass = null;
|
||||
|
||||
public Model200Response name(Integer name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(Integer name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Model200Response PropertyClass(String PropertyClass) {
|
||||
this.PropertyClass = PropertyClass;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get PropertyClass
|
||||
* @return PropertyClass
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getPropertyClass() {
|
||||
return PropertyClass;
|
||||
}
|
||||
|
||||
public void setPropertyClass(String PropertyClass) {
|
||||
this.PropertyClass = PropertyClass;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Model200Response _200Response = (Model200Response) o;
|
||||
return Objects.equals(this.name, _200Response.name) &&
|
||||
Objects.equals(this.PropertyClass, _200Response.PropertyClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, PropertyClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Model200Response {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" PropertyClass: ").append(toIndentedString(PropertyClass)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -8,68 +8,74 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ModelApiResponse
|
||||
*/
|
||||
|
||||
public class ModelApiResponse {
|
||||
|
||||
private Integer code = null;
|
||||
|
||||
private String type = null;
|
||||
|
||||
private String message = null;
|
||||
|
||||
/**
|
||||
**/
|
||||
public ModelApiResponse code(Integer code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get code
|
||||
* @return code
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("code")
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
public ModelApiResponse type(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get type
|
||||
* @return type
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("type")
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
public ModelApiResponse message(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get message
|
||||
* @return message
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("message")
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
@ -77,9 +83,9 @@ public class ModelApiResponse {
|
||||
return false;
|
||||
}
|
||||
ModelApiResponse _apiResponse = (ModelApiResponse) o;
|
||||
return Objects.equals(code, _apiResponse.code) &&
|
||||
Objects.equals(type, _apiResponse.type) &&
|
||||
Objects.equals(message, _apiResponse.message);
|
||||
return Objects.equals(this.code, _apiResponse.code) &&
|
||||
Objects.equals(this.type, _apiResponse.type) &&
|
||||
Objects.equals(this.message, _apiResponse.message);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -103,7 +109,7 @@ public class ModelApiResponse {
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
|
@ -0,0 +1,79 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Model for testing reserved words
|
||||
**/
|
||||
|
||||
/**
|
||||
* Model for testing reserved words
|
||||
*/
|
||||
@ApiModel(description = "Model for testing reserved words")
|
||||
|
||||
public class ModelReturn {
|
||||
private Integer _return = null;
|
||||
|
||||
public ModelReturn _return(Integer _return) {
|
||||
this._return = _return;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _return
|
||||
* @return _return
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Integer getReturn() {
|
||||
return _return;
|
||||
}
|
||||
|
||||
public void setReturn(Integer _return) {
|
||||
this._return = _return;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelReturn _return = (ModelReturn) o;
|
||||
return Objects.equals(this._return, _return._return);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(_return);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelReturn {\n");
|
||||
|
||||
sb.append(" _return: ").append(toIndentedString(_return)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,127 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Model for testing model name same as property name
|
||||
**/
|
||||
|
||||
/**
|
||||
* Model for testing model name same as property name
|
||||
*/
|
||||
@ApiModel(description = "Model for testing model name same as property name")
|
||||
|
||||
public class Name {
|
||||
private Integer name = null;
|
||||
|
||||
private Integer snakeCase = null;
|
||||
|
||||
private String property = null;
|
||||
|
||||
private Integer _123Number = null;
|
||||
|
||||
public Name name(Integer name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
public Integer getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(Integer name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get snakeCase
|
||||
* @return snakeCase
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Integer getSnakeCase() {
|
||||
return snakeCase;
|
||||
}
|
||||
|
||||
public Name property(String property) {
|
||||
this.property = property;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get property
|
||||
* @return property
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getProperty() {
|
||||
return property;
|
||||
}
|
||||
|
||||
public void setProperty(String property) {
|
||||
this.property = property;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _123Number
|
||||
* @return _123Number
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Integer get123Number() {
|
||||
return _123Number;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Name name = (Name) o;
|
||||
return Objects.equals(this.name, name.name) &&
|
||||
Objects.equals(this.snakeCase, name.snakeCase) &&
|
||||
Objects.equals(this.property, name.property) &&
|
||||
Objects.equals(this._123Number, name._123Number);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(name, snakeCase, property, _123Number);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Name {\n");
|
||||
|
||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
||||
sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n");
|
||||
sb.append(" property: ").append(toIndentedString(property)).append("\n");
|
||||
sb.append(" _123Number: ").append(toIndentedString(_123Number)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,76 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* NumberOnly
|
||||
*/
|
||||
|
||||
public class NumberOnly {
|
||||
private BigDecimal justNumber = null;
|
||||
|
||||
public NumberOnly justNumber(BigDecimal justNumber) {
|
||||
this.justNumber = justNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get justNumber
|
||||
* @return justNumber
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public BigDecimal getJustNumber() {
|
||||
return justNumber;
|
||||
}
|
||||
|
||||
public void setJustNumber(BigDecimal justNumber) {
|
||||
this.justNumber = justNumber;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
NumberOnly numberOnly = (NumberOnly) o;
|
||||
return Objects.equals(this.justNumber, numberOnly.justNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(justNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class NumberOnly {\n");
|
||||
|
||||
sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -10,19 +10,27 @@ import java.util.Date;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Order
|
||||
*/
|
||||
|
||||
public class Order {
|
||||
|
||||
private Long id = null;
|
||||
|
||||
private Long petId = null;
|
||||
|
||||
private Integer quantity = null;
|
||||
|
||||
private Date shipDate = null;
|
||||
|
||||
|
||||
/**
|
||||
* Order Status
|
||||
*/
|
||||
public enum StatusEnum {
|
||||
PLACED("placed"),
|
||||
|
||||
APPROVED("approved"),
|
||||
|
||||
DELIVERED("delivered");
|
||||
|
||||
private String value;
|
||||
@ -32,121 +40,126 @@ public class Order {
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public String toString() {
|
||||
return value;
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
private StatusEnum status = null;
|
||||
|
||||
private Boolean complete = false;
|
||||
|
||||
/**
|
||||
**/
|
||||
public Order id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("id")
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
public Order petId(Long petId) {
|
||||
this.petId = petId;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get petId
|
||||
* @return petId
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("petId")
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
}
|
||||
|
||||
public void setPetId(Long petId) {
|
||||
this.petId = petId;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
public Order quantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get quantity
|
||||
* @return quantity
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("quantity")
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
public Order shipDate(Date shipDate) {
|
||||
this.shipDate = shipDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get shipDate
|
||||
* @return shipDate
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("shipDate")
|
||||
public Date getShipDate() {
|
||||
return shipDate;
|
||||
}
|
||||
|
||||
public void setShipDate(Date shipDate) {
|
||||
this.shipDate = shipDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Order Status
|
||||
**/
|
||||
public Order status(StatusEnum status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Order Status
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(value = "Order Status")
|
||||
@JsonProperty("status")
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(StatusEnum status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
public Order complete(Boolean complete) {
|
||||
this.complete = complete;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get complete
|
||||
* @return complete
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("complete")
|
||||
public Boolean getComplete() {
|
||||
return complete;
|
||||
}
|
||||
|
||||
public void setComplete(Boolean complete) {
|
||||
this.complete = complete;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
@ -154,12 +167,12 @@ public class Order {
|
||||
return false;
|
||||
}
|
||||
Order order = (Order) o;
|
||||
return Objects.equals(id, order.id) &&
|
||||
Objects.equals(petId, order.petId) &&
|
||||
Objects.equals(quantity, order.quantity) &&
|
||||
Objects.equals(shipDate, order.shipDate) &&
|
||||
Objects.equals(status, order.status) &&
|
||||
Objects.equals(complete, order.complete);
|
||||
return Objects.equals(this.id, order.id) &&
|
||||
Objects.equals(this.petId, order.petId) &&
|
||||
Objects.equals(this.quantity, order.quantity) &&
|
||||
Objects.equals(this.shipDate, order.shipDate) &&
|
||||
Objects.equals(this.status, order.status) &&
|
||||
Objects.equals(this.complete, order.complete);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -186,7 +199,7 @@ public class Order {
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
|
@ -13,20 +13,29 @@ import java.util.List;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Pet
|
||||
*/
|
||||
|
||||
public class Pet {
|
||||
|
||||
private Long id = null;
|
||||
|
||||
private Category category = null;
|
||||
|
||||
private String name = null;
|
||||
|
||||
private List<String> photoUrls = new ArrayList<String>();
|
||||
|
||||
private List<Tag> tags = new ArrayList<Tag>();
|
||||
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
*/
|
||||
public enum StatusEnum {
|
||||
AVAILABLE("available"),
|
||||
|
||||
PENDING("pending"),
|
||||
|
||||
SOLD("sold");
|
||||
|
||||
private String value;
|
||||
@ -36,120 +45,134 @@ public class Pet {
|
||||
}
|
||||
|
||||
@Override
|
||||
@JsonValue
|
||||
public String toString() {
|
||||
return value;
|
||||
return String.valueOf(value);
|
||||
}
|
||||
}
|
||||
|
||||
private StatusEnum status = null;
|
||||
|
||||
/**
|
||||
**/
|
||||
public Pet id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("id")
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
public Pet category(Category category) {
|
||||
this.category = category;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get category
|
||||
* @return category
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("category")
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(Category category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
public Pet name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
@JsonProperty("name")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
public Pet photoUrls(List<String> photoUrls) {
|
||||
this.photoUrls = photoUrls;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Pet addPhotoUrlsItem(String photoUrlsItem) {
|
||||
this.photoUrls.add(photoUrlsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get photoUrls
|
||||
* @return photoUrls
|
||||
**/
|
||||
@ApiModelProperty(required = true, value = "")
|
||||
@JsonProperty("photoUrls")
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
|
||||
public void setPhotoUrls(List<String> photoUrls) {
|
||||
this.photoUrls = photoUrls;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
public Pet tags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Pet addTagsItem(Tag tagsItem) {
|
||||
this.tags.add(tagsItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tags
|
||||
* @return tags
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("tags")
|
||||
public List<Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setTags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
**/
|
||||
public Pet status(StatusEnum status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
* @return status
|
||||
**/
|
||||
@ApiModelProperty(value = "pet status in the store")
|
||||
@JsonProperty("status")
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(StatusEnum status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
@ -157,12 +180,12 @@ public class Pet {
|
||||
return false;
|
||||
}
|
||||
Pet pet = (Pet) o;
|
||||
return Objects.equals(id, pet.id) &&
|
||||
Objects.equals(category, pet.category) &&
|
||||
Objects.equals(name, pet.name) &&
|
||||
Objects.equals(photoUrls, pet.photoUrls) &&
|
||||
Objects.equals(tags, pet.tags) &&
|
||||
Objects.equals(status, pet.status);
|
||||
return Objects.equals(this.id, pet.id) &&
|
||||
Objects.equals(this.category, pet.category) &&
|
||||
Objects.equals(this.name, pet.name) &&
|
||||
Objects.equals(this.photoUrls, pet.photoUrls) &&
|
||||
Objects.equals(this.tags, pet.tags) &&
|
||||
Objects.equals(this.status, pet.status);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -189,7 +212,7 @@ public class Pet {
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
|
@ -0,0 +1,88 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ReadOnlyFirst
|
||||
*/
|
||||
|
||||
public class ReadOnlyFirst {
|
||||
private String bar = null;
|
||||
|
||||
private String baz = null;
|
||||
|
||||
/**
|
||||
* Get bar
|
||||
* @return bar
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getBar() {
|
||||
return bar;
|
||||
}
|
||||
|
||||
public ReadOnlyFirst baz(String baz) {
|
||||
this.baz = baz;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get baz
|
||||
* @return baz
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public String getBaz() {
|
||||
return baz;
|
||||
}
|
||||
|
||||
public void setBaz(String baz) {
|
||||
this.baz = baz;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o;
|
||||
return Objects.equals(this.bar, readOnlyFirst.bar) &&
|
||||
Objects.equals(this.baz, readOnlyFirst.baz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(bar, baz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ReadOnlyFirst {\n");
|
||||
|
||||
sb.append(" bar: ").append(toIndentedString(bar)).append("\n");
|
||||
sb.append(" baz: ").append(toIndentedString(baz)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,75 @@
|
||||
package io.swagger.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* SpecialModelName
|
||||
*/
|
||||
|
||||
public class SpecialModelName {
|
||||
private Long specialPropertyName = null;
|
||||
|
||||
public SpecialModelName specialPropertyName(Long specialPropertyName) {
|
||||
this.specialPropertyName = specialPropertyName;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get specialPropertyName
|
||||
* @return specialPropertyName
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
public Long getSpecialPropertyName() {
|
||||
return specialPropertyName;
|
||||
}
|
||||
|
||||
public void setSpecialPropertyName(Long specialPropertyName) {
|
||||
this.specialPropertyName = specialPropertyName;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
SpecialModelName specialModelName = (SpecialModelName) o;
|
||||
return Objects.equals(this.specialPropertyName, specialModelName.specialPropertyName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(specialPropertyName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class SpecialModelName {\n");
|
||||
|
||||
sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
|
@ -8,50 +8,54 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Tag
|
||||
*/
|
||||
|
||||
public class Tag {
|
||||
|
||||
private Long id = null;
|
||||
|
||||
private String name = null;
|
||||
|
||||
/**
|
||||
**/
|
||||
public Tag id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("id")
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
public Tag name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get name
|
||||
* @return name
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("name")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
@ -59,8 +63,8 @@ public class Tag {
|
||||
return false;
|
||||
}
|
||||
Tag tag = (Tag) o;
|
||||
return Objects.equals(id, tag.id) &&
|
||||
Objects.equals(name, tag.name);
|
||||
return Objects.equals(this.id, tag.id) &&
|
||||
Objects.equals(this.name, tag.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -83,7 +87,7 @@ public class Tag {
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
|
@ -8,159 +8,174 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* User
|
||||
*/
|
||||
|
||||
public class User {
|
||||
|
||||
private Long id = null;
|
||||
|
||||
private String username = null;
|
||||
|
||||
private String firstName = null;
|
||||
|
||||
private String lastName = null;
|
||||
|
||||
private String email = null;
|
||||
|
||||
private String password = null;
|
||||
|
||||
private String phone = null;
|
||||
|
||||
private Integer userStatus = null;
|
||||
|
||||
/**
|
||||
**/
|
||||
public User id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
* @return id
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("id")
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
public User username(String username) {
|
||||
this.username = username;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get username
|
||||
* @return username
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("username")
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
public User firstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get firstName
|
||||
* @return firstName
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("firstName")
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
public User lastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get lastName
|
||||
* @return lastName
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("lastName")
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
public User email(String email) {
|
||||
this.email = email;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get email
|
||||
* @return email
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("email")
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
public User password(String password) {
|
||||
this.password = password;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get password
|
||||
* @return password
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("password")
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
public User phone(String phone) {
|
||||
this.phone = phone;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get phone
|
||||
* @return phone
|
||||
**/
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty("phone")
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* User Status
|
||||
**/
|
||||
public User userStatus(Integer userStatus) {
|
||||
this.userStatus = userStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* User Status
|
||||
* @return userStatus
|
||||
**/
|
||||
@ApiModelProperty(value = "User Status")
|
||||
@JsonProperty("userStatus")
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
}
|
||||
|
||||
public void setUserStatus(Integer userStatus) {
|
||||
this.userStatus = userStatus;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
public boolean equals(java.lang.Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
@ -168,14 +183,14 @@ public class User {
|
||||
return false;
|
||||
}
|
||||
User user = (User) o;
|
||||
return Objects.equals(id, user.id) &&
|
||||
Objects.equals(username, user.username) &&
|
||||
Objects.equals(firstName, user.firstName) &&
|
||||
Objects.equals(lastName, user.lastName) &&
|
||||
Objects.equals(email, user.email) &&
|
||||
Objects.equals(password, user.password) &&
|
||||
Objects.equals(phone, user.phone) &&
|
||||
Objects.equals(userStatus, user.userStatus);
|
||||
return Objects.equals(this.id, user.id) &&
|
||||
Objects.equals(this.username, user.username) &&
|
||||
Objects.equals(this.firstName, user.firstName) &&
|
||||
Objects.equals(this.lastName, user.lastName) &&
|
||||
Objects.equals(this.email, user.email) &&
|
||||
Objects.equals(this.password, user.password) &&
|
||||
Objects.equals(this.phone, user.phone) &&
|
||||
Objects.equals(this.userStatus, user.userStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -204,7 +219,7 @@ public class User {
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
private String toIndentedString(java.lang.Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ public class Bootstrap extends HttpServlet {
|
||||
public void init(ServletConfig config) throws ServletException {
|
||||
Info info = new Info()
|
||||
.title("Swagger Server")
|
||||
.description("This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.")
|
||||
.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: \" \\")
|
||||
.termsOfService("http://swagger.io/terms/")
|
||||
.contact(new Contact()
|
||||
.email("apiteam@swagger.io"))
|
||||
|
@ -0,0 +1,13 @@
|
||||
package io.swagger.api.factories;
|
||||
|
||||
import io.swagger.api.FakeApiService;
|
||||
import io.swagger.api.impl.FakeApiServiceImpl;
|
||||
|
||||
|
||||
public class FakeApiServiceFactory {
|
||||
private final static FakeApiService service = new FakeApiServiceImpl();
|
||||
|
||||
public static FakeApiService getFakeApi() {
|
||||
return service;
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package io.swagger.api.impl;
|
||||
|
||||
import io.swagger.api.*;
|
||||
import io.swagger.model.*;
|
||||
|
||||
import io.swagger.model.Client;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.util.List;
|
||||
import io.swagger.api.NotFoundException;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.SecurityContext;
|
||||
|
||||
|
||||
public class FakeApiServiceImpl extends FakeApiService {
|
||||
@Override
|
||||
public Response testClientModel(Client body, SecurityContext securityContext) throws NotFoundException {
|
||||
// do some magic!
|
||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||
}
|
||||
@Override
|
||||
public Response testEndpointParameters(BigDecimal number, Double _double, String string, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, byte[] binary, Date date, Date dateTime, String password, SecurityContext securityContext) throws NotFoundException {
|
||||
// do some magic!
|
||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||
}
|
||||
@Override
|
||||
public Response testEnumQueryParameters(String enumQueryString, BigDecimal enumQueryInteger, Double enumQueryDouble, SecurityContext securityContext) throws NotFoundException {
|
||||
// do some magic!
|
||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user