forked from loafle/openapi-generator-original
add array and map of enum support for C#
This commit is contained in:
@@ -223,58 +223,12 @@ public class DefaultCodegen {
|
||||
cm.allowableValues.put("enumVars", enumVars);
|
||||
}
|
||||
|
||||
// for enum model's properties
|
||||
// update codegen property enum with proper naming convention
|
||||
// and handling of numbers, special characters
|
||||
for (CodegenProperty var : cm.vars) {
|
||||
Map<String, Object> allowableValues = var.allowableValues;
|
||||
|
||||
// handle ArrayProperty
|
||||
if (var.items != null) {
|
||||
allowableValues = var.items.allowableValues;
|
||||
updateCodegenPropertyEnum(var);
|
||||
}
|
||||
|
||||
if (allowableValues == null) {
|
||||
continue;
|
||||
}
|
||||
//List<String> values = (List<String>) allowableValues.get("values");
|
||||
List<Object> values = (List<Object>) allowableValues.get("values");
|
||||
if (values == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// put "enumVars" map into `allowableValues", including `name` and `value`
|
||||
List<Map<String, String>> enumVars = new ArrayList<Map<String, String>>();
|
||||
String commonPrefix = findCommonPrefixOfVars(values);
|
||||
int truncateIdx = commonPrefix.length();
|
||||
for (Object value : values) {
|
||||
Map<String, String> enumVar = new HashMap<String, String>();
|
||||
String enumName;
|
||||
if (truncateIdx == 0) {
|
||||
enumName = value.toString();
|
||||
} else {
|
||||
enumName = value.toString().substring(truncateIdx);
|
||||
if ("".equals(enumName)) {
|
||||
enumName = value.toString();
|
||||
}
|
||||
}
|
||||
enumVar.put("name", toEnumVarName(enumName, var.datatype));
|
||||
enumVar.put("value", toEnumValue(value.toString(), var.datatype));
|
||||
enumVars.add(enumVar);
|
||||
}
|
||||
allowableValues.put("enumVars", enumVars);
|
||||
// handle default value for enum, e.g. available => StatusEnum.AVAILABLE
|
||||
if (var.defaultValue != null) {
|
||||
String enumName = null;
|
||||
for (Map<String, String> enumVar : enumVars) {
|
||||
if (toEnumValue(var.defaultValue, var.datatype).equals(enumVar.get("value"))) {
|
||||
enumName = enumVar.get("name");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (enumName != null) {
|
||||
var.defaultValue = toEnumDefaultValue(enumName, var.datatypeWithEnum);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return objs;
|
||||
}
|
||||
@@ -1575,45 +1529,134 @@ public class DefaultCodegen {
|
||||
property.isContainer = true;
|
||||
property.isListContainer = true;
|
||||
property.containerType = "array";
|
||||
property.baseType = getSwaggerType(p);
|
||||
// handle inner property
|
||||
ArrayProperty ap = (ArrayProperty) p;
|
||||
CodegenProperty cp = fromProperty(property.name, ap.getItems());
|
||||
if (cp == null) {
|
||||
LOGGER.warn("skipping invalid property " + Json.pretty(p));
|
||||
} else {
|
||||
property.baseType = getSwaggerType(p);
|
||||
if (!languageSpecificPrimitives.contains(cp.baseType)) {
|
||||
property.complexType = cp.baseType;
|
||||
} else {
|
||||
property.isPrimitiveType = true;
|
||||
}
|
||||
property.items = cp;
|
||||
if (property.items.isEnum) {
|
||||
property.datatypeWithEnum = property.datatypeWithEnum.replace(property.items.baseType,
|
||||
property.items.datatypeWithEnum);
|
||||
if(property.defaultValue != null)
|
||||
property.defaultValue = property.defaultValue.replace(property.items.baseType, property.items.datatypeWithEnum);
|
||||
}
|
||||
}
|
||||
updatePropertyForArray(property, cp);
|
||||
} else if (p instanceof MapProperty) {
|
||||
property.isContainer = true;
|
||||
property.isMapContainer = true;
|
||||
property.containerType = "map";
|
||||
property.baseType = getSwaggerType(p);
|
||||
// handle inner property
|
||||
MapProperty ap = (MapProperty) p;
|
||||
CodegenProperty cp = fromProperty("inner", ap.getAdditionalProperties());
|
||||
property.items = cp;
|
||||
|
||||
property.baseType = getSwaggerType(p);
|
||||
if (!languageSpecificPrimitives.contains(cp.baseType)) {
|
||||
property.complexType = cp.baseType;
|
||||
} else {
|
||||
property.isPrimitiveType = true;
|
||||
}
|
||||
updatePropertyForMap(property, cp);
|
||||
} else {
|
||||
setNonArrayMapProperty(property, type);
|
||||
}
|
||||
return property;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update property for array(list) container
|
||||
* @param property Codegen property
|
||||
* @param innerProperty Codegen inner property of map or list
|
||||
*/
|
||||
protected void updatePropertyForArray(CodegenProperty property, CodegenProperty innerProperty) {
|
||||
if (innerProperty == null) {
|
||||
LOGGER.warn("skipping invalid array property " + Json.pretty(property));
|
||||
} else {
|
||||
if (!languageSpecificPrimitives.contains(innerProperty.baseType)) {
|
||||
property.complexType = innerProperty.baseType;
|
||||
} else {
|
||||
property.isPrimitiveType = true;
|
||||
}
|
||||
property.items = innerProperty;
|
||||
// inner item is Enum
|
||||
if (isPropertyInnerMostEnum(property)) {
|
||||
property.isEnum = true;
|
||||
// update datatypeWithEnum for array
|
||||
// e.g. List<string> => List<StatusEnum>
|
||||
updateDataTypeWithEnumForArray(property);
|
||||
|
||||
// TOOD need to revise the default value for enum
|
||||
if (property.defaultValue != null) {
|
||||
property.defaultValue = property.defaultValue.replace(property.items.baseType, property.items.datatypeWithEnum);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update property for map container
|
||||
* @param property Codegen property
|
||||
* @param innerProperty Codegen inner property of map or list
|
||||
*/
|
||||
protected void updatePropertyForMap(CodegenProperty property, CodegenProperty innerProperty) {
|
||||
if (innerProperty == null) {
|
||||
LOGGER.warn("skipping invalid map property " + Json.pretty(property));
|
||||
return;
|
||||
} else {
|
||||
if (!languageSpecificPrimitives.contains(innerProperty.baseType)) {
|
||||
property.complexType = innerProperty.baseType;
|
||||
} else {
|
||||
property.isPrimitiveType = true;
|
||||
}
|
||||
property.items = innerProperty;
|
||||
// inner item is Enum
|
||||
if (isPropertyInnerMostEnum(property)) {
|
||||
property.isEnum = true;
|
||||
// update datatypeWithEnum for map
|
||||
// e.g. Dictionary<string, string> => Dictionary<string, StatusEnum>
|
||||
updateDataTypeWithEnumForMap(property);
|
||||
|
||||
// TOOD need to revise the default value for enum
|
||||
// set default value
|
||||
if (property.defaultValue != null) {
|
||||
property.defaultValue = property.defaultValue.replace(property.items.baseType, property.items.datatypeWithEnum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Update property for map container
|
||||
* @param property Codegen property
|
||||
* @return True if the inner most type is enum
|
||||
*/
|
||||
protected Boolean isPropertyInnerMostEnum(CodegenProperty property) {
|
||||
CodegenProperty currentProperty = property;
|
||||
while (currentProperty != null && (Boolean.TRUE.equals(currentProperty.isMapContainer)
|
||||
|| Boolean.TRUE.equals(currentProperty.isListContainer))) {
|
||||
currentProperty = currentProperty.items;
|
||||
}
|
||||
|
||||
return currentProperty.isEnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update datatypeWithEnum for array container
|
||||
* @param property Codegen property
|
||||
*/
|
||||
protected void updateDataTypeWithEnumForArray(CodegenProperty property) {
|
||||
CodegenProperty baseItem = property.items;
|
||||
while (baseItem != null && (Boolean.TRUE.equals(baseItem.isMapContainer)
|
||||
|| Boolean.TRUE.equals(baseItem.isListContainer))) {
|
||||
baseItem = baseItem.items;
|
||||
}
|
||||
// set both datatype and datetypeWithEnum as only the inner type is enum
|
||||
property.datatypeWithEnum = property.datatypeWithEnum.replace(baseItem.baseType, toEnumName(baseItem));
|
||||
//property.datatype = property.datatypeWithEnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update datatypeWithEnum for map container
|
||||
* @param property Codegen property
|
||||
*/
|
||||
protected void updateDataTypeWithEnumForMap(CodegenProperty property) {
|
||||
CodegenProperty baseItem = property.items;
|
||||
while (baseItem != null && (Boolean.TRUE.equals(baseItem.isMapContainer)
|
||||
|| Boolean.TRUE.equals(baseItem.isListContainer))) {
|
||||
baseItem = baseItem.items;
|
||||
}
|
||||
// set both datatype and datetypeWithEnum as only the inner type is enum
|
||||
property.datatypeWithEnum = property.datatypeWithEnum.replace(", " + baseItem.baseType, ", " + toEnumName(baseItem));
|
||||
//property.datatype = property.datatypeWithEnum;
|
||||
}
|
||||
|
||||
protected void setNonArrayMapProperty(CodegenProperty property, String type) {
|
||||
property.isNotContainer = true;
|
||||
if (languageSpecificPrimitives().contains(type)) {
|
||||
@@ -2064,22 +2107,28 @@ public class DefaultCodegen {
|
||||
LOGGER.warn("warning! Property type \"" + type + "\" not found for parameter \"" + param.getName() + "\", using String");
|
||||
property = new StringProperty().description("//TODO automatically added by swagger-codegen. Type was " + type + " but not supported");
|
||||
}
|
||||
|
||||
property.setRequired(param.getRequired());
|
||||
CodegenProperty model = fromProperty(qp.getName(), property);
|
||||
CodegenProperty cp = fromProperty(qp.getName(), property);
|
||||
|
||||
// set boolean flag (e.g. isString)
|
||||
setParameterBooleanFlagWithCodegenProperty(p, model);
|
||||
setParameterBooleanFlagWithCodegenProperty(p, cp);
|
||||
|
||||
p.dataType = model.datatype;
|
||||
if(model.isEnum) {
|
||||
p.datatypeWithEnum = model.datatypeWithEnum;
|
||||
p.dataType = cp.datatype;
|
||||
if(cp.isEnum) {
|
||||
p.datatypeWithEnum = cp.datatypeWithEnum;
|
||||
}
|
||||
p.isEnum = model.isEnum;
|
||||
p._enum = model._enum;
|
||||
p.allowableValues = model.allowableValues;
|
||||
if(model.items != null && model.items.isEnum) {
|
||||
p.datatypeWithEnum = model.datatypeWithEnum;
|
||||
p.items = model.items;
|
||||
|
||||
// enum
|
||||
updateCodegenPropertyEnum(cp);
|
||||
p.isEnum = cp.isEnum;
|
||||
p._enum = cp._enum;
|
||||
p.allowableValues = cp.allowableValues;
|
||||
|
||||
|
||||
if (cp.items != null && cp.items.isEnum) {
|
||||
p.datatypeWithEnum = cp.datatypeWithEnum;
|
||||
p.items = cp.items;
|
||||
}
|
||||
p.collectionFormat = collectionFormat;
|
||||
if(collectionFormat != null && collectionFormat.equals("multi")) {
|
||||
@@ -2087,10 +2136,12 @@ public class DefaultCodegen {
|
||||
}
|
||||
p.paramName = toParamName(qp.getName());
|
||||
|
||||
if (model.complexType != null) {
|
||||
imports.add(model.complexType);
|
||||
// import
|
||||
if (cp.complexType != null) {
|
||||
imports.add(cp.complexType);
|
||||
}
|
||||
|
||||
// validation
|
||||
p.maximum = qp.getMaximum();
|
||||
p.exclusiveMaximum = qp.isExclusiveMaximum();
|
||||
p.minimum = qp.getMinimum();
|
||||
@@ -3026,4 +3077,63 @@ public class DefaultCodegen {
|
||||
LOGGER.debug("Property type is not primitive: " + property.datatype);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* update codegen property's enum by adding "enumVars" (which has name and value)
|
||||
*
|
||||
* @param cpList list of CodegenProperty
|
||||
*/
|
||||
public void updateCodegenPropertyEnum(CodegenProperty var) {
|
||||
Map<String, Object> allowableValues = var.allowableValues;
|
||||
|
||||
// handle ArrayProperty
|
||||
if (var.items != null) {
|
||||
allowableValues = var.items.allowableValues;
|
||||
}
|
||||
|
||||
if (allowableValues == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
//List<String> values = (List<String>) allowableValues.get("values");
|
||||
List<Object> values = (List<Object>) allowableValues.get("values");
|
||||
if (values == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// put "enumVars" map into `allowableValues", including `name` and `value`
|
||||
List<Map<String, String>> enumVars = new ArrayList<Map<String, String>>();
|
||||
String commonPrefix = findCommonPrefixOfVars(values);
|
||||
int truncateIdx = commonPrefix.length();
|
||||
for (Object value : values) {
|
||||
Map<String, String> enumVar = new HashMap<String, String>();
|
||||
String enumName;
|
||||
if (truncateIdx == 0) {
|
||||
enumName = value.toString();
|
||||
} else {
|
||||
enumName = value.toString().substring(truncateIdx);
|
||||
if ("".equals(enumName)) {
|
||||
enumName = value.toString();
|
||||
}
|
||||
}
|
||||
enumVar.put("name", toEnumVarName(enumName, var.datatype));
|
||||
enumVar.put("value", toEnumValue(value.toString(), var.datatype));
|
||||
enumVars.add(enumVar);
|
||||
}
|
||||
allowableValues.put("enumVars", enumVars);
|
||||
// handle default value for enum, e.g. available => StatusEnum.AVAILABLE
|
||||
if (var.defaultValue != null) {
|
||||
String enumName = null;
|
||||
for (Map<String, String> enumVar : enumVars) {
|
||||
if (toEnumValue(var.defaultValue, var.datatype).equals(enumVar.get("value"))) {
|
||||
enumName = enumVar.get("name");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (enumName != null) {
|
||||
var.defaultValue = toEnumDefaultValue(enumName, var.datatypeWithEnum);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
/// </summary>{{#description}}
|
||||
/// <value>{{{description}}}</value>{{/description}}
|
||||
[DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})]
|
||||
public {{{datatypeWithEnum}}}{{#isEnum}}?{{/isEnum}} {{name}} { get; set; }
|
||||
public {{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}?{{/isContainer}}{{/isEnum}} {{name}} { get; set; }
|
||||
{{/isEnum}}
|
||||
{{/vars}}
|
||||
{{#hasRequired}}
|
||||
@@ -44,7 +44,7 @@
|
||||
{{#hasOnlyReadOnly}}
|
||||
[JsonConstructorAttribute]
|
||||
{{/hasOnlyReadOnly}}
|
||||
public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}?{{/isEnum}} {{name}} = null{{^-last}}, {{/-last}}{{/readWriteVars}})
|
||||
public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}?{{/isContainer}}{{/isEnum}} {{name}} = null{{^-last}}, {{/-last}}{{/readWriteVars}})
|
||||
{
|
||||
{{#vars}}
|
||||
{{^isReadOnly}}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{{^isContainer}}
|
||||
/// <summary>
|
||||
/// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}}
|
||||
/// </summary>{{#description}}
|
||||
/// <value>{{{description}}}</value>{{/description}}
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}
|
||||
public enum {{#datatypeWithEnum}}{{&.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}
|
||||
{
|
||||
{{#allowableValues}}{{#enumVars}}
|
||||
/// <summary>
|
||||
@@ -13,3 +14,4 @@
|
||||
{{name}}{{#isLong}} = {{{value}}}{{/isLong}}{{#isInteger}} = {{{value}}}{{/isInteger}}{{^-last}},
|
||||
{{/-last}}{{/enumVars}}{{/allowableValues}}
|
||||
}
|
||||
{{/isContainer}}
|
||||
|
||||
@@ -561,6 +561,47 @@ paths:
|
||||
description: User not found
|
||||
|
||||
/fake:
|
||||
get:
|
||||
tags:
|
||||
- fake
|
||||
summary: To test enum query parameters
|
||||
descriptions: To test enum query parameters
|
||||
operationId: testEnumQueryParameters
|
||||
consumes:
|
||||
- application/json
|
||||
produces:
|
||||
- application/json
|
||||
parameters:
|
||||
- name: enum_query_string
|
||||
type: string
|
||||
default: '-efg'
|
||||
enum:
|
||||
- _abc
|
||||
- '-efg'
|
||||
- (xyz)
|
||||
in: formData
|
||||
description: Query parameter enum test (string)
|
||||
- name: enum_query_integer
|
||||
type: number
|
||||
format: int32
|
||||
enum:
|
||||
- 1
|
||||
- -2
|
||||
in: query
|
||||
description: Query parameter enum test (double)
|
||||
- name: enum_query_double
|
||||
type: number
|
||||
format: double
|
||||
enum:
|
||||
- 1.1
|
||||
- -1.2
|
||||
in: formData
|
||||
description: Query parameter enum test (double)
|
||||
responses:
|
||||
'400':
|
||||
description: Invalid request
|
||||
'404':
|
||||
description: Not found
|
||||
post:
|
||||
tags:
|
||||
- fake
|
||||
@@ -994,6 +1035,31 @@ definitions:
|
||||
foo:
|
||||
type: string
|
||||
readOnly: true
|
||||
MapTest:
|
||||
type: object
|
||||
properties:
|
||||
map_map_of_string:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
map_map_of_enum:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
enum:
|
||||
- UPPER
|
||||
- lower
|
||||
map_of_enum_string:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: string
|
||||
enum:
|
||||
- UPPER
|
||||
- lower
|
||||
ArrayTest:
|
||||
type: object
|
||||
properties:
|
||||
@@ -1014,6 +1080,13 @@ definitions:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/ReadOnlyFirst'
|
||||
array_of_enum:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
enum:
|
||||
- UPPER
|
||||
- lower
|
||||
NumberOnly:
|
||||
type: object
|
||||
properties:
|
||||
|
||||
@@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
VisualStudioVersion = 12.0.0.0
|
||||
MinimumVisualStudioVersion = 10.0.0.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{EC130B5E-75A2-4FA3-BEE2-634A4FFF231C}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{9391D4F3-E89A-41F1-B1C9-A9C885B3F96D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
|
||||
EndProject
|
||||
@@ -12,10 +12,10 @@ Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{EC130B5E-75A2-4FA3-BEE2-634A4FFF231C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EC130B5E-75A2-4FA3-BEE2-634A4FFF231C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EC130B5E-75A2-4FA3-BEE2-634A4FFF231C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EC130B5E-75A2-4FA3-BEE2-634A4FFF231C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9391D4F3-E89A-41F1-B1C9-A9C885B3F96D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9391D4F3-E89A-41F1-B1C9-A9C885B3F96D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9391D4F3-E89A-41F1-B1C9-A9C885B3F96D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9391D4F3-E89A-41F1-B1C9-A9C885B3F96D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
|
||||
@@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c
|
||||
|
||||
- API version: 1.0.0
|
||||
- SDK version: 1.0.0
|
||||
- Build date: 2016-06-21T16:06:28.848+08:00
|
||||
- Build date: 2016-06-23T12:09:14.609+08:00
|
||||
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen
|
||||
|
||||
## Frameworks supported
|
||||
@@ -88,6 +88,7 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
*FakeApi* | [**TestEnumQueryParameters**](docs/FakeApi.md#testenumqueryparameters) | **GET** /fake | To test enum query parameters
|
||||
*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
|
||||
*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
@@ -116,6 +117,8 @@ Class | Method | HTTP request | Description
|
||||
- [Model.Animal](docs/Animal.md)
|
||||
- [Model.AnimalFarm](docs/AnimalFarm.md)
|
||||
- [Model.ApiResponse](docs/ApiResponse.md)
|
||||
- [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
|
||||
- [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
|
||||
- [Model.ArrayTest](docs/ArrayTest.md)
|
||||
- [Model.Cat](docs/Cat.md)
|
||||
- [Model.Category](docs/Category.md)
|
||||
@@ -124,10 +127,12 @@ Class | Method | HTTP request | Description
|
||||
- [Model.EnumTest](docs/EnumTest.md)
|
||||
- [Model.FormatTest](docs/FormatTest.md)
|
||||
- [Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
|
||||
- [Model.MapTest](docs/MapTest.md)
|
||||
- [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
|
||||
- [Model.Model200Response](docs/Model200Response.md)
|
||||
- [Model.ModelReturn](docs/ModelReturn.md)
|
||||
- [Model.Name](docs/Name.md)
|
||||
- [Model.NumberOnly](docs/NumberOnly.md)
|
||||
- [Model.Order](docs/Order.md)
|
||||
- [Model.Pet](docs/Pet.md)
|
||||
- [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md)
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# IO.Swagger.Model.ArrayOfArrayOfNumberOnly
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ArrayArrayNumber** | **List<List<decimal?>>** | | [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,9 @@
|
||||
# IO.Swagger.Model.ArrayOfNumberOnly
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ArrayNumber** | **List<decimal?>** | | [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)
|
||||
|
||||
@@ -6,6 +6,7 @@ Name | Type | Description | Notes
|
||||
**ArrayOfString** | **List<string>** | | [optional]
|
||||
**ArrayArrayOfInteger** | **List<List<long?>>** | | [optional]
|
||||
**ArrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional]
|
||||
**ArrayOfEnum** | **List<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)
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
[**TestEnumQueryParameters**](FakeApi.md#testenumqueryparameters) | **GET** /fake | To test enum query parameters
|
||||
|
||||
|
||||
# **TestEndpointParameters**
|
||||
@@ -89,3 +90,65 @@ No authorization required
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **TestEnumQueryParameters**
|
||||
> void TestEnumQueryParameters (string enumQueryString = null, decimal? enumQueryInteger = null, double? enumQueryDouble = null)
|
||||
|
||||
To test enum query parameters
|
||||
|
||||
### Example
|
||||
```csharp
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Client;
|
||||
using IO.Swagger.Model;
|
||||
|
||||
namespace Example
|
||||
{
|
||||
public class TestEnumQueryParametersExample
|
||||
{
|
||||
public void main()
|
||||
{
|
||||
|
||||
var apiInstance = new FakeApi();
|
||||
var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg)
|
||||
var enumQueryInteger = 3.4; // decimal? | Query parameter enum test (double) (optional)
|
||||
var enumQueryDouble = 1.2; // double? | Query parameter enum test (double) (optional)
|
||||
|
||||
try
|
||||
{
|
||||
// To test enum query parameters
|
||||
apiInstance.TestEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Print("Exception when calling FakeApi.TestEnumQueryParameters: " + e.Message );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**enumQueryString** | **string**| Query parameter enum test (string) | [optional] [default to -efg]
|
||||
**enumQueryInteger** | **decimal?**| Query parameter enum test (double) | [optional]
|
||||
**enumQueryDouble** | **double?**| Query parameter enum test (double) | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
void (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# IO.Swagger.Model.NumberOnly
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**JustNumber** | **decimal?** | | [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,9 @@
|
||||
# IO.Swagger.Model.PropertyType
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Type** | **decimal?** | | [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,90 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing ArrayOfArrayOfNumberOnly
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class ArrayOfArrayOfNumberOnlyTests
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for ArrayOfArrayOfNumberOnly
|
||||
//private ArrayOfArrayOfNumberOnly instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
// TODO uncomment below to create an instance of ArrayOfArrayOfNumberOnly
|
||||
//instance = new ArrayOfArrayOfNumberOnly();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of ArrayOfArrayOfNumberOnly
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void ArrayOfArrayOfNumberOnlyInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsInstanceOfType" ArrayOfArrayOfNumberOnly
|
||||
//Assert.IsInstanceOfType<ArrayOfArrayOfNumberOnly> (instance, "variable 'instance' is a ArrayOfArrayOfNumberOnly");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ArrayArrayNumber'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void ArrayArrayNumberTest()
|
||||
{
|
||||
// TODO unit test for the property 'ArrayArrayNumber'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing ArrayOfNumberOnly
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class ArrayOfNumberOnlyTests
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for ArrayOfNumberOnly
|
||||
//private ArrayOfNumberOnly instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
// TODO uncomment below to create an instance of ArrayOfNumberOnly
|
||||
//instance = new ArrayOfNumberOnly();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of ArrayOfNumberOnly
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void ArrayOfNumberOnlyInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsInstanceOfType" ArrayOfNumberOnly
|
||||
//Assert.IsInstanceOfType<ArrayOfNumberOnly> (instance, "variable 'instance' is a ArrayOfNumberOnly");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ArrayNumber'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void ArrayNumberTest()
|
||||
{
|
||||
// TODO unit test for the property 'ArrayNumber'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing NumberOnly
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class NumberOnlyTests
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for NumberOnly
|
||||
//private NumberOnly instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
// TODO uncomment below to create an instance of NumberOnly
|
||||
//instance = new NumberOnly();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of NumberOnly
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void NumberOnlyInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsInstanceOfType" NumberOnly
|
||||
//Assert.IsInstanceOfType<NumberOnly> (instance, "variable 'instance' is a NumberOnly");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'JustNumber'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void JustNumberTest()
|
||||
{
|
||||
// TODO unit test for the property 'JustNumber'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using IO.Swagger.Api;
|
||||
using IO.Swagger.Model;
|
||||
using IO.Swagger.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace IO.Swagger.Test
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing PropertyType
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by Swagger Codegen.
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
[TestFixture]
|
||||
public class PropertyTypeTests
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for PropertyType
|
||||
//private PropertyType instance;
|
||||
|
||||
/// <summary>
|
||||
/// Setup before each test
|
||||
/// </summary>
|
||||
[SetUp]
|
||||
public void Init()
|
||||
{
|
||||
// TODO uncomment below to create an instance of PropertyType
|
||||
//instance = new PropertyType();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up after each test
|
||||
/// </summary>
|
||||
[TearDown]
|
||||
public void Cleanup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of PropertyType
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void PropertyTypeInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsInstanceOfType" PropertyType
|
||||
//Assert.IsInstanceOfType<PropertyType> (instance, "variable 'instance' is a PropertyType");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Type'
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'Type'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -78,6 +78,31 @@ namespace IO.Swagger.Api
|
||||
/// <param name="password">None (optional)</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
ApiResponse<Object> TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
|
||||
/// <summary>
|
||||
/// To test enum query parameters
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="enumQueryString">Query parameter enum test (string) (optional, default to -efg)</param>
|
||||
/// <param name="enumQueryInteger">Query parameter enum test (double) (optional)</param>
|
||||
/// <param name="enumQueryDouble">Query parameter enum test (double) (optional)</param>
|
||||
/// <returns></returns>
|
||||
void TestEnumQueryParameters (string enumQueryString = null, decimal? enumQueryInteger = null, double? enumQueryDouble = null);
|
||||
|
||||
/// <summary>
|
||||
/// To test enum query parameters
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="enumQueryString">Query parameter enum test (string) (optional, default to -efg)</param>
|
||||
/// <param name="enumQueryInteger">Query parameter enum test (double) (optional)</param>
|
||||
/// <param name="enumQueryDouble">Query parameter enum test (double) (optional)</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
ApiResponse<Object> TestEnumQueryParametersWithHttpInfo (string enumQueryString = null, decimal? enumQueryInteger = null, double? enumQueryDouble = null);
|
||||
#endregion Synchronous Operations
|
||||
#region Asynchronous Operations
|
||||
/// <summary>
|
||||
@@ -123,6 +148,31 @@ namespace IO.Swagger.Api
|
||||
/// <param name="password">None (optional)</param>
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Object>> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
|
||||
/// <summary>
|
||||
/// To test enum query parameters
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="enumQueryString">Query parameter enum test (string) (optional, default to -efg)</param>
|
||||
/// <param name="enumQueryInteger">Query parameter enum test (double) (optional)</param>
|
||||
/// <param name="enumQueryDouble">Query parameter enum test (double) (optional)</param>
|
||||
/// <returns>Task of void</returns>
|
||||
System.Threading.Tasks.Task TestEnumQueryParametersAsync (string enumQueryString = null, decimal? enumQueryInteger = null, double? enumQueryDouble = null);
|
||||
|
||||
/// <summary>
|
||||
/// To test enum query parameters
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="enumQueryString">Query parameter enum test (string) (optional, default to -efg)</param>
|
||||
/// <param name="enumQueryInteger">Query parameter enum test (double) (optional)</param>
|
||||
/// <param name="enumQueryDouble">Query parameter enum test (double) (optional)</param>
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<Object>> TestEnumQueryParametersAsyncWithHttpInfo (string enumQueryString = null, decimal? enumQueryInteger = null, double? enumQueryDouble = null);
|
||||
#endregion Asynchronous Operations
|
||||
}
|
||||
|
||||
@@ -459,6 +509,153 @@ namespace IO.Swagger.Api
|
||||
}
|
||||
|
||||
|
||||
return new ApiResponse<Object>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To test enum query parameters
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="enumQueryString">Query parameter enum test (string) (optional, default to -efg)</param>
|
||||
/// <param name="enumQueryInteger">Query parameter enum test (double) (optional)</param>
|
||||
/// <param name="enumQueryDouble">Query parameter enum test (double) (optional)</param>
|
||||
/// <returns></returns>
|
||||
public void TestEnumQueryParameters (string enumQueryString = null, decimal? enumQueryInteger = null, double? enumQueryDouble = null)
|
||||
{
|
||||
TestEnumQueryParametersWithHttpInfo(enumQueryString, enumQueryInteger, enumQueryDouble);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To test enum query parameters
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="enumQueryString">Query parameter enum test (string) (optional, default to -efg)</param>
|
||||
/// <param name="enumQueryInteger">Query parameter enum test (double) (optional)</param>
|
||||
/// <param name="enumQueryDouble">Query parameter enum test (double) (optional)</param>
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public ApiResponse<Object> TestEnumQueryParametersWithHttpInfo (string enumQueryString = null, decimal? enumQueryInteger = null, double? enumQueryDouble = null)
|
||||
{
|
||||
|
||||
var localVarPath = "/fake";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (enumQueryInteger != null) localVarQueryParams.Add("enum_query_integer", Configuration.ApiClient.ParameterToString(enumQueryInteger)); // query parameter
|
||||
if (enumQueryString != null) localVarFormParams.Add("enum_query_string", Configuration.ApiClient.ParameterToString(enumQueryString)); // form parameter
|
||||
if (enumQueryDouble != null) localVarFormParams.Add("enum_query_double", Configuration.ApiClient.ParameterToString(enumQueryDouble)); // form parameter
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) Configuration.ApiClient.CallApi(localVarPath,
|
||||
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (ExceptionFactory != null)
|
||||
{
|
||||
Exception exception = ExceptionFactory("TestEnumQueryParameters", localVarResponse);
|
||||
if (exception != null) throw exception;
|
||||
}
|
||||
|
||||
|
||||
return new ApiResponse<Object>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To test enum query parameters
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="enumQueryString">Query parameter enum test (string) (optional, default to -efg)</param>
|
||||
/// <param name="enumQueryInteger">Query parameter enum test (double) (optional)</param>
|
||||
/// <param name="enumQueryDouble">Query parameter enum test (double) (optional)</param>
|
||||
/// <returns>Task of void</returns>
|
||||
public async System.Threading.Tasks.Task TestEnumQueryParametersAsync (string enumQueryString = null, decimal? enumQueryInteger = null, double? enumQueryDouble = null)
|
||||
{
|
||||
await TestEnumQueryParametersAsyncWithHttpInfo(enumQueryString, enumQueryInteger, enumQueryDouble);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To test enum query parameters
|
||||
/// </summary>
|
||||
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="enumQueryString">Query parameter enum test (string) (optional, default to -efg)</param>
|
||||
/// <param name="enumQueryInteger">Query parameter enum test (double) (optional)</param>
|
||||
/// <param name="enumQueryDouble">Query parameter enum test (double) (optional)</param>
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
public async System.Threading.Tasks.Task<ApiResponse<Object>> TestEnumQueryParametersAsyncWithHttpInfo (string enumQueryString = null, decimal? enumQueryInteger = null, double? enumQueryDouble = null)
|
||||
{
|
||||
|
||||
var localVarPath = "/fake";
|
||||
var localVarPathParams = new Dictionary<String, String>();
|
||||
var localVarQueryParams = new Dictionary<String, String>();
|
||||
var localVarHeaderParams = new Dictionary<String, String>(Configuration.DefaultHeader);
|
||||
var localVarFormParams = new Dictionary<String, String>();
|
||||
var localVarFileParams = new Dictionary<String, FileParameter>();
|
||||
Object localVarPostBody = null;
|
||||
|
||||
// to determine the Content-Type header
|
||||
String[] localVarHttpContentTypes = new String[] {
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
|
||||
|
||||
// to determine the Accept header
|
||||
String[] localVarHttpHeaderAccepts = new String[] {
|
||||
"application/json"
|
||||
};
|
||||
String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
|
||||
if (localVarHttpHeaderAccept != null)
|
||||
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
|
||||
|
||||
// set "format" to json by default
|
||||
// e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
|
||||
localVarPathParams.Add("format", "json");
|
||||
if (enumQueryInteger != null) localVarQueryParams.Add("enum_query_integer", Configuration.ApiClient.ParameterToString(enumQueryInteger)); // query parameter
|
||||
if (enumQueryString != null) localVarFormParams.Add("enum_query_string", Configuration.ApiClient.ParameterToString(enumQueryString)); // form parameter
|
||||
if (enumQueryDouble != null) localVarFormParams.Add("enum_query_double", Configuration.ApiClient.ParameterToString(enumQueryDouble)); // form parameter
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
IRestResponse localVarResponse = (IRestResponse) await Configuration.ApiClient.CallApiAsync(localVarPath,
|
||||
Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
|
||||
localVarPathParams, localVarHttpContentType);
|
||||
|
||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||
|
||||
if (ExceptionFactory != null)
|
||||
{
|
||||
Exception exception = ExceptionFactory("TestEnumQueryParameters", localVarResponse);
|
||||
if (exception != null) throw exception;
|
||||
}
|
||||
|
||||
|
||||
return new ApiResponse<Object>(localVarStatusCode,
|
||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||
null);
|
||||
|
||||
@@ -24,7 +24,7 @@ limitations under the License.
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{EC130B5E-75A2-4FA3-BEE2-634A4FFF231C}</ProjectGuid>
|
||||
<ProjectGuid>{9391D4F3-E89A-41F1-B1C9-A9C885B3F96D}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Swagger Library</RootNamespace>
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// ArrayOfArrayOfNumberOnly
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class ArrayOfArrayOfNumberOnly : IEquatable<ArrayOfArrayOfNumberOnly>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ArrayOfArrayOfNumberOnly" /> class.
|
||||
/// </summary>
|
||||
/// <param name="ArrayArrayNumber">ArrayArrayNumber.</param>
|
||||
public ArrayOfArrayOfNumberOnly(List<List<decimal?>> ArrayArrayNumber = null)
|
||||
{
|
||||
this.ArrayArrayNumber = ArrayArrayNumber;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayArrayNumber
|
||||
/// </summary>
|
||||
[DataMember(Name="ArrayArrayNumber", EmitDefaultValue=false)]
|
||||
public List<List<decimal?>> ArrayArrayNumber { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class ArrayOfArrayOfNumberOnly {\n");
|
||||
sb.Append(" ArrayArrayNumber: ").Append(ArrayArrayNumber).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as ArrayOfArrayOfNumberOnly);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if ArrayOfArrayOfNumberOnly instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of ArrayOfArrayOfNumberOnly to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ArrayOfArrayOfNumberOnly other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.ArrayArrayNumber == other.ArrayArrayNumber ||
|
||||
this.ArrayArrayNumber != null &&
|
||||
this.ArrayArrayNumber.SequenceEqual(other.ArrayArrayNumber)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this.ArrayArrayNumber != null)
|
||||
hash = hash * 59 + this.ArrayArrayNumber.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// ArrayOfNumberOnly
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class ArrayOfNumberOnly : IEquatable<ArrayOfNumberOnly>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ArrayOfNumberOnly" /> class.
|
||||
/// </summary>
|
||||
/// <param name="ArrayNumber">ArrayNumber.</param>
|
||||
public ArrayOfNumberOnly(List<decimal?> ArrayNumber = null)
|
||||
{
|
||||
this.ArrayNumber = ArrayNumber;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayNumber
|
||||
/// </summary>
|
||||
[DataMember(Name="ArrayNumber", EmitDefaultValue=false)]
|
||||
public List<decimal?> ArrayNumber { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class ArrayOfNumberOnly {\n");
|
||||
sb.Append(" ArrayNumber: ").Append(ArrayNumber).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as ArrayOfNumberOnly);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if ArrayOfNumberOnly instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of ArrayOfNumberOnly to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ArrayOfNumberOnly other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.ArrayNumber == other.ArrayNumber ||
|
||||
this.ArrayNumber != null &&
|
||||
this.ArrayNumber.SequenceEqual(other.ArrayNumber)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this.ArrayNumber != null)
|
||||
hash = hash * 59 + this.ArrayNumber.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -39,17 +39,45 @@ namespace IO.Swagger.Model
|
||||
[DataContract]
|
||||
public partial class ArrayTest : IEquatable<ArrayTest>
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayOfEnum
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum ArrayOfEnumEnum
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Enum Upper for "UPPER"
|
||||
/// </summary>
|
||||
[EnumMember(Value = "UPPER")]
|
||||
Upper,
|
||||
|
||||
/// <summary>
|
||||
/// Enum Lower for "lower"
|
||||
/// </summary>
|
||||
[EnumMember(Value = "lower")]
|
||||
Lower
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayOfEnum
|
||||
/// </summary>
|
||||
[DataMember(Name="array_of_enum", EmitDefaultValue=false)]
|
||||
public List<ArrayOfEnumEnum> ArrayOfEnum { get; set; }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ArrayTest" /> class.
|
||||
/// </summary>
|
||||
/// <param name="ArrayOfString">ArrayOfString.</param>
|
||||
/// <param name="ArrayArrayOfInteger">ArrayArrayOfInteger.</param>
|
||||
/// <param name="ArrayArrayOfModel">ArrayArrayOfModel.</param>
|
||||
public ArrayTest(List<string> ArrayOfString = null, List<List<long?>> ArrayArrayOfInteger = null, List<List<ReadOnlyFirst>> ArrayArrayOfModel = null)
|
||||
/// <param name="ArrayOfEnum">ArrayOfEnum.</param>
|
||||
public ArrayTest(List<string> ArrayOfString = null, List<List<long?>> ArrayArrayOfInteger = null, List<List<ReadOnlyFirst>> ArrayArrayOfModel = null, List<ArrayOfEnumEnum> ArrayOfEnum = null)
|
||||
{
|
||||
this.ArrayOfString = ArrayOfString;
|
||||
this.ArrayArrayOfInteger = ArrayArrayOfInteger;
|
||||
this.ArrayArrayOfModel = ArrayArrayOfModel;
|
||||
this.ArrayOfEnum = ArrayOfEnum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -78,6 +106,7 @@ namespace IO.Swagger.Model
|
||||
sb.Append(" ArrayOfString: ").Append(ArrayOfString).Append("\n");
|
||||
sb.Append(" ArrayArrayOfInteger: ").Append(ArrayArrayOfInteger).Append("\n");
|
||||
sb.Append(" ArrayArrayOfModel: ").Append(ArrayArrayOfModel).Append("\n");
|
||||
sb.Append(" ArrayOfEnum: ").Append(ArrayOfEnum).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
@@ -128,6 +157,11 @@ namespace IO.Swagger.Model
|
||||
this.ArrayArrayOfModel == other.ArrayArrayOfModel ||
|
||||
this.ArrayArrayOfModel != null &&
|
||||
this.ArrayArrayOfModel.SequenceEqual(other.ArrayArrayOfModel)
|
||||
) &&
|
||||
(
|
||||
this.ArrayOfEnum == other.ArrayOfEnum ||
|
||||
this.ArrayOfEnum != null &&
|
||||
this.ArrayOfEnum.SequenceEqual(other.ArrayOfEnum)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -148,6 +182,8 @@ namespace IO.Swagger.Model
|
||||
hash = hash * 59 + this.ArrayArrayOfInteger.GetHashCode();
|
||||
if (this.ArrayArrayOfModel != null)
|
||||
hash = hash * 59 + this.ArrayArrayOfModel.GetHashCode();
|
||||
if (this.ArrayOfEnum != null)
|
||||
hash = hash * 59 + this.ArrayOfEnum.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// NumberOnly
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class NumberOnly : IEquatable<NumberOnly>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NumberOnly" /> class.
|
||||
/// </summary>
|
||||
/// <param name="JustNumber">JustNumber.</param>
|
||||
public NumberOnly(decimal? JustNumber = null)
|
||||
{
|
||||
this.JustNumber = JustNumber;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets JustNumber
|
||||
/// </summary>
|
||||
[DataMember(Name="JustNumber", EmitDefaultValue=false)]
|
||||
public decimal? JustNumber { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class NumberOnly {\n");
|
||||
sb.Append(" JustNumber: ").Append(JustNumber).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as NumberOnly);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if NumberOnly instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of NumberOnly to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(NumberOnly other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.JustNumber == other.JustNumber ||
|
||||
this.JustNumber != null &&
|
||||
this.JustNumber.Equals(other.JustNumber)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this.JustNumber != null)
|
||||
hash = hash * 59 + this.JustNumber.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace IO.Swagger.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// PropertyType
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class PropertyType : IEquatable<PropertyType>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PropertyType" /> class.
|
||||
/// </summary>
|
||||
/// <param name="Type">Type.</param>
|
||||
public PropertyType(decimal? Type = null)
|
||||
{
|
||||
this.Type = Type;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Type
|
||||
/// </summary>
|
||||
[DataMember(Name="type", EmitDefaultValue=false)]
|
||||
public decimal? Type { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class PropertyType {\n");
|
||||
sb.Append(" Type: ").Append(Type).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
return this.Equals(obj as PropertyType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if PropertyType instances are equal
|
||||
/// </summary>
|
||||
/// <param name="other">Instance of PropertyType to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(PropertyType other)
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/10454552/677735
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return
|
||||
(
|
||||
this.Type == other.Type ||
|
||||
this.Type != null &&
|
||||
this.Type.Equals(other.Type)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
// credit: http://stackoverflow.com/a/263416/677735
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hash = 41;
|
||||
// Suitable nullity checks etc, of course :)
|
||||
if (this.Type != null)
|
||||
hash = hash * 59 + this.Type.GetHashCode();
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user