forked from loafle/openapi-generator-original
* [csharp] update sample after #2528 * [csharp] update sample after #2528 * [csharp] update sample after #2528
This commit is contained in:
committed by
William Cheng
parent
8977d7b366
commit
976ab4fd0f
@@ -55,6 +55,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.ClassName = className;
|
||||
}
|
||||
|
||||
// use default value if no "color" provided
|
||||
if (color == null)
|
||||
{
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// AnimalFarm
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class AnimalFarm : List<Animal>, IEquatable<AnimalFarm>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AnimalFarm" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
public AnimalFarm() : base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <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 AnimalFarm {\n");
|
||||
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).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="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
{
|
||||
return this.Equals(input as AnimalFarm);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if AnimalFarm instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of AnimalFarm to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(AnimalFarm input)
|
||||
{
|
||||
if (input == null)
|
||||
return false;
|
||||
|
||||
return base.Equals(input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = base.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -51,6 +51,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
this.Id = id;
|
||||
}
|
||||
|
||||
|
||||
@@ -163,6 +163,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.EnumStringRequired = enumStringRequired;
|
||||
}
|
||||
|
||||
this.EnumString = enumString;
|
||||
this.EnumInteger = enumInteger;
|
||||
this.EnumNumber = enumNumber;
|
||||
|
||||
@@ -62,6 +62,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.Number = number;
|
||||
}
|
||||
|
||||
// to ensure "_byte" is required (not null)
|
||||
if (_byte == null)
|
||||
{
|
||||
@@ -71,6 +72,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.Byte = _byte;
|
||||
}
|
||||
|
||||
// to ensure "date" is required (not null)
|
||||
if (date == null)
|
||||
{
|
||||
@@ -80,6 +82,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.Date = date;
|
||||
}
|
||||
|
||||
// to ensure "password" is required (not null)
|
||||
if (password == null)
|
||||
{
|
||||
@@ -89,6 +92,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.Password = password;
|
||||
}
|
||||
|
||||
this.Integer = integer;
|
||||
this.Int32 = int32;
|
||||
this.Int64 = int64;
|
||||
|
||||
@@ -51,6 +51,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this._Name = name;
|
||||
}
|
||||
|
||||
this.Property = property;
|
||||
}
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
// to ensure "photoUrls" is required (not null)
|
||||
if (photoUrls == null)
|
||||
{
|
||||
@@ -97,6 +98,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.PhotoUrls = photoUrls;
|
||||
}
|
||||
|
||||
this.Id = id;
|
||||
this.Category = category;
|
||||
this.Tags = tags;
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.Serialization;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// StringBooleanMap
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public partial class StringBooleanMap : Dictionary<String, bool?>, IEquatable<StringBooleanMap>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="StringBooleanMap" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
public StringBooleanMap() : base()
|
||||
{
|
||||
}
|
||||
|
||||
/// <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 StringBooleanMap {\n");
|
||||
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).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="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
{
|
||||
return this.Equals(input as StringBooleanMap);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if StringBooleanMap instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of StringBooleanMap to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(StringBooleanMap input)
|
||||
{
|
||||
if (input == null)
|
||||
return false;
|
||||
|
||||
return base.Equals(input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = base.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -54,6 +54,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.StringItem = stringItem;
|
||||
}
|
||||
|
||||
// to ensure "numberItem" is required (not null)
|
||||
if (numberItem == null)
|
||||
{
|
||||
@@ -63,6 +64,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.NumberItem = numberItem;
|
||||
}
|
||||
|
||||
// to ensure "integerItem" is required (not null)
|
||||
if (integerItem == null)
|
||||
{
|
||||
@@ -72,6 +74,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.IntegerItem = integerItem;
|
||||
}
|
||||
|
||||
// to ensure "boolItem" is required (not null)
|
||||
if (boolItem == null)
|
||||
{
|
||||
@@ -81,6 +84,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.BoolItem = boolItem;
|
||||
}
|
||||
|
||||
// to ensure "arrayItem" is required (not null)
|
||||
if (arrayItem == null)
|
||||
{
|
||||
@@ -90,6 +94,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.ArrayItem = arrayItem;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -54,6 +54,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.StringItem = stringItem;
|
||||
}
|
||||
|
||||
// to ensure "numberItem" is required (not null)
|
||||
if (numberItem == null)
|
||||
{
|
||||
@@ -63,6 +64,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.NumberItem = numberItem;
|
||||
}
|
||||
|
||||
// to ensure "integerItem" is required (not null)
|
||||
if (integerItem == null)
|
||||
{
|
||||
@@ -72,6 +74,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.IntegerItem = integerItem;
|
||||
}
|
||||
|
||||
// to ensure "boolItem" is required (not null)
|
||||
if (boolItem == null)
|
||||
{
|
||||
@@ -81,6 +84,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.BoolItem = boolItem;
|
||||
}
|
||||
|
||||
// to ensure "arrayItem" is required (not null)
|
||||
if (arrayItem == null)
|
||||
{
|
||||
@@ -90,6 +94,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this.ArrayItem = arrayItem;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user