diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 3d667cd1741..db000e9c63e 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -1301,7 +1301,8 @@ public class DefaultCodegen { } } - if (p instanceof BaseIntegerProperty) { + // type is integer and without format + if (p instanceof BaseIntegerProperty && !(p instanceof IntegerProperty) && !(p instanceof LongProperty)) { BaseIntegerProperty sp = (BaseIntegerProperty) p; property.isInteger = true; /*if (sp.getEnum() != null) { @@ -1367,7 +1368,8 @@ public class DefaultCodegen { property.isByteArray = true; } - if (p instanceof DecimalProperty) { + // type is number and without format + if (p instanceof DecimalProperty && !(p instanceof DoubleProperty) && !(p instanceof FloatProperty)) { DecimalProperty sp = (DecimalProperty) p; property.isFloat = true; /*if (sp.getEnum() != null) { diff --git a/modules/swagger-codegen/src/main/resources/csharp/enumClass.mustache b/modules/swagger-codegen/src/main/resources/csharp/enumClass.mustache index 2c853cea25c..5249d754577 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/enumClass.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/enumClass.mustache @@ -9,7 +9,7 @@ /// /// Enum {{name}} for {{{value}}} /// - [EnumMember(Value = {{{value}}})] - {{name}}{{^-last}}, - {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}{{/allowableValues}} + [EnumMember(Value = {{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isFloat}}"{{/isFloat}}{{#isDouble}}"{{/isDouble}}{{{value}}}{{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isFloat}}"{{/isFloat}})] + {{name}}{{#isLong}} = {{{value}}}{{/isLong}}{{#isInteger}} = {{{value}}}{{/isInteger}}{{^-last}}, + {{/-last}}{{/enumVars}}{{/allowableValues}} } diff --git a/modules/swagger-codegen/src/main/resources/csharp/model.mustache b/modules/swagger-codegen/src/main/resources/csharp/model.mustache index 6d087895847..6c6ae8fdbb6 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/model.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/model.mustache @@ -13,145 +13,7 @@ using Newtonsoft.Json.Converters; {{#model}} namespace {{packageName}}.Model { - /// - /// {{description}} - /// - [DataContract] - public partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}> - { {{#vars}}{{#isEnum}} - - /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} - /// {{#description}} - /// {{{description}}}{{/description}} - [JsonConverter(typeof(StringEnumConverter))] -{{>enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}} -{{>enumClass}}{{/items}}{{/items.isEnum}}{{/vars}} - {{#vars}}{{#isEnum}} - /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} - /// {{#description}} - /// {{{description}}}{{/description}} - [DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})] - public {{{datatypeWithEnum}}} {{name}} { get; set; } - {{/isEnum}}{{/vars}} - /// - /// Initializes a new instance of the class. - /// Initializes a new instance of the class. - /// -{{#vars}}{{^isReadOnly}} /// {{#description}}{{description}}{{/description}}{{^description}}{{name}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}. -{{/isReadOnly}}{{/vars}} - public {{classname}}({{#vars}}{{^isReadOnly}}{{{datatypeWithEnum}}} {{name}} = null{{/isReadOnly}}{{#hasMoreNonReadOnly}}, {{/hasMoreNonReadOnly}}{{/vars}}) - { - {{#vars}}{{^isReadOnly}}{{#required}}// to ensure "{{name}}" is required (not null) - if ({{name}} == null) - { - throw new InvalidDataException("{{name}} is a required property for {{classname}} and cannot be null"); - } - else - { - this.{{name}} = {{name}}; - } - {{/required}}{{/isReadOnly}}{{/vars}}{{#vars}}{{^isReadOnly}}{{^required}}{{#defaultValue}}// use default value if no "{{name}}" provided - if ({{name}} == null) - { - this.{{name}} = {{{defaultValue}}}; - } - else - { - this.{{name}} = {{name}}; - } - {{/defaultValue}}{{^defaultValue}}this.{{name}} = {{name}}; - {{/defaultValue}}{{/required}}{{/isReadOnly}}{{/vars}} - } - - {{#vars}}{{^isEnum}} - /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} - /// {{#description}} - /// {{description}}{{/description}} - [DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})] - public {{{datatype}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } - {{/isEnum}}{{/vars}} - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class {{classname}} {\n"); -{{#vars}} - sb.Append(" {{name}}: ").Append({{name}}).Append("\n"); -{{/vars}} - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public {{#parent}} new {{/parent}}string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - // credit: http://stackoverflow.com/a/10454552/677735 - return this.Equals(obj as {{classname}}); - } - - /// - /// Returns true if {{classname}} instances are equal - /// - /// Instance of {{classname}} to be compared - /// Boolean - public bool Equals({{classname}} other) - { - // credit: http://stackoverflow.com/a/10454552/677735 - if (other == null) - return false; - - return {{#vars}}{{#isNotContainer}} - ( - this.{{name}} == other.{{name}} || - this.{{name}} != null && - this.{{name}}.Equals(other.{{name}}) - ){{#hasMore}} && {{/hasMore}}{{/isNotContainer}}{{^isNotContainer}} - ( - this.{{name}} == other.{{name}} || - this.{{name}} != null && - this.{{name}}.SequenceEqual(other.{{name}}) - ){{#hasMore}} && {{/hasMore}}{{/isNotContainer}}{{/vars}}{{^vars}}false{{/vars}}; - } - - /// - /// Gets the hash code - /// - /// Hash code - 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 :) - {{#vars}} - if (this.{{name}} != null) - hash = hash * 59 + this.{{name}}.GetHashCode(); - {{/vars}} - return hash; - } - } - - } +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{>modelGeneric}}{{/isEnum}} {{/model}} {{/models}} } diff --git a/modules/swagger-codegen/src/main/resources/csharp/modelGeneric.mustache b/modules/swagger-codegen/src/main/resources/csharp/modelGeneric.mustache index 8affc932a46..6c5da5e4f56 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/modelGeneric.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/modelGeneric.mustache @@ -3,23 +3,35 @@ /// [DataContract] public partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}> - { {{#vars}}{{#isEnum}} -{{>modelInnerEnum}}{{/isEnum}}{{#items.isEnum}}{{#items}} -{{>modelInnerEnum}}{{/items}}{{/items.isEnum}}{{/vars}} - {{#vars}}{{#isEnum}} + { + {{#vars}} + {{#isEnum}} +{{>modelInnerEnum}} + {{/isEnum}} + {{#items.isEnum}} + {{#items}} +{{>modelInnerEnum}} + {{/items}} + {{/items.isEnum}} + {{/vars}} + {{#vars}} + {{#isEnum}} /// /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} /// {{#description}} /// {{{description}}}{{/description}} [DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})] public {{{datatypeWithEnum}}}{{#isEnum}}?{{/isEnum}} {{name}} { get; set; } - {{/isEnum}}{{/vars}} + {{/isEnum}} + {{/vars}} /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// -{{#vars}}{{^isReadOnly}} /// {{#description}}{{description}}{{/description}}{{^description}}{{name}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}. -{{/isReadOnly}}{{/vars}} + {{#vars}} + {{^isReadOnly}} + /// {{#description}}{{description}}{{/description}}{{^description}}{{name}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}. + {{/isReadOnly}} + {{/vars}} public {{classname}}({{#vars}}{{^isReadOnly}}{{{datatypeWithEnum}}}{{#isEnum}}?{{/isEnum}} {{name}} = null{{#hasMore}}, {{/hasMore}}{{/isReadOnly}}{{/vars}}) { {{#vars}}{{^isReadOnly}}{{#required}}// to ensure "{{name}}" is required (not null) @@ -31,7 +43,9 @@ { this.{{name}} = {{name}}; } - {{/required}}{{/isReadOnly}}{{/vars}}{{#vars}}{{^isReadOnly}}{{^required}}{{#defaultValue}}// use default value if no "{{name}}" provided + {{/required}}{{/isReadOnly}}{{/vars}} + {{#vars}}{{^isReadOnly}}{{^required}} + {{#defaultValue}}// use default value if no "{{name}}" provided if ({{name}} == null) { this.{{name}} = {{{defaultValue}}}; @@ -40,18 +54,23 @@ { this.{{name}} = {{name}}; } - {{/defaultValue}}{{^defaultValue}}this.{{name}} = {{name}}; - {{/defaultValue}}{{/required}}{{/isReadOnly}}{{/vars}} + {{/defaultValue}} + {{^defaultValue}} + this.{{name}} = {{name}}; + {{/defaultValue}} + {{/required}}{{/isReadOnly}}{{/vars}} } - {{#vars}}{{^isEnum}} + {{#vars}} + {{^isEnum}} /// /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} /// {{#description}} /// {{description}}{{/description}} [DataMember(Name="{{baseName}}", EmitDefaultValue={{emitDefaultValue}})] public {{{datatype}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; } - {{/isEnum}}{{/vars}} + {{/isEnum}} + {{/vars}} /// /// Returns the string presentation of the object /// diff --git a/modules/swagger-codegen/src/main/resources/csharp/modelInnerEnum.mustache b/modules/swagger-codegen/src/main/resources/csharp/modelInnerEnum.mustache index 4715fd071a4..5249d754577 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/modelInnerEnum.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/modelInnerEnum.mustache @@ -9,7 +9,7 @@ /// /// Enum {{name}} for {{{value}}} /// - [EnumMember(Value = {{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}})] - {{name}}{{#isInteger}} = {{{value}}}{{/isInteger}}{{^-last}}, + [EnumMember(Value = {{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isFloat}}"{{/isFloat}}{{#isDouble}}"{{/isDouble}}{{{value}}}{{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isFloat}}"{{/isFloat}})] + {{name}}{{#isLong}} = {{{value}}}{{/isLong}}{{#isInteger}} = {{{value}}}{{/isInteger}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} } diff --git a/modules/swagger-codegen/src/main/resources/php/model.mustache b/modules/swagger-codegen/src/main/resources/php/model.mustache index 7cf71a77aa7..2a7894ab860 100644 --- a/modules/swagger-codegen/src/main/resources/php/model.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model.mustache @@ -106,7 +106,7 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA return {{#parent}}parent::getters() + {{/parent}}self::$getters; } - {{#vars}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}const {{datatypeWithEnum}}_{{{name}}} = "{{{value}}}"; + {{#vars}}{{#isEnum}}{{#allowableValues}}{{#enumVars}}const {{datatypeWithEnum}}_{{{name}}} = {{{value}}}; {{/enumVars}}{{/allowableValues}}{{/isEnum}}{{/vars}} {{#vars}}{{#isEnum}} diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index 4160e59cc48..cf95a2612e2 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -899,6 +899,33 @@ definitions: format: password maxLength: 64 minLength: 10 + EnumClass: + type: string + default: '-efg' + enum: + - _abc + - '-efg' + - (xyz) + Enum_Test: + type: object + properties: + enum_string: + type: string + enum: + - UPPER + - lower + enum_integer: + type: integer + format: int32 + enum: + - 1 + - -1 + enum_number: + type: number + format: double + enum: + - 1.1 + - -1.2 externalDocs: description: Find out more about Swagger url: 'http://swagger.io' diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/README.md b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/README.md index e5c57a92595..aceb18e3396 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/README.md +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/README.md @@ -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-05-02T22:02:29.555+08:00 +- Build date: 2016-04-27T22:04:12.906+08:00 - Build package: class io.swagger.codegen.languages.CSharpClientCodegen ## Frameworks supported @@ -54,7 +54,7 @@ namespace Example { var apiInstance = new FakeApi(); - var number = 3.4; // double? | None + var number = number_example; // string | None var _double = 1.2; // double? | None var _string = _string_example; // string | None var _byte = B; // byte[] | None @@ -117,6 +117,8 @@ Class | Method | HTTP request | Description - [IO.Swagger.Model.Cat](docs/Cat.md) - [IO.Swagger.Model.Category](docs/Category.md) - [IO.Swagger.Model.Dog](docs/Dog.md) + - [IO.Swagger.Model.EnumClass](docs/EnumClass.md) + - [IO.Swagger.Model.EnumTest](docs/EnumTest.md) - [IO.Swagger.Model.FormatTest](docs/FormatTest.md) - [IO.Swagger.Model.Model200Response](docs/Model200Response.md) - [IO.Swagger.Model.ModelReturn](docs/ModelReturn.md) diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/docs/FormatTest.md b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/docs/FormatTest.md index 7ddfad04d05..c5dc3cf53f3 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/docs/FormatTest.md +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/docs/FormatTest.md @@ -14,7 +14,6 @@ Name | Type | Description | Notes **Binary** | **byte[]** | | [optional] **Date** | **DateTime?** | | **DateTime** | **DateTime?** | | [optional] -**Uuid** | **Guid?** | | [optional] **Password** | **string** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Animal.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Animal.cs index 11d93aabd20..f5b9a3efee0 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Animal.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Animal.cs @@ -5,7 +5,6 @@ using System.Text; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.ComponentModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -17,14 +16,11 @@ namespace IO.Swagger.Model /// [DataContract] public partial class Animal : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// ClassName (required). - public Animal(string ClassName = null) { // to ensure "ClassName" is required (not null) @@ -37,15 +33,14 @@ namespace IO.Swagger.Model this.ClassName = ClassName; } + } - - + /// /// Gets or Sets ClassName /// [DataMember(Name="className", EmitDefaultValue=false)] public string ClassName { get; set; } - /// /// Returns the string presentation of the object /// @@ -58,7 +53,7 @@ namespace IO.Swagger.Model sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ApiResponse.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ApiResponse.cs index de8b24e69e9..8a0f40369fb 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ApiResponse.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ApiResponse.cs @@ -12,47 +12,44 @@ using Newtonsoft.Json.Converters; namespace IO.Swagger.Model { /// - /// + /// ApiResponse /// [DataContract] public partial class ApiResponse : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// Code. /// Type. /// Message. - public ApiResponse(int? Code = null, string Type = null, string Message = null) { - this.Code = Code; - this.Type = Type; - this.Message = Message; + + + this.Code = Code; + + this.Type = Type; + + this.Message = Message; } - - + /// /// Gets or Sets Code /// [DataMember(Name="code", EmitDefaultValue=false)] public int? Code { get; set; } - /// /// Gets or Sets Type /// [DataMember(Name="type", EmitDefaultValue=false)] public string Type { get; set; } - /// /// Gets or Sets Message /// [DataMember(Name="message", EmitDefaultValue=false)] public string Message { get; set; } - /// /// Returns the string presentation of the object /// @@ -62,12 +59,12 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class ApiResponse {\n"); sb.Append(" Code: ").Append(Code).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" Message: ").Append(Message).Append("\n"); +sb.Append(" Type: ").Append(Type).Append("\n"); +sb.Append(" Message: ").Append(Message).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -137,6 +134,6 @@ namespace IO.Swagger.Model return hash; } } - } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Cat.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Cat.cs index 235889c9864..74bd81aee05 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Cat.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Cat.cs @@ -5,7 +5,6 @@ using System.Text; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.ComponentModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -17,15 +16,12 @@ namespace IO.Swagger.Model /// [DataContract] public partial class Cat : Animal, IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// ClassName (required). /// Declawed. - public Cat(string ClassName = null, bool? Declawed = null) { // to ensure "ClassName" is required (not null) @@ -37,23 +33,22 @@ namespace IO.Swagger.Model { this.ClassName = ClassName; } - this.Declawed = Declawed; + + + this.Declawed = Declawed; } - - + /// /// Gets or Sets ClassName /// [DataMember(Name="className", EmitDefaultValue=false)] public string ClassName { get; set; } - /// /// Gets or Sets Declawed /// [DataMember(Name="declawed", EmitDefaultValue=false)] public bool? Declawed { get; set; } - /// /// Returns the string presentation of the object /// @@ -63,11 +58,11 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class Cat {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); - sb.Append(" Declawed: ").Append(Declawed).Append("\n"); +sb.Append(" Declawed: ").Append(Declawed).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Category.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Category.cs index 223bec6d0ab..51a3f971b38 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Category.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Category.cs @@ -5,7 +5,6 @@ using System.Text; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.ComponentModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -17,35 +16,32 @@ namespace IO.Swagger.Model /// [DataContract] public partial class Category : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// Id. /// Name. - public Category(long? Id = null, string Name = null) { - this.Id = Id; - this.Name = Name; + + + this.Id = Id; + + this.Name = Name; } - - + /// /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] public long? Id { get; set; } - /// /// Gets or Sets Name /// [DataMember(Name="name", EmitDefaultValue=false)] public string Name { get; set; } - /// /// Returns the string presentation of the object /// @@ -55,11 +51,11 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class Category {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); +sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Dog.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Dog.cs index 7fefac6e26d..6ab8c9ad69f 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Dog.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Dog.cs @@ -5,7 +5,6 @@ using System.Text; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.ComponentModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -17,15 +16,12 @@ namespace IO.Swagger.Model /// [DataContract] public partial class Dog : Animal, IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// ClassName (required). /// Breed. - public Dog(string ClassName = null, string Breed = null) { // to ensure "ClassName" is required (not null) @@ -37,23 +33,22 @@ namespace IO.Swagger.Model { this.ClassName = ClassName; } - this.Breed = Breed; + + + this.Breed = Breed; } - - + /// /// Gets or Sets ClassName /// [DataMember(Name="className", EmitDefaultValue=false)] public string ClassName { get; set; } - /// /// Gets or Sets Breed /// [DataMember(Name="breed", EmitDefaultValue=false)] public string Breed { get; set; } - /// /// Returns the string presentation of the object /// @@ -63,11 +58,11 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class Dog {\n"); sb.Append(" ClassName: ").Append(ClassName).Append("\n"); - sb.Append(" Breed: ").Append(Breed).Append("\n"); +sb.Append(" Breed: ").Append(Breed).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/EnumClass.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/EnumClass.cs index be3b7a17c5f..1fb5f0b6626 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/EnumClass.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/EnumClass.cs @@ -5,7 +5,6 @@ using System.Text; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.ComponentModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/EnumTest.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/EnumTest.cs index a1fe812415d..f8bebd6b2d7 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/EnumTest.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/EnumTest.cs @@ -5,7 +5,6 @@ using System.Text; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.ComponentModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -17,7 +16,7 @@ namespace IO.Swagger.Model /// [DataContract] public partial class EnumTest : IEquatable - { + { /// /// Gets or Sets EnumString /// @@ -78,42 +77,39 @@ namespace IO.Swagger.Model NUMBER_MINUS_1_DOT_2 } - /// /// Gets or Sets EnumString /// [DataMember(Name="enum_string", EmitDefaultValue=false)] public EnumStringEnum? EnumString { get; set; } - /// /// Gets or Sets EnumInteger /// [DataMember(Name="enum_integer", EmitDefaultValue=false)] public EnumIntegerEnum? EnumInteger { get; set; } - /// /// Gets or Sets EnumNumber /// [DataMember(Name="enum_number", EmitDefaultValue=false)] public EnumNumberEnum? EnumNumber { get; set; } - /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// EnumString. /// EnumInteger. /// EnumNumber. - public EnumTest(EnumStringEnum? EnumString = null, EnumIntegerEnum? EnumInteger = null, EnumNumberEnum? EnumNumber = null) { - this.EnumString = EnumString; - this.EnumInteger = EnumInteger; - this.EnumNumber = EnumNumber; + + + this.EnumString = EnumString; + + this.EnumInteger = EnumInteger; + + this.EnumNumber = EnumNumber; } - /// /// Returns the string presentation of the object /// @@ -123,9 +119,8 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class EnumTest {\n"); sb.Append(" EnumString: ").Append(EnumString).Append("\n"); - sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); - sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); - +sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n"); +sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -190,16 +185,12 @@ namespace IO.Swagger.Model { int hash = 41; // Suitable nullity checks etc, of course :) - if (this.EnumString != null) hash = hash * 59 + this.EnumString.GetHashCode(); - if (this.EnumInteger != null) hash = hash * 59 + this.EnumInteger.GetHashCode(); - if (this.EnumNumber != null) hash = hash * 59 + this.EnumNumber.GetHashCode(); - return hash; } } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/FormatTest.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/FormatTest.cs index 49e7d1041aa..c5a99d45af0 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/FormatTest.cs @@ -12,15 +12,13 @@ using Newtonsoft.Json.Converters; namespace IO.Swagger.Model { /// - /// + /// FormatTest /// [DataContract] public partial class FormatTest : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// Integer. /// Int32. @@ -33,10 +31,8 @@ namespace IO.Swagger.Model /// Binary. /// Date (required). /// DateTime. - /// Uuid. /// Password (required). - - public FormatTest(int? Integer = null, int? Int32 = null, long? Int64 = null, double? Number = null, float? _Float = null, double? _Double = null, string _String = null, byte[] _Byte = null, byte[] Binary = null, DateTime? Date = null, DateTime? DateTime = null, Guid? Uuid = null, string Password = null) + public FormatTest(int? Integer = null, int? Int32 = null, long? Int64 = null, double? Number = null, float? _Float = null, double? _Double = null, string _String = null, byte[] _Byte = null, byte[] Binary = null, DateTime? Date = null, DateTime? DateTime = null, string Password = null) { // to ensure "Number" is required (not null) if (Number == null) @@ -74,97 +70,86 @@ namespace IO.Swagger.Model { this.Password = Password; } - this.Integer = Integer; - this.Int32 = Int32; - this.Int64 = Int64; - this._Float = _Float; - this._Double = _Double; - this._String = _String; - this.Binary = Binary; - this.DateTime = DateTime; - this.Uuid = Uuid; + + + this.Integer = Integer; + + this.Int32 = Int32; + + this.Int64 = Int64; + + this._Float = _Float; + + this._Double = _Double; + + this._String = _String; + + this.Binary = Binary; + + this.DateTime = DateTime; } - - + /// /// Gets or Sets Integer /// [DataMember(Name="integer", EmitDefaultValue=false)] public int? Integer { get; set; } - /// /// Gets or Sets Int32 /// [DataMember(Name="int32", EmitDefaultValue=false)] public int? Int32 { get; set; } - /// /// Gets or Sets Int64 /// [DataMember(Name="int64", EmitDefaultValue=false)] public long? Int64 { get; set; } - /// /// Gets or Sets Number /// [DataMember(Name="number", EmitDefaultValue=false)] public double? Number { get; set; } - /// /// Gets or Sets _Float /// [DataMember(Name="float", EmitDefaultValue=false)] public float? _Float { get; set; } - /// /// Gets or Sets _Double /// [DataMember(Name="double", EmitDefaultValue=false)] public double? _Double { get; set; } - /// /// Gets or Sets _String /// [DataMember(Name="string", EmitDefaultValue=false)] public string _String { get; set; } - /// /// Gets or Sets _Byte /// [DataMember(Name="byte", EmitDefaultValue=false)] public byte[] _Byte { get; set; } - /// /// Gets or Sets Binary /// [DataMember(Name="binary", EmitDefaultValue=false)] public byte[] Binary { get; set; } - /// /// Gets or Sets Date /// [DataMember(Name="date", EmitDefaultValue=false)] public DateTime? Date { get; set; } - /// /// Gets or Sets DateTime /// [DataMember(Name="dateTime", EmitDefaultValue=false)] public DateTime? DateTime { get; set; } - - /// - /// Gets or Sets Uuid - /// - [DataMember(Name="uuid", EmitDefaultValue=false)] - public Guid? Uuid { get; set; } - /// /// Gets or Sets Password /// [DataMember(Name="password", EmitDefaultValue=false)] public string Password { get; set; } - /// /// Returns the string presentation of the object /// @@ -174,22 +159,21 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); - sb.Append(" Int32: ").Append(Int32).Append("\n"); - sb.Append(" Int64: ").Append(Int64).Append("\n"); - sb.Append(" Number: ").Append(Number).Append("\n"); - sb.Append(" _Float: ").Append(_Float).Append("\n"); - sb.Append(" _Double: ").Append(_Double).Append("\n"); - sb.Append(" _String: ").Append(_String).Append("\n"); - sb.Append(" _Byte: ").Append(_Byte).Append("\n"); - sb.Append(" Binary: ").Append(Binary).Append("\n"); - sb.Append(" Date: ").Append(Date).Append("\n"); - sb.Append(" DateTime: ").Append(DateTime).Append("\n"); - sb.Append(" Uuid: ").Append(Uuid).Append("\n"); - sb.Append(" Password: ").Append(Password).Append("\n"); +sb.Append(" Int32: ").Append(Int32).Append("\n"); +sb.Append(" Int64: ").Append(Int64).Append("\n"); +sb.Append(" Number: ").Append(Number).Append("\n"); +sb.Append(" _Float: ").Append(_Float).Append("\n"); +sb.Append(" _Double: ").Append(_Double).Append("\n"); +sb.Append(" _String: ").Append(_String).Append("\n"); +sb.Append(" _Byte: ").Append(_Byte).Append("\n"); +sb.Append(" Binary: ").Append(Binary).Append("\n"); +sb.Append(" Date: ").Append(Date).Append("\n"); +sb.Append(" DateTime: ").Append(DateTime).Append("\n"); +sb.Append(" Password: ").Append(Password).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// @@ -277,11 +261,6 @@ namespace IO.Swagger.Model this.DateTime != null && this.DateTime.Equals(other.DateTime) ) && - ( - this.Uuid == other.Uuid || - this.Uuid != null && - this.Uuid.Equals(other.Uuid) - ) && ( this.Password == other.Password || this.Password != null && @@ -322,13 +301,11 @@ namespace IO.Swagger.Model hash = hash * 59 + this.Date.GetHashCode(); if (this.DateTime != null) hash = hash * 59 + this.DateTime.GetHashCode(); - if (this.Uuid != null) - hash = hash * 59 + this.Uuid.GetHashCode(); if (this.Password != null) hash = hash * 59 + this.Password.GetHashCode(); return hash; } } - } + } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Model200Response.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Model200Response.cs index 52a19ff2f22..cec5ee75e2f 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Model200Response.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Model200Response.cs @@ -5,7 +5,6 @@ using System.Text; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.ComponentModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -13,31 +12,28 @@ using Newtonsoft.Json.Converters; namespace IO.Swagger.Model { /// - /// Model200Response + /// Model for testing model name starting with number /// [DataContract] public partial class Model200Response : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// Name. - public Model200Response(int? Name = null) { - this.Name = Name; + + + this.Name = Name; } - /// /// Gets or Sets Name /// [DataMember(Name="name", EmitDefaultValue=false)] public int? Name { get; set; } - /// /// Returns the string presentation of the object /// @@ -47,7 +43,6 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class Model200Response {\n"); sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append("}\n"); return sb.ToString(); } @@ -102,10 +97,8 @@ namespace IO.Swagger.Model { int hash = 41; // Suitable nullity checks etc, of course :) - if (this.Name != null) hash = hash * 59 + this.Name.GetHashCode(); - return hash; } } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ModelReturn.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ModelReturn.cs index 3b74f1ba729..3cfa6c0a77e 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ModelReturn.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/ModelReturn.cs @@ -5,7 +5,6 @@ using System.Text; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.ComponentModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -13,31 +12,28 @@ using Newtonsoft.Json.Converters; namespace IO.Swagger.Model { /// - /// ModelReturn + /// Model for testing reserved words /// [DataContract] public partial class ModelReturn : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// _Return. - public ModelReturn(int? _Return = null) { - this._Return = _Return; + + + this._Return = _Return; } - /// /// Gets or Sets _Return /// [DataMember(Name="return", EmitDefaultValue=false)] public int? _Return { get; set; } - /// /// Returns the string presentation of the object /// @@ -47,7 +43,6 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class ModelReturn {\n"); sb.Append(" _Return: ").Append(_Return).Append("\n"); - sb.Append("}\n"); return sb.ToString(); } @@ -102,10 +97,8 @@ namespace IO.Swagger.Model { int hash = 41; // Suitable nullity checks etc, of course :) - if (this._Return != null) hash = hash * 59 + this._Return.GetHashCode(); - return hash; } } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Name.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Name.cs index 01592253e24..b0e819fec20 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Name.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Name.cs @@ -5,7 +5,6 @@ using System.Text; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.ComponentModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -13,39 +12,48 @@ using Newtonsoft.Json.Converters; namespace IO.Swagger.Model { /// - /// Name + /// Model for testing model name same as property name /// [DataContract] public partial class Name : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// - /// _Name. - /// SnakeCase. - - public Name(int? _Name = null, int? SnakeCase = null) + /// _Name (required). + /// Property. + public Name(int? _Name = null, string Property = null) { - this._Name = _Name; - this.SnakeCase = SnakeCase; + // to ensure "_Name" is required (not null) + if (_Name == null) + { + throw new InvalidDataException("_Name is a required property for Name and cannot be null"); + } + else + { + this._Name = _Name; + } + + + this.Property = Property; } - /// /// Gets or Sets _Name /// [DataMember(Name="name", EmitDefaultValue=false)] public int? _Name { get; set; } - /// /// Gets or Sets SnakeCase /// [DataMember(Name="snake_case", EmitDefaultValue=false)] - public int? SnakeCase { get; set; } - + public int? SnakeCase { get; private set; } + /// + /// Gets or Sets Property + /// + [DataMember(Name="property", EmitDefaultValue=false)] + public string Property { get; set; } /// /// Returns the string presentation of the object /// @@ -55,8 +63,8 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class Name {\n"); sb.Append(" _Name: ").Append(_Name).Append("\n"); - sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); - +sb.Append(" SnakeCase: ").Append(SnakeCase).Append("\n"); +sb.Append(" Property: ").Append(Property).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -102,6 +110,11 @@ namespace IO.Swagger.Model this.SnakeCase == other.SnakeCase || this.SnakeCase != null && this.SnakeCase.Equals(other.SnakeCase) + ) && + ( + this.Property == other.Property || + this.Property != null && + this.Property.Equals(other.Property) ); } @@ -116,13 +129,12 @@ namespace IO.Swagger.Model { int hash = 41; // Suitable nullity checks etc, of course :) - if (this._Name != null) hash = hash * 59 + this._Name.GetHashCode(); - if (this.SnakeCase != null) hash = hash * 59 + this.SnakeCase.GetHashCode(); - + if (this.Property != null) + hash = hash * 59 + this.Property.GetHashCode(); return hash; } } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs index 5561095be76..652128a33a1 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Order.cs @@ -5,7 +5,6 @@ using System.Text; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.ComponentModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -17,7 +16,7 @@ namespace IO.Swagger.Model /// [DataContract] public partial class Order : IEquatable - { + { /// /// Order Status /// @@ -45,73 +44,72 @@ namespace IO.Swagger.Model Delivered } - /// /// Order Status /// /// Order Status [DataMember(Name="status", EmitDefaultValue=false)] public StatusEnum? Status { get; set; } - /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// + /// Id. /// PetId. /// Quantity. /// ShipDate. - /// Order Status (default to StatusEnum.Placed). - /// Complete. - - public Order(long? PetId = null, int? Quantity = null, DateTime? ShipDate = null, StatusEnum? Status = null, bool? Complete = null) + /// Order Status. + /// Complete (default to false). + public Order(long? Id = null, long? PetId = null, int? Quantity = null, DateTime? ShipDate = null, StatusEnum? Status = null, bool? Complete = null) { - this.PetId = PetId; - this.Quantity = Quantity; - this.ShipDate = ShipDate; - // use default value if no "Status" provided - if (Status == null) + + + this.Id = Id; + + this.PetId = PetId; + + this.Quantity = Quantity; + + this.ShipDate = ShipDate; + + this.Status = Status; + + // use default value if no "Complete" provided + if (Complete == null) { - this.Status = StatusEnum.Placed; + this.Complete = false; } else { - this.Status = Status; + this.Complete = Complete; } - this.Complete = Complete; } - /// /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] - public long? Id { get; private set; } - + public long? Id { get; set; } /// /// Gets or Sets PetId /// [DataMember(Name="petId", EmitDefaultValue=false)] public long? PetId { get; set; } - /// /// Gets or Sets Quantity /// [DataMember(Name="quantity", EmitDefaultValue=false)] public int? Quantity { get; set; } - /// /// Gets or Sets ShipDate /// [DataMember(Name="shipDate", EmitDefaultValue=false)] public DateTime? ShipDate { get; set; } - /// /// Gets or Sets Complete /// [DataMember(Name="complete", EmitDefaultValue=false)] public bool? Complete { get; set; } - /// /// Returns the string presentation of the object /// @@ -121,12 +119,11 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class Order {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" PetId: ").Append(PetId).Append("\n"); - sb.Append(" Quantity: ").Append(Quantity).Append("\n"); - sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append(" Complete: ").Append(Complete).Append("\n"); - +sb.Append(" PetId: ").Append(PetId).Append("\n"); +sb.Append(" Quantity: ").Append(Quantity).Append("\n"); +sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); +sb.Append(" Status: ").Append(Status).Append("\n"); +sb.Append(" Complete: ").Append(Complete).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -206,25 +203,18 @@ namespace IO.Swagger.Model { int hash = 41; // Suitable nullity checks etc, of course :) - if (this.Id != null) hash = hash * 59 + this.Id.GetHashCode(); - if (this.PetId != null) hash = hash * 59 + this.PetId.GetHashCode(); - if (this.Quantity != null) hash = hash * 59 + this.Quantity.GetHashCode(); - if (this.ShipDate != null) hash = hash * 59 + this.ShipDate.GetHashCode(); - if (this.Status != null) hash = hash * 59 + this.Status.GetHashCode(); - if (this.Complete != null) hash = hash * 59 + this.Complete.GetHashCode(); - return hash; } } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Pet.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Pet.cs index db790ad8ab1..420ab138b07 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Pet.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Pet.cs @@ -5,7 +5,6 @@ using System.Text; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.ComponentModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -17,7 +16,7 @@ namespace IO.Swagger.Model /// [DataContract] public partial class Pet : IEquatable - { + { /// /// pet status in the store /// @@ -45,17 +44,14 @@ namespace IO.Swagger.Model Sold } - /// /// pet status in the store /// /// pet status in the store [DataMember(Name="status", EmitDefaultValue=false)] public StatusEnum? Status { get; set; } - /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// Id. /// Category. @@ -63,7 +59,6 @@ namespace IO.Swagger.Model /// PhotoUrls (required). /// Tags. /// pet status in the store. - public Pet(long? Id = null, Category Category = null, string Name = null, List PhotoUrls = null, List Tags = null, StatusEnum? Status = null) { // to ensure "Name" is required (not null) @@ -84,44 +79,43 @@ namespace IO.Swagger.Model { this.PhotoUrls = PhotoUrls; } - this.Id = Id; - this.Category = Category; - this.Tags = Tags; - this.Status = Status; + + + this.Id = Id; + + this.Category = Category; + + this.Tags = Tags; + + this.Status = Status; } - /// /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] public long? Id { get; set; } - /// /// Gets or Sets Category /// [DataMember(Name="category", EmitDefaultValue=false)] public Category Category { get; set; } - /// /// Gets or Sets Name /// [DataMember(Name="name", EmitDefaultValue=false)] public string Name { get; set; } - /// /// Gets or Sets PhotoUrls /// [DataMember(Name="photoUrls", EmitDefaultValue=false)] public List PhotoUrls { get; set; } - /// /// Gets or Sets Tags /// [DataMember(Name="tags", EmitDefaultValue=false)] public List Tags { get; set; } - /// /// Returns the string presentation of the object /// @@ -131,12 +125,11 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class Pet {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Category: ").Append(Category).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); - sb.Append(" Tags: ").Append(Tags).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - +sb.Append(" Category: ").Append(Category).Append("\n"); +sb.Append(" Name: ").Append(Name).Append("\n"); +sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); +sb.Append(" Tags: ").Append(Tags).Append("\n"); +sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -216,25 +209,18 @@ namespace IO.Swagger.Model { int hash = 41; // Suitable nullity checks etc, of course :) - if (this.Id != null) hash = hash * 59 + this.Id.GetHashCode(); - if (this.Category != null) hash = hash * 59 + this.Category.GetHashCode(); - if (this.Name != null) hash = hash * 59 + this.Name.GetHashCode(); - if (this.PhotoUrls != null) hash = hash * 59 + this.PhotoUrls.GetHashCode(); - if (this.Tags != null) hash = hash * 59 + this.Tags.GetHashCode(); - if (this.Status != null) hash = hash * 59 + this.Status.GetHashCode(); - return hash; } } diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/SpecialModelName.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/SpecialModelName.cs index 17451359d82..68a92724b1f 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/SpecialModelName.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/SpecialModelName.cs @@ -5,7 +5,6 @@ using System.Text; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.ComponentModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -17,27 +16,24 @@ namespace IO.Swagger.Model /// [DataContract] public partial class SpecialModelName : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// SpecialPropertyName. - public SpecialModelName(long? SpecialPropertyName = null) { - this.SpecialPropertyName = SpecialPropertyName; + + + this.SpecialPropertyName = SpecialPropertyName; } - - + /// /// Gets or Sets SpecialPropertyName /// [DataMember(Name="$special[property.name]", EmitDefaultValue=false)] public long? SpecialPropertyName { get; set; } - /// /// Returns the string presentation of the object /// @@ -50,7 +46,7 @@ namespace IO.Swagger.Model sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Tag.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Tag.cs index 93c7b4deb06..ffb42e09df9 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Tag.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/Tag.cs @@ -5,7 +5,6 @@ using System.Text; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.ComponentModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -17,35 +16,32 @@ namespace IO.Swagger.Model /// [DataContract] public partial class Tag : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// Id. /// Name. - public Tag(long? Id = null, string Name = null) { - this.Id = Id; - this.Name = Name; + + + this.Id = Id; + + this.Name = Name; } - - + /// /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] public long? Id { get; set; } - /// /// Gets or Sets Name /// [DataMember(Name="name", EmitDefaultValue=false)] public string Name { get; set; } - /// /// Returns the string presentation of the object /// @@ -55,11 +51,11 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class Tag {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); +sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// diff --git a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/User.cs b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/User.cs index 3336da10d73..3931afbf0f8 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/User.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Model/User.cs @@ -5,7 +5,6 @@ using System.Text; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.ComponentModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -17,11 +16,9 @@ namespace IO.Swagger.Model /// [DataContract] public partial class User : IEquatable - { - + { /// /// Initializes a new instance of the class. - /// Initializes a new instance of the class. /// /// Id. /// Username. @@ -31,70 +28,69 @@ namespace IO.Swagger.Model /// Password. /// Phone. /// User Status. - public User(long? Id = null, string Username = null, string FirstName = null, string LastName = null, string Email = null, string Password = null, string Phone = null, int? UserStatus = null) { - this.Id = Id; - this.Username = Username; - this.FirstName = FirstName; - this.LastName = LastName; - this.Email = Email; - this.Password = Password; - this.Phone = Phone; - this.UserStatus = UserStatus; + + + this.Id = Id; + + this.Username = Username; + + this.FirstName = FirstName; + + this.LastName = LastName; + + this.Email = Email; + + this.Password = Password; + + this.Phone = Phone; + + this.UserStatus = UserStatus; } - - + /// /// Gets or Sets Id /// [DataMember(Name="id", EmitDefaultValue=false)] public long? Id { get; set; } - /// /// Gets or Sets Username /// [DataMember(Name="username", EmitDefaultValue=false)] public string Username { get; set; } - /// /// Gets or Sets FirstName /// [DataMember(Name="firstName", EmitDefaultValue=false)] public string FirstName { get; set; } - /// /// Gets or Sets LastName /// [DataMember(Name="lastName", EmitDefaultValue=false)] public string LastName { get; set; } - /// /// Gets or Sets Email /// [DataMember(Name="email", EmitDefaultValue=false)] public string Email { get; set; } - /// /// Gets or Sets Password /// [DataMember(Name="password", EmitDefaultValue=false)] public string Password { get; set; } - /// /// Gets or Sets Phone /// [DataMember(Name="phone", EmitDefaultValue=false)] public string Phone { get; set; } - /// /// User Status /// /// User Status [DataMember(Name="userStatus", EmitDefaultValue=false)] public int? UserStatus { get; set; } - /// /// Returns the string presentation of the object /// @@ -104,17 +100,17 @@ namespace IO.Swagger.Model var sb = new StringBuilder(); sb.Append("class User {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Username: ").Append(Username).Append("\n"); - sb.Append(" FirstName: ").Append(FirstName).Append("\n"); - sb.Append(" LastName: ").Append(LastName).Append("\n"); - sb.Append(" Email: ").Append(Email).Append("\n"); - sb.Append(" Password: ").Append(Password).Append("\n"); - sb.Append(" Phone: ").Append(Phone).Append("\n"); - sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); +sb.Append(" Username: ").Append(Username).Append("\n"); +sb.Append(" FirstName: ").Append(FirstName).Append("\n"); +sb.Append(" LastName: ").Append(LastName).Append("\n"); +sb.Append(" Email: ").Append(Email).Append("\n"); +sb.Append(" Password: ").Append(Password).Append("\n"); +sb.Append(" Phone: ").Append(Phone).Append("\n"); +sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); sb.Append("}\n"); return sb.ToString(); } - + /// /// Returns the JSON string presentation of the object /// diff --git a/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.csproj b/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.csproj index 0d3c33168db..389c142e1bd 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.csproj +++ b/samples/client/petstore/csharp/SwaggerClientTest/SwaggerClientTest.csproj @@ -72,6 +72,8 @@ + + diff --git a/samples/client/petstore/csharp/SwaggerClientTest/TestOrder.cs b/samples/client/petstore/csharp/SwaggerClientTest/TestOrder.cs index e7bf8428eec..59411416a76 100644 --- a/samples/client/petstore/csharp/SwaggerClientTest/TestOrder.cs +++ b/samples/client/petstore/csharp/SwaggerClientTest/TestOrder.cs @@ -73,6 +73,9 @@ namespace SwaggerClientTest.TestOrder } + /* + * Skip the following test as the fake endpiont has been removed from the swagger spec + * We'll uncomment below after we update the Petstore server /// /// Test TestGetInventoryInObject /// @@ -93,6 +96,7 @@ namespace SwaggerClientTest.TestOrder Assert.IsInstanceOf (typeof(int?), Int32.Parse(entry.Value)); } } + */ /// /// Test Enum diff --git a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.csproj.FilesWrittenAbsolute.txt b/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.csproj.FilesWrittenAbsolute.txt deleted file mode 100644 index 7d68ff048e5..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.csproj.FilesWrittenAbsolute.txt +++ /dev/null @@ -1,9 +0,0 @@ -/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/.NETFramework,Version=v4.5.AssemblyAttribute.cs -/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.swagger-logo.png -/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/Newtonsoft.Json.dll -/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/nunit.framework.dll -/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/RestSharp.dll -/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll.mdb -/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/bin/Debug/SwaggerClientTest.dll -/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll -/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/csharp/SwaggerClientTest/obj/Debug/SwaggerClientTest.dll.mdb diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index 3082b7f1847..a0db472b07f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -1,11 +1,11 @@ # SwaggerClient-php -This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 1.0.0 - Package version: 1.0.0 -- Build date: 2016-04-06T21:53:32.791+08:00 +- Build date: 2016-04-27T17:54:12.143+08:00 - Build package: class io.swagger.codegen.languages.PhpClientCodegen ## Requirements @@ -58,16 +58,24 @@ Please follow the [installation procedure](#installation--usage) and then run th setAccessToken('YOUR_ACCESS_TOKEN'); - -$api_instance = new Swagger\Client\Api\PetApi(); -$body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store +$api_instance = new Swagger\Client\Api\FakeApi(); +$number = "number_example"; // string | None +$double = 1.2; // double | None +$string = "string_example"; // string | None +$byte = "B"; // string | None +$integer = 56; // int | None +$int32 = 56; // int | None +$int64 = 789; // int | None +$float = 3.4; // float | None +$binary = "B"; // string | None +$date = new \DateTime(); // \DateTime | None +$date_time = new \DateTime(); // \DateTime | None +$password = "password_example"; // string | None try { - $api_instance->addPet($body); + $api_instance->testEndpointParameters($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password); } catch (Exception $e) { - echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), "\n"; + echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), "\n"; } ?> @@ -79,21 +87,17 @@ 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 *PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**addPetUsingByteArray**](docs/PetApi.md#addpetusingbytearray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding 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 *PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags *PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**getPetByIdInObject**](docs/PetApi.md#getpetbyidinobject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID' -*PetApi* | [**petPetIdtestingByteArraytrueGet**](docs/PetApi.md#petpetidtestingbytearraytrueget) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID' *PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image *StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*StoreApi* | [**findOrdersByStatus**](docs/StoreApi.md#findordersbystatus) | **GET** /store/findByStatus | Finds orders by status *StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getInventoryInObject**](docs/StoreApi.md#getinventoryinobject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory' *StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet *UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user @@ -109,12 +113,13 @@ Class | Method | HTTP request | Description ## Documentation For Models - [Animal](docs/Animal.md) + - [ApiResponse](docs/ApiResponse.md) - [Cat](docs/Cat.md) - [Category](docs/Category.md) - [Dog](docs/Dog.md) - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) - - [InlineResponse200](docs/InlineResponse200.md) + - [FormatTest](docs/FormatTest.md) - [Model200Response](docs/Model200Response.md) - [ModelReturn](docs/ModelReturn.md) - [Name](docs/Name.md) @@ -128,45 +133,17 @@ Class | Method | HTTP request | Description ## Documentation For Authorization -## test_api_key_header - -- **Type**: API key -- **API key parameter name**: test_api_key_header -- **Location**: HTTP header - ## api_key - **Type**: API key - **API key parameter name**: api_key - **Location**: HTTP header -## test_http_basic - -- **Type**: HTTP basic authentication - -## test_api_client_secret - -- **Type**: API key -- **API key parameter name**: x-test_api_client_secret -- **Location**: HTTP header - -## test_api_client_id - -- **Type**: API key -- **API key parameter name**: x-test_api_client_id -- **Location**: HTTP header - -## test_api_key_query - -- **Type**: API key -- **API key parameter name**: test_api_key_query -- **Location**: URL query string - ## petstore_auth - **Type**: OAuth - **Flow**: implicit -- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog - **Scopes**: - **write:pets**: modify pets in your account - **read:pets**: read your pets diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Order.md b/samples/client/petstore/php/SwaggerClient-php/docs/Order.md index cde24fe43cc..ddae5cc2b57 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Order.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Order.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes **pet_id** | **int** | | [optional] **quantity** | **int** | | [optional] **ship_date** | [**\DateTime**](\DateTime.md) | | [optional] -**status** | **string** | Order Status | [optional] [default to STATUS_PLACED] -**complete** | **bool** | | [optional] +**status** | **string** | Order Status | [optional] +**complete** | **bool** | | [optional] [default to false] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php index e41c38c535a..12224679ac7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php @@ -47,9 +47,15 @@ use \ArrayAccess; class Animal implements ArrayAccess { /** - * Array of property to type mappings. Used for (de)serialization - * @var string[] - */ + * The original name of the model. + * @var string + */ + static $swaggerModelName = 'Animal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ static $swaggerTypes = array( 'class_name' => 'string' ); @@ -98,13 +104,11 @@ class Animal implements ArrayAccess - /** * $class_name * @var string */ protected $class_name; - /** * Constructor @@ -113,13 +117,16 @@ class Animal implements ArrayAccess public function __construct(array $data = null) { + // Initialize discriminator property with the model name. + $discrimintor = array_search('className', self::$attributeMap); + $this->{$discrimintor} = static::$swaggerModelName; + if ($data != null) { $this->class_name = $data["class_name"]; } } - /** - * Gets class_name. + * Gets class_name * @return string */ public function getClassName() @@ -128,7 +135,7 @@ class Animal implements ArrayAccess } /** - * Sets class_name. + * Sets class_name * @param string $class_name * @return $this */ @@ -138,7 +145,6 @@ class Animal implements ArrayAccess $this->class_name = $class_name; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset @@ -181,17 +187,15 @@ class Animal implements ArrayAccess } /** - * Gets the string presentation of the object. + * Gets the string presentation of the object * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } } - -?> diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php index 4f467a5aab5..1e96648c7c1 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php @@ -61,67 +61,71 @@ class ApiResponse implements ArrayAccess 'type' => 'string', 'message' => 'string' ); - + 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[] - */ + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ static $attributeMap = array( 'code' => 'code', 'type' => 'type', 'message' => 'message' ); - + static function attributeMap() { return self::$attributeMap; } /** - * Array of attributes to setter functions (for deserialization of responses) - * @var string[] - */ + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ static $setters = array( 'code' => 'setCode', 'type' => 'setType', 'message' => 'setMessage' ); - + static function setters() { return self::$setters; } /** - * Array of attributes to getter functions (for serialization of requests) - * @var string[] - */ + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ static $getters = array( 'code' => 'getCode', 'type' => 'getType', 'message' => 'getMessage' ); - + static function getters() { return self::$getters; } + + + + /** - * $code - * @var int - */ + * $code + * @var int + */ protected $code; /** - * $type - * @var string - */ + * $type + * @var string + */ protected $type; /** - * $message - * @var string - */ + * $message + * @var string + */ protected $message; /** @@ -146,7 +150,7 @@ class ApiResponse implements ArrayAccess { return $this->code; } - + /** * Sets code * @param int $code @@ -166,7 +170,7 @@ class ApiResponse implements ArrayAccess { return $this->type; } - + /** * Sets type * @param string $type @@ -186,7 +190,7 @@ class ApiResponse implements ArrayAccess { return $this->message; } - + /** * Sets message * @param string $message @@ -207,7 +211,7 @@ class ApiResponse implements ArrayAccess { return isset($this->$offset); } - + /** * Gets offset. * @param integer $offset Offset @@ -217,7 +221,7 @@ class ApiResponse implements ArrayAccess { return $this->$offset; } - + /** * Sets value based on offset. * @param integer $offset Offset @@ -228,7 +232,7 @@ class ApiResponse implements ArrayAccess { $this->$offset = $value; } - + /** * Unsets offset. * @param integer $offset Offset @@ -238,7 +242,7 @@ class ApiResponse implements ArrayAccess { unset($this->$offset); } - + /** * Gets the string presentation of the object * @return string diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php index 078b57049ec..cf85b9fb5bc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php @@ -47,9 +47,15 @@ use \ArrayAccess; class Cat extends Animal implements ArrayAccess { /** - * Array of property to type mappings. Used for (de)serialization - * @var string[] - */ + * The original name of the model. + * @var string + */ + static $swaggerModelName = 'Cat'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ static $swaggerTypes = array( 'declawed' => 'bool' ); @@ -98,13 +104,11 @@ class Cat extends Animal implements ArrayAccess - /** * $declawed * @var bool */ protected $declawed; - /** * Constructor @@ -113,13 +117,13 @@ class Cat extends Animal implements ArrayAccess public function __construct(array $data = null) { parent::__construct($data); + if ($data != null) { $this->declawed = $data["declawed"]; } } - /** - * Gets declawed. + * Gets declawed * @return bool */ public function getDeclawed() @@ -128,7 +132,7 @@ class Cat extends Animal implements ArrayAccess } /** - * Sets declawed. + * Sets declawed * @param bool $declawed * @return $this */ @@ -138,7 +142,6 @@ class Cat extends Animal implements ArrayAccess $this->declawed = $declawed; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset @@ -181,17 +184,15 @@ class Cat extends Animal implements ArrayAccess } /** - * Gets the string presentation of the object. + * Gets the string presentation of the object * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } } - -?> diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php index b2fd2c3c3d6..ddc52637051 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php @@ -47,9 +47,15 @@ use \ArrayAccess; class Category implements ArrayAccess { /** - * Array of property to type mappings. Used for (de)serialization - * @var string[] - */ + * The original name of the model. + * @var string + */ + static $swaggerModelName = 'Category'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ static $swaggerTypes = array( 'id' => 'int', 'name' => 'string' @@ -102,19 +108,16 @@ class Category implements ArrayAccess - /** * $id * @var int */ protected $id; - /** * $name * @var string */ protected $name; - /** * Constructor @@ -123,14 +126,14 @@ class Category implements ArrayAccess public function __construct(array $data = null) { + if ($data != null) { $this->id = $data["id"]; $this->name = $data["name"]; } } - /** - * Gets id. + * Gets id * @return int */ public function getId() @@ -139,7 +142,7 @@ class Category implements ArrayAccess } /** - * Sets id. + * Sets id * @param int $id * @return $this */ @@ -149,9 +152,8 @@ class Category implements ArrayAccess $this->id = $id; return $this; } - /** - * Gets name. + * Gets name * @return string */ public function getName() @@ -160,7 +162,7 @@ class Category implements ArrayAccess } /** - * Sets name. + * Sets name * @param string $name * @return $this */ @@ -170,7 +172,6 @@ class Category implements ArrayAccess $this->name = $name; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset @@ -213,17 +214,15 @@ class Category implements ArrayAccess } /** - * Gets the string presentation of the object. + * Gets the string presentation of the object * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } } - -?> diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php index c854b06a937..15b5c22e0ce 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php @@ -47,9 +47,15 @@ use \ArrayAccess; class Dog extends Animal implements ArrayAccess { /** - * Array of property to type mappings. Used for (de)serialization - * @var string[] - */ + * The original name of the model. + * @var string + */ + static $swaggerModelName = 'Dog'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ static $swaggerTypes = array( 'breed' => 'string' ); @@ -98,13 +104,11 @@ class Dog extends Animal implements ArrayAccess - /** * $breed * @var string */ protected $breed; - /** * Constructor @@ -113,13 +117,13 @@ class Dog extends Animal implements ArrayAccess public function __construct(array $data = null) { parent::__construct($data); + if ($data != null) { $this->breed = $data["breed"]; } } - /** - * Gets breed. + * Gets breed * @return string */ public function getBreed() @@ -128,7 +132,7 @@ class Dog extends Animal implements ArrayAccess } /** - * Sets breed. + * Sets breed * @param string $breed * @return $this */ @@ -138,7 +142,6 @@ class Dog extends Animal implements ArrayAccess $this->breed = $breed; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset @@ -181,17 +184,15 @@ class Dog extends Animal implements ArrayAccess } /** - * Gets the string presentation of the object. + * Gets the string presentation of the object * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } } - -?> diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php index 78c0d812447..6888cac7cd3 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php @@ -68,18 +68,17 @@ class FormatTest implements ArrayAccess 'binary' => 'string', 'date' => '\DateTime', 'date_time' => '\DateTime', - 'uuid' => 'string', 'password' => 'string' ); - + 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[] - */ + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ static $attributeMap = array( 'integer' => 'integer', 'int32' => 'int32', @@ -92,18 +91,17 @@ class FormatTest implements ArrayAccess 'binary' => 'binary', 'date' => 'date', 'date_time' => 'dateTime', - 'uuid' => 'uuid', 'password' => 'password' ); - + static function attributeMap() { return self::$attributeMap; } /** - * Array of attributes to setter functions (for deserialization of responses) - * @var string[] - */ + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ static $setters = array( 'integer' => 'setInteger', 'int32' => 'setInt32', @@ -116,18 +114,17 @@ class FormatTest implements ArrayAccess 'binary' => 'setBinary', 'date' => 'setDate', 'date_time' => 'setDateTime', - 'uuid' => 'setUuid', 'password' => 'setPassword' ); - + static function setters() { return self::$setters; } /** - * Array of attributes to getter functions (for serialization of requests) - * @var string[] - */ + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ static $getters = array( 'integer' => 'getInteger', 'int32' => 'getInt32', @@ -140,78 +137,76 @@ class FormatTest implements ArrayAccess 'binary' => 'getBinary', 'date' => 'getDate', 'date_time' => 'getDateTime', - 'uuid' => 'getUuid', 'password' => 'getPassword' ); - + static function getters() { return self::$getters; } + + + + /** - * $integer - * @var int - */ + * $integer + * @var int + */ protected $integer; /** - * $int32 - * @var int - */ + * $int32 + * @var int + */ protected $int32; /** - * $int64 - * @var int - */ + * $int64 + * @var int + */ protected $int64; /** - * $number - * @var float - */ + * $number + * @var float + */ protected $number; /** - * $float - * @var float - */ + * $float + * @var float + */ protected $float; /** - * $double - * @var double - */ + * $double + * @var double + */ protected $double; /** - * $string - * @var string - */ + * $string + * @var string + */ protected $string; /** - * $byte - * @var string - */ + * $byte + * @var string + */ protected $byte; /** - * $binary - * @var string - */ + * $binary + * @var string + */ protected $binary; /** - * $date - * @var \DateTime - */ + * $date + * @var \DateTime + */ protected $date; /** - * $date_time - * @var \DateTime - */ + * $date_time + * @var \DateTime + */ protected $date_time; /** - * $uuid - * @var string - */ - protected $uuid; - /** - * $password - * @var string - */ + * $password + * @var string + */ protected $password; /** @@ -234,7 +229,6 @@ class FormatTest implements ArrayAccess $this->binary = $data["binary"]; $this->date = $data["date"]; $this->date_time = $data["date_time"]; - $this->uuid = $data["uuid"]; $this->password = $data["password"]; } } @@ -246,7 +240,7 @@ class FormatTest implements ArrayAccess { return $this->integer; } - + /** * Sets integer * @param int $integer @@ -266,7 +260,7 @@ class FormatTest implements ArrayAccess { return $this->int32; } - + /** * Sets int32 * @param int $int32 @@ -286,7 +280,7 @@ class FormatTest implements ArrayAccess { return $this->int64; } - + /** * Sets int64 * @param int $int64 @@ -306,7 +300,7 @@ class FormatTest implements ArrayAccess { return $this->number; } - + /** * Sets number * @param float $number @@ -326,7 +320,7 @@ class FormatTest implements ArrayAccess { return $this->float; } - + /** * Sets float * @param float $float @@ -346,7 +340,7 @@ class FormatTest implements ArrayAccess { return $this->double; } - + /** * Sets double * @param double $double @@ -366,7 +360,7 @@ class FormatTest implements ArrayAccess { return $this->string; } - + /** * Sets string * @param string $string @@ -386,7 +380,7 @@ class FormatTest implements ArrayAccess { return $this->byte; } - + /** * Sets byte * @param string $byte @@ -406,7 +400,7 @@ class FormatTest implements ArrayAccess { return $this->binary; } - + /** * Sets binary * @param string $binary @@ -426,7 +420,7 @@ class FormatTest implements ArrayAccess { return $this->date; } - + /** * Sets date * @param \DateTime $date @@ -446,7 +440,7 @@ class FormatTest implements ArrayAccess { return $this->date_time; } - + /** * Sets date_time * @param \DateTime $date_time @@ -458,26 +452,6 @@ class FormatTest implements ArrayAccess $this->date_time = $date_time; return $this; } - /** - * Gets uuid - * @return string - */ - public function getUuid() - { - return $this->uuid; - } - - /** - * Sets uuid - * @param string $uuid - * @return $this - */ - public function setUuid($uuid) - { - - $this->uuid = $uuid; - return $this; - } /** * Gets password * @return string @@ -486,7 +460,7 @@ class FormatTest implements ArrayAccess { return $this->password; } - + /** * Sets password * @param string $password @@ -507,7 +481,7 @@ class FormatTest implements ArrayAccess { return isset($this->$offset); } - + /** * Gets offset. * @param integer $offset Offset @@ -517,7 +491,7 @@ class FormatTest implements ArrayAccess { return $this->$offset; } - + /** * Sets value based on offset. * @param integer $offset Offset @@ -528,7 +502,7 @@ class FormatTest implements ArrayAccess { $this->$offset = $value; } - + /** * Unsets offset. * @param integer $offset Offset @@ -538,7 +512,7 @@ class FormatTest implements ArrayAccess { unset($this->$offset); } - + /** * Gets the string presentation of the object * @return string diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php index 8ea916fcc1e..fd305916a2d 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php @@ -38,7 +38,7 @@ use \ArrayAccess; * Model200Response Class Doc Comment * * @category Class - * @description + * @description Model for testing model name starting with number * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -47,9 +47,15 @@ use \ArrayAccess; class Model200Response implements ArrayAccess { /** - * Array of property to type mappings. Used for (de)serialization - * @var string[] - */ + * The original name of the model. + * @var string + */ + static $swaggerModelName = '200_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ static $swaggerTypes = array( 'name' => 'int' ); @@ -98,13 +104,11 @@ class Model200Response implements ArrayAccess - /** * $name * @var int */ protected $name; - /** * Constructor @@ -113,13 +117,13 @@ class Model200Response implements ArrayAccess public function __construct(array $data = null) { + if ($data != null) { $this->name = $data["name"]; } } - /** - * Gets name. + * Gets name * @return int */ public function getName() @@ -128,7 +132,7 @@ class Model200Response implements ArrayAccess } /** - * Sets name. + * Sets name * @param int $name * @return $this */ @@ -138,7 +142,6 @@ class Model200Response implements ArrayAccess $this->name = $name; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset @@ -181,17 +184,15 @@ class Model200Response implements ArrayAccess } /** - * Gets the string presentation of the object. + * Gets the string presentation of the object * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } } - -?> diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php index 1453c1a947a..a7e36a14365 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php @@ -38,7 +38,7 @@ use \ArrayAccess; * ModelReturn Class Doc Comment * * @category Class - * @description + * @description Model for testing reserved words * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -47,9 +47,15 @@ use \ArrayAccess; class ModelReturn implements ArrayAccess { /** - * Array of property to type mappings. Used for (de)serialization - * @var string[] - */ + * The original name of the model. + * @var string + */ + static $swaggerModelName = 'Return'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ static $swaggerTypes = array( 'return' => 'int' ); @@ -98,13 +104,11 @@ class ModelReturn implements ArrayAccess - /** * $return * @var int */ protected $return; - /** * Constructor @@ -113,13 +117,13 @@ class ModelReturn implements ArrayAccess public function __construct(array $data = null) { + if ($data != null) { $this->return = $data["return"]; } } - /** - * Gets return. + * Gets return * @return int */ public function getReturn() @@ -128,7 +132,7 @@ class ModelReturn implements ArrayAccess } /** - * Sets return. + * Sets return * @param int $return * @return $this */ @@ -138,7 +142,6 @@ class ModelReturn implements ArrayAccess $this->return = $return; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset @@ -181,17 +184,15 @@ class ModelReturn implements ArrayAccess } /** - * Gets the string presentation of the object. + * Gets the string presentation of the object * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } } - -?> diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php index a9a5b42831b..ff62e4f1c25 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php @@ -38,7 +38,7 @@ use \ArrayAccess; * Name Class Doc Comment * * @category Class - * @description + * @description Model for testing model name same as property name * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -47,12 +47,19 @@ use \ArrayAccess; class Name implements ArrayAccess { /** - * Array of property to type mappings. Used for (de)serialization - * @var string[] - */ + * The original name of the model. + * @var string + */ + static $swaggerModelName = 'Name'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ static $swaggerTypes = array( 'name' => 'int', - 'snake_case' => 'int' + 'snake_case' => 'int', + 'property' => 'string' ); static function swaggerTypes() { @@ -65,7 +72,8 @@ class Name implements ArrayAccess */ static $attributeMap = array( 'name' => 'name', - 'snake_case' => 'snake_case' + 'snake_case' => 'snake_case', + 'property' => 'property' ); static function attributeMap() { @@ -78,7 +86,8 @@ class Name implements ArrayAccess */ static $setters = array( 'name' => 'setName', - 'snake_case' => 'setSnakeCase' + 'snake_case' => 'setSnakeCase', + 'property' => 'setProperty' ); static function setters() { @@ -91,7 +100,8 @@ class Name implements ArrayAccess */ static $getters = array( 'name' => 'getName', - 'snake_case' => 'getSnakeCase' + 'snake_case' => 'getSnakeCase', + 'property' => 'getProperty' ); static function getters() { @@ -102,19 +112,21 @@ class Name implements ArrayAccess - /** * $name * @var int */ protected $name; - /** * $snake_case * @var int */ protected $snake_case; - + /** + * $property + * @var string + */ + protected $property; /** * Constructor @@ -123,14 +135,15 @@ class Name implements ArrayAccess public function __construct(array $data = null) { + if ($data != null) { $this->name = $data["name"]; $this->snake_case = $data["snake_case"]; + $this->property = $data["property"]; } } - /** - * Gets name. + * Gets name * @return int */ public function getName() @@ -139,7 +152,7 @@ class Name implements ArrayAccess } /** - * Sets name. + * Sets name * @param int $name * @return $this */ @@ -149,9 +162,8 @@ class Name implements ArrayAccess $this->name = $name; return $this; } - /** - * Gets snake_case. + * Gets snake_case * @return int */ public function getSnakeCase() @@ -160,7 +172,7 @@ class Name implements ArrayAccess } /** - * Sets snake_case. + * Sets snake_case * @param int $snake_case * @return $this */ @@ -170,7 +182,26 @@ class Name implements ArrayAccess $this->snake_case = $snake_case; return $this; } - + /** + * Gets property + * @return string + */ + public function getProperty() + { + return $this->property; + } + + /** + * Sets property + * @param string $property + * @return $this + */ + public function setProperty($property) + { + + $this->property = $property; + return $this; + } /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset @@ -213,17 +244,15 @@ class Name implements ArrayAccess } /** - * Gets the string presentation of the object. + * Gets the string presentation of the object * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } } - -?> diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php index e2983766141..270a53a41e7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php @@ -47,9 +47,15 @@ use \ArrayAccess; class Order implements ArrayAccess { /** - * Array of property to type mappings. Used for (de)serialization - * @var string[] - */ + * The original name of the model. + * @var string + */ + static $swaggerModelName = 'Order'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ static $swaggerTypes = array( 'id' => 'int', 'pet_id' => 'int', @@ -133,43 +139,36 @@ class Order implements ArrayAccess } - /** * $id * @var int */ protected $id; - /** * $pet_id * @var int */ protected $pet_id; - /** * $quantity * @var int */ protected $quantity; - /** * $ship_date * @var \DateTime */ protected $ship_date; - /** * $status Order Status * @var string */ - protected $status = STATUS_PLACED; - + protected $status; /** * $complete * @var bool */ - protected $complete; - + protected $complete = false; /** * Constructor @@ -178,6 +177,7 @@ class Order implements ArrayAccess public function __construct(array $data = null) { + if ($data != null) { $this->id = $data["id"]; $this->pet_id = $data["pet_id"]; @@ -187,9 +187,8 @@ class Order implements ArrayAccess $this->complete = $data["complete"]; } } - /** - * Gets id. + * Gets id * @return int */ public function getId() @@ -198,7 +197,7 @@ class Order implements ArrayAccess } /** - * Sets id. + * Sets id * @param int $id * @return $this */ @@ -208,9 +207,8 @@ class Order implements ArrayAccess $this->id = $id; return $this; } - /** - * Gets pet_id. + * Gets pet_id * @return int */ public function getPetId() @@ -219,7 +217,7 @@ class Order implements ArrayAccess } /** - * Sets pet_id. + * Sets pet_id * @param int $pet_id * @return $this */ @@ -229,9 +227,8 @@ class Order implements ArrayAccess $this->pet_id = $pet_id; return $this; } - /** - * Gets quantity. + * Gets quantity * @return int */ public function getQuantity() @@ -240,7 +237,7 @@ class Order implements ArrayAccess } /** - * Sets quantity. + * Sets quantity * @param int $quantity * @return $this */ @@ -250,9 +247,8 @@ class Order implements ArrayAccess $this->quantity = $quantity; return $this; } - /** - * Gets ship_date. + * Gets ship_date * @return \DateTime */ public function getShipDate() @@ -261,7 +257,7 @@ class Order implements ArrayAccess } /** - * Sets ship_date. + * Sets ship_date * @param \DateTime $ship_date * @return $this */ @@ -271,9 +267,8 @@ class Order implements ArrayAccess $this->ship_date = $ship_date; return $this; } - /** - * Gets status. + * Gets status * @return string */ public function getStatus() @@ -282,7 +277,7 @@ class Order implements ArrayAccess } /** - * Sets status. + * Sets status * @param string $status Order Status * @return $this */ @@ -295,9 +290,8 @@ class Order implements ArrayAccess $this->status = $status; return $this; } - /** - * Gets complete. + * Gets complete * @return bool */ public function getComplete() @@ -306,7 +300,7 @@ class Order implements ArrayAccess } /** - * Sets complete. + * Sets complete * @param bool $complete * @return $this */ @@ -316,7 +310,6 @@ class Order implements ArrayAccess $this->complete = $complete; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset @@ -359,17 +352,15 @@ class Order implements ArrayAccess } /** - * Gets the string presentation of the object. + * Gets the string presentation of the object * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } } - -?> diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php index 3f717048b0a..ce1d7a63944 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php @@ -47,9 +47,15 @@ use \ArrayAccess; class Pet implements ArrayAccess { /** - * Array of property to type mappings. Used for (de)serialization - * @var string[] - */ + * The original name of the model. + * @var string + */ + static $swaggerModelName = 'Pet'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ static $swaggerTypes = array( 'id' => 'int', 'category' => '\Swagger\Client\Model\Category', @@ -133,43 +139,36 @@ class Pet implements ArrayAccess } - /** * $id * @var int */ protected $id; - /** * $category * @var \Swagger\Client\Model\Category */ protected $category; - /** * $name * @var string */ protected $name; - /** * $photo_urls * @var string[] */ protected $photo_urls; - /** * $tags * @var \Swagger\Client\Model\Tag[] */ protected $tags; - /** * $status pet status in the store * @var string */ protected $status; - /** * Constructor @@ -178,6 +177,7 @@ class Pet implements ArrayAccess public function __construct(array $data = null) { + if ($data != null) { $this->id = $data["id"]; $this->category = $data["category"]; @@ -187,9 +187,8 @@ class Pet implements ArrayAccess $this->status = $data["status"]; } } - /** - * Gets id. + * Gets id * @return int */ public function getId() @@ -198,7 +197,7 @@ class Pet implements ArrayAccess } /** - * Sets id. + * Sets id * @param int $id * @return $this */ @@ -208,9 +207,8 @@ class Pet implements ArrayAccess $this->id = $id; return $this; } - /** - * Gets category. + * Gets category * @return \Swagger\Client\Model\Category */ public function getCategory() @@ -219,7 +217,7 @@ class Pet implements ArrayAccess } /** - * Sets category. + * Sets category * @param \Swagger\Client\Model\Category $category * @return $this */ @@ -229,9 +227,8 @@ class Pet implements ArrayAccess $this->category = $category; return $this; } - /** - * Gets name. + * Gets name * @return string */ public function getName() @@ -240,7 +237,7 @@ class Pet implements ArrayAccess } /** - * Sets name. + * Sets name * @param string $name * @return $this */ @@ -250,9 +247,8 @@ class Pet implements ArrayAccess $this->name = $name; return $this; } - /** - * Gets photo_urls. + * Gets photo_urls * @return string[] */ public function getPhotoUrls() @@ -261,7 +257,7 @@ class Pet implements ArrayAccess } /** - * Sets photo_urls. + * Sets photo_urls * @param string[] $photo_urls * @return $this */ @@ -271,9 +267,8 @@ class Pet implements ArrayAccess $this->photo_urls = $photo_urls; return $this; } - /** - * Gets tags. + * Gets tags * @return \Swagger\Client\Model\Tag[] */ public function getTags() @@ -282,7 +277,7 @@ class Pet implements ArrayAccess } /** - * Sets tags. + * Sets tags * @param \Swagger\Client\Model\Tag[] $tags * @return $this */ @@ -292,9 +287,8 @@ class Pet implements ArrayAccess $this->tags = $tags; return $this; } - /** - * Gets status. + * Gets status * @return string */ public function getStatus() @@ -303,7 +297,7 @@ class Pet implements ArrayAccess } /** - * Sets status. + * Sets status * @param string $status pet status in the store * @return $this */ @@ -316,7 +310,6 @@ class Pet implements ArrayAccess $this->status = $status; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset @@ -359,17 +352,15 @@ class Pet implements ArrayAccess } /** - * Gets the string presentation of the object. + * Gets the string presentation of the object * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } } - -?> diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php index daaa6f92624..e2cb5b6e90f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php @@ -47,9 +47,15 @@ use \ArrayAccess; class SpecialModelName implements ArrayAccess { /** - * Array of property to type mappings. Used for (de)serialization - * @var string[] - */ + * The original name of the model. + * @var string + */ + static $swaggerModelName = '$special[model.name]'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ static $swaggerTypes = array( 'special_property_name' => 'int' ); @@ -98,13 +104,11 @@ class SpecialModelName implements ArrayAccess - /** * $special_property_name * @var int */ protected $special_property_name; - /** * Constructor @@ -113,13 +117,13 @@ class SpecialModelName implements ArrayAccess public function __construct(array $data = null) { + if ($data != null) { $this->special_property_name = $data["special_property_name"]; } } - /** - * Gets special_property_name. + * Gets special_property_name * @return int */ public function getSpecialPropertyName() @@ -128,7 +132,7 @@ class SpecialModelName implements ArrayAccess } /** - * Sets special_property_name. + * Sets special_property_name * @param int $special_property_name * @return $this */ @@ -138,7 +142,6 @@ class SpecialModelName implements ArrayAccess $this->special_property_name = $special_property_name; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset @@ -181,17 +184,15 @@ class SpecialModelName implements ArrayAccess } /** - * Gets the string presentation of the object. + * Gets the string presentation of the object * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } } - -?> diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php index d0b5da095cc..159c531b8b2 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php @@ -47,9 +47,15 @@ use \ArrayAccess; class Tag implements ArrayAccess { /** - * Array of property to type mappings. Used for (de)serialization - * @var string[] - */ + * The original name of the model. + * @var string + */ + static $swaggerModelName = 'Tag'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ static $swaggerTypes = array( 'id' => 'int', 'name' => 'string' @@ -102,19 +108,16 @@ class Tag implements ArrayAccess - /** * $id * @var int */ protected $id; - /** * $name * @var string */ protected $name; - /** * Constructor @@ -123,14 +126,14 @@ class Tag implements ArrayAccess public function __construct(array $data = null) { + if ($data != null) { $this->id = $data["id"]; $this->name = $data["name"]; } } - /** - * Gets id. + * Gets id * @return int */ public function getId() @@ -139,7 +142,7 @@ class Tag implements ArrayAccess } /** - * Sets id. + * Sets id * @param int $id * @return $this */ @@ -149,9 +152,8 @@ class Tag implements ArrayAccess $this->id = $id; return $this; } - /** - * Gets name. + * Gets name * @return string */ public function getName() @@ -160,7 +162,7 @@ class Tag implements ArrayAccess } /** - * Sets name. + * Sets name * @param string $name * @return $this */ @@ -170,7 +172,6 @@ class Tag implements ArrayAccess $this->name = $name; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset @@ -213,17 +214,15 @@ class Tag implements ArrayAccess } /** - * Gets the string presentation of the object. + * Gets the string presentation of the object * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } } - -?> diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php index 0d934a73513..2d624103218 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php @@ -47,9 +47,15 @@ use \ArrayAccess; class User implements ArrayAccess { /** - * Array of property to type mappings. Used for (de)serialization - * @var string[] - */ + * The original name of the model. + * @var string + */ + static $swaggerModelName = 'User'; + + /** + * Array of property to type mappings. Used for (de)serialization + * @var string[] + */ static $swaggerTypes = array( 'id' => 'int', 'username' => 'string', @@ -126,55 +132,46 @@ class User implements ArrayAccess - /** * $id * @var int */ protected $id; - /** * $username * @var string */ protected $username; - /** * $first_name * @var string */ protected $first_name; - /** * $last_name * @var string */ protected $last_name; - /** * $email * @var string */ protected $email; - /** * $password * @var string */ protected $password; - /** * $phone * @var string */ protected $phone; - /** * $user_status User Status * @var int */ protected $user_status; - /** * Constructor @@ -183,6 +180,7 @@ class User implements ArrayAccess public function __construct(array $data = null) { + if ($data != null) { $this->id = $data["id"]; $this->username = $data["username"]; @@ -194,9 +192,8 @@ class User implements ArrayAccess $this->user_status = $data["user_status"]; } } - /** - * Gets id. + * Gets id * @return int */ public function getId() @@ -205,7 +202,7 @@ class User implements ArrayAccess } /** - * Sets id. + * Sets id * @param int $id * @return $this */ @@ -215,9 +212,8 @@ class User implements ArrayAccess $this->id = $id; return $this; } - /** - * Gets username. + * Gets username * @return string */ public function getUsername() @@ -226,7 +222,7 @@ class User implements ArrayAccess } /** - * Sets username. + * Sets username * @param string $username * @return $this */ @@ -236,9 +232,8 @@ class User implements ArrayAccess $this->username = $username; return $this; } - /** - * Gets first_name. + * Gets first_name * @return string */ public function getFirstName() @@ -247,7 +242,7 @@ class User implements ArrayAccess } /** - * Sets first_name. + * Sets first_name * @param string $first_name * @return $this */ @@ -257,9 +252,8 @@ class User implements ArrayAccess $this->first_name = $first_name; return $this; } - /** - * Gets last_name. + * Gets last_name * @return string */ public function getLastName() @@ -268,7 +262,7 @@ class User implements ArrayAccess } /** - * Sets last_name. + * Sets last_name * @param string $last_name * @return $this */ @@ -278,9 +272,8 @@ class User implements ArrayAccess $this->last_name = $last_name; return $this; } - /** - * Gets email. + * Gets email * @return string */ public function getEmail() @@ -289,7 +282,7 @@ class User implements ArrayAccess } /** - * Sets email. + * Sets email * @param string $email * @return $this */ @@ -299,9 +292,8 @@ class User implements ArrayAccess $this->email = $email; return $this; } - /** - * Gets password. + * Gets password * @return string */ public function getPassword() @@ -310,7 +302,7 @@ class User implements ArrayAccess } /** - * Sets password. + * Sets password * @param string $password * @return $this */ @@ -320,9 +312,8 @@ class User implements ArrayAccess $this->password = $password; return $this; } - /** - * Gets phone. + * Gets phone * @return string */ public function getPhone() @@ -331,7 +322,7 @@ class User implements ArrayAccess } /** - * Sets phone. + * Sets phone * @param string $phone * @return $this */ @@ -341,9 +332,8 @@ class User implements ArrayAccess $this->phone = $phone; return $this; } - /** - * Gets user_status. + * Gets user_status * @return int */ public function getUserStatus() @@ -352,7 +342,7 @@ class User implements ArrayAccess } /** - * Sets user_status. + * Sets user_status * @param int $user_status User Status * @return $this */ @@ -362,7 +352,6 @@ class User implements ArrayAccess $this->user_status = $user_status; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset @@ -405,17 +394,15 @@ class User implements ArrayAccess } /** - * Gets the string presentation of the object. + * Gets the string presentation of the object * @return string */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } } - -?>