diff --git a/docs/generators/aspnetcore.md b/docs/generators/aspnetcore.md index 012b747f2b3a..dc3db6878b21 100644 --- a/docs/generators/aspnetcore.md +++ b/docs/generators/aspnetcore.md @@ -28,7 +28,7 @@ sidebar_label: aspnetcore |newtonsoftVersion|Version for Microsoft.AspNetCore.Mvc.NewtonsoftJson for ASP.NET Core 3.0+| |3.0.0-preview5-19227-01| |useDefaultRouting|Use default routing for the ASP.NET Core version. For 3.0 turn off default because it is not yet supported.| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| -|enumValueNameSuffix|Suffix that will be appended to all enum value names.| |Enum| +|enumValueSuffix|Suffix that will be appended to all enum values.| |Enum| |classModifier|Class Modifier can be empty, abstract| || |operationModifier|Operation Modifier can be virtual, abstract or partial| |virtual| |buildTarget|Target to build an application or library| |program| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java index 1d6a4e99284a..ca990d7fe5f9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java @@ -227,8 +227,8 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, public static final String ENUM_NAME_SUFFIX = "enumNameSuffix"; public static final String ENUM_NAME_SUFFIX_DESC = "Suffix that will be appended to all enum names."; - public static final String ENUM_VALUE_NAME_SUFFIX = "enumValueNameSuffix"; - public static final String ENUM_VALUE_NAME_SUFFIX_DESC = "Suffix that will be appended to all enum value names."; + public static final String ENUM_VALUE_SUFFIX = "enumValueSuffix"; + public static final String ENUM_VALUE_SUFFIX_DESC = "Suffix that will be appended to all enum values. Note: For clients this may impact serialization and deserialization of enum values."; public static final String GIT_HOST = "gitHost"; public static final String GIT_HOST_DESC = "Git host, e.g. gitlab.com."; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java index 6a24895fb7da..90e536e57556 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java @@ -63,7 +63,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co protected String interfacePrefix = "I"; protected String enumNameSuffix = "Enum"; - protected String enumValueNameSuffix = "Enum"; + protected String enumValueSuffix = "Enum"; protected String sourceFolder = "src"; @@ -367,8 +367,8 @@ public void processOpts() { setEnumNameSuffix(additionalProperties.get(CodegenConstants.ENUM_NAME_SUFFIX).toString()); } - if (additionalProperties().containsKey(CodegenConstants.ENUM_VALUE_NAME_SUFFIX)) { - setEnumValueNameSuffix(additionalProperties.get(CodegenConstants.ENUM_VALUE_NAME_SUFFIX).toString()); + if (additionalProperties().containsKey(CodegenConstants.ENUM_VALUE_SUFFIX)) { + setEnumValueSuffix(additionalProperties.get(CodegenConstants.ENUM_VALUE_SUFFIX).toString()); } // This either updates additionalProperties with the above fixes, or sets the default if the option was not specified. @@ -1017,8 +1017,8 @@ public void setEnumNameSuffix(final String enumNameSuffix) { this.enumNameSuffix = enumNameSuffix; } - public void setEnumValueNameSuffix(final String enumValueNameSuffix) { - this.enumValueNameSuffix = enumValueNameSuffix; + public void setEnumValueSuffix(final String enumValueSuffix) { + this.enumValueSuffix = enumValueSuffix; } public boolean isSupportNullable() { @@ -1058,7 +1058,7 @@ public String toEnumVarName(String name, String datatype) { enumName = enumName.replaceFirst("^_", ""); enumName = enumName.replaceFirst("_$", ""); - enumName = camelize(enumName) + this.enumValueNameSuffix; + enumName = camelize(enumName) + this.enumValueSuffix; if (enumName.matches("\\d.*")) { // starts with number return "_" + enumName; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java index 91ea06e1a8e9..445cfd7bcd92 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AspNetCoreServerCodegen.java @@ -214,9 +214,9 @@ public AspNetCoreServerCodegen() { CodegenConstants.ENUM_NAME_SUFFIX_DESC, enumNameSuffix); - addOption(CodegenConstants.ENUM_VALUE_NAME_SUFFIX, - CodegenConstants.ENUM_VALUE_NAME_SUFFIX_DESC, - enumValueNameSuffix); + addOption(CodegenConstants.ENUM_VALUE_SUFFIX, + "Suffix that will be appended to all enum values.", + enumValueSuffix); classModifier.addEnum("", "Keep class default with no modifier"); classModifier.addEnum("abstract", "Make class abstract"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CsharpModelEnumTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CsharpModelEnumTest.java index 675b1d1bc56c..ab611177a131 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CsharpModelEnumTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CsharpModelEnumTest.java @@ -16,6 +16,7 @@ */ package org.openapitools.codegen.csharp; + import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; @@ -30,7 +31,6 @@ import java.util.Arrays; import java.util.HashMap; -import java.util.List; import java.util.Map; public class CsharpModelEnumTest { @@ -93,6 +93,25 @@ public void overrideEnumTest() { */ } + @Test(description = "use custom suffixes for enums") + public void useCustomEnumSuffixes() { + final AspNetCoreServerCodegen codegen = new AspNetCoreServerCodegen(); + codegen.setEnumNameSuffix("EnumName"); + codegen.setEnumValueSuffix("EnumValue"); + + OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/petstore.yaml"); + codegen.setOpenAPI(openAPI); + + final Schema petSchema = openAPI.getComponents().getSchemas().get("Pet"); + final CodegenModel cm = codegen.fromModel("Pet", petSchema); + final CodegenProperty statusProperty = cm.vars.get(5); + Assert.assertEquals(statusProperty.name, "Status"); + Assert.assertTrue(statusProperty.isEnum); + Assert.assertEquals(statusProperty.datatypeWithEnum, "StatusEnumName"); + + Assert.assertEquals(codegen.toEnumVarName("Aaaa", ""), "AaaaEnumValue"); + } + @Test(description = "use default suffixes for enums") public void useDefaultEnumSuffixes() { final AspNetCoreServerCodegen codegen = new AspNetCoreServerCodegen(); @@ -110,11 +129,11 @@ public void useDefaultEnumSuffixes() { Assert.assertEquals(codegen.toEnumVarName("Aaaa", ""), "AaaaEnum"); } - @Test(description = "use custom suffixes for enums") - public void useCustomEnumSuffixes() { + @Test(description = "support empty suffixes for enums") + public void useEmptyEnumSuffixes() { final AspNetCoreServerCodegen codegen = new AspNetCoreServerCodegen(); - codegen.setEnumNameSuffix("EnumName"); - codegen.setEnumValueNameSuffix("EnumValue"); + codegen.setEnumNameSuffix(""); + codegen.setEnumValueSuffix(""); OpenAPI openAPI = TestUtils.parseSpec("src/test/resources/3_0/petstore.yaml"); codegen.setOpenAPI(openAPI); @@ -124,8 +143,9 @@ public void useCustomEnumSuffixes() { final CodegenProperty statusProperty = cm.vars.get(5); Assert.assertEquals(statusProperty.name, "Status"); Assert.assertTrue(statusProperty.isEnum); - Assert.assertEquals(statusProperty.datatypeWithEnum, "StatusEnumName"); + Assert.assertEquals(statusProperty.datatypeWithEnum, "Status"); - Assert.assertEquals(codegen.toEnumVarName("Aaaa", ""), "AaaaEnumValue"); + Assert.assertEquals(codegen.toEnumVarName("Aaaa", ""), "Aaaa"); } + } diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION index c3a2c7076fa8..58592f031f65 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/README.md b/samples/client/petstore/csharp/OpenAPIClientNet35/README.md index 7bd9201f88b7..5f55053b6f59 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/README.md @@ -159,6 +159,8 @@ Class | Method | HTTP request | Description - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Model.ArrayTest](docs/ArrayTest.md) + - [Model.BigCat](docs/BigCat.md) + - [Model.BigCatAllOf](docs/BigCatAllOf.md) - [Model.Capitalization](docs/Capitalization.md) - [Model.Cat](docs/Cat.md) - [Model.CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/BigCat.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/BigCat.md new file mode 100644 index 000000000000..6247107ab35f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/BigCat.md @@ -0,0 +1,14 @@ + +# Org.OpenAPITools.Model.BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | **bool** | | [optional] +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/BigCatAllOf.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/BigCatAllOf.md new file mode 100644 index 000000000000..864c2298e03c --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/BigCatAllOf.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs new file mode 100644 index 000000000000..4cbdb4b8a5e5 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs @@ -0,0 +1,79 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing BigCatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BigCatAllOfTests + { + // TODO uncomment below to declare an instance variable for BigCatAllOf + //private BigCatAllOf instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of BigCatAllOf + //instance = new BigCatAllOf(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of BigCatAllOf + /// + [Test] + public void BigCatAllOfInstanceTest() + { + // TODO uncomment below to test "IsInstanceOf" BigCatAllOf + //Assert.IsInstanceOf(typeof(BigCatAllOf), instance); + } + + + /// + /// Test the property 'Kind' + /// + [Test] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools.Test/Model/BigCatTests.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools.Test/Model/BigCatTests.cs new file mode 100644 index 000000000000..1d78ea9f1e6d --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools.Test/Model/BigCatTests.cs @@ -0,0 +1,79 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing BigCat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BigCatTests + { + // TODO uncomment below to declare an instance variable for BigCat + //private BigCat instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of BigCat + //instance = new BigCat(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of BigCat + /// + [Test] + public void BigCatInstanceTest() + { + // TODO uncomment below to test "IsInstanceOf" BigCat + //Assert.IsInstanceOf(typeof(BigCat), instance); + } + + + /// + /// Test the property 'Kind' + /// + [Test] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Animal.cs index 5068caf52d14..464ee255eb9a 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/Animal.cs @@ -32,6 +32,7 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(JsonSubtypes), "ClassName")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + [JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")] public partial class Animal : IEquatable { /// diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/BigCat.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/BigCat.cs new file mode 100644 index 000000000000..7d09fc34c5c9 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/BigCat.cs @@ -0,0 +1,153 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// BigCat + /// + [DataContract] + public partial class BigCat : Cat, IEquatable + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BigCat() { } + /// + /// Initializes a new instance of the class. + /// + /// kind. + public BigCat(KindEnum? kind = default(KindEnum?), string className = default(string), string color = "red", bool declawed = default(bool)) : base(declawed) + { + this.Kind = kind; + } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BigCat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as BigCat); + } + + /// + /// Returns true if BigCat instances are equal + /// + /// Instance of BigCat to be compared + /// Boolean + public bool Equals(BigCat input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Kind == input.Kind || + (this.Kind != null && + this.Kind.Equals(input.Kind)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Kind != null) + hashCode = hashCode * 59 + this.Kind.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/BigCatAllOf.cs b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/BigCatAllOf.cs new file mode 100644 index 000000000000..0438df1a7aff --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/src/Org.OpenAPITools/Model/BigCatAllOf.cs @@ -0,0 +1,147 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// BigCatAllOf + /// + [DataContract] + public partial class BigCatAllOf : IEquatable + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// kind. + public BigCatAllOf(KindEnum? kind = default(KindEnum?)) + { + this.Kind = kind; + } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BigCatAllOf {\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as BigCatAllOf); + } + + /// + /// Returns true if BigCatAllOf instances are equal + /// + /// Instance of BigCatAllOf to be compared + /// Boolean + public bool Equals(BigCatAllOf input) + { + if (input == null) + return false; + + return + ( + this.Kind == input.Kind || + (this.Kind != null && + this.Kind.Equals(input.Kind)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Kind != null) + hashCode = hashCode * 59 + this.Kind.GetHashCode(); + return hashCode; + } + } + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION index c3a2c7076fa8..58592f031f65 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/README.md b/samples/client/petstore/csharp/OpenAPIClientNet40/README.md index 7bd9201f88b7..5f55053b6f59 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/README.md @@ -159,6 +159,8 @@ Class | Method | HTTP request | Description - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Model.ArrayTest](docs/ArrayTest.md) + - [Model.BigCat](docs/BigCat.md) + - [Model.BigCatAllOf](docs/BigCatAllOf.md) - [Model.Capitalization](docs/Capitalization.md) - [Model.Cat](docs/Cat.md) - [Model.CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/BigCat.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/BigCat.md new file mode 100644 index 000000000000..6247107ab35f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/BigCat.md @@ -0,0 +1,14 @@ + +# Org.OpenAPITools.Model.BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | **bool** | | [optional] +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/BigCatAllOf.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/BigCatAllOf.md new file mode 100644 index 000000000000..864c2298e03c --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/BigCatAllOf.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs new file mode 100644 index 000000000000..4cbdb4b8a5e5 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs @@ -0,0 +1,79 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing BigCatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BigCatAllOfTests + { + // TODO uncomment below to declare an instance variable for BigCatAllOf + //private BigCatAllOf instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of BigCatAllOf + //instance = new BigCatAllOf(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of BigCatAllOf + /// + [Test] + public void BigCatAllOfInstanceTest() + { + // TODO uncomment below to test "IsInstanceOf" BigCatAllOf + //Assert.IsInstanceOf(typeof(BigCatAllOf), instance); + } + + + /// + /// Test the property 'Kind' + /// + [Test] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools.Test/Model/BigCatTests.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools.Test/Model/BigCatTests.cs new file mode 100644 index 000000000000..1d78ea9f1e6d --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools.Test/Model/BigCatTests.cs @@ -0,0 +1,79 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing BigCat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BigCatTests + { + // TODO uncomment below to declare an instance variable for BigCat + //private BigCat instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of BigCat + //instance = new BigCat(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of BigCat + /// + [Test] + public void BigCatInstanceTest() + { + // TODO uncomment below to test "IsInstanceOf" BigCat + //Assert.IsInstanceOf(typeof(BigCat), instance); + } + + + /// + /// Test the property 'Kind' + /// + [Test] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Animal.cs index d158ed573a6d..eb9b58f20753 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Animal.cs @@ -32,6 +32,7 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(JsonSubtypes), "ClassName")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + [JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")] public partial class Animal : IEquatable, IValidatableObject { /// diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/BigCat.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/BigCat.cs new file mode 100644 index 000000000000..ffdab926c34c --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/BigCat.cs @@ -0,0 +1,163 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// BigCat + /// + [DataContract] + public partial class BigCat : Cat, IEquatable, IValidatableObject + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BigCat() { } + /// + /// Initializes a new instance of the class. + /// + /// kind. + public BigCat(KindEnum? kind = default(KindEnum?), string className = default(string), string color = "red", bool declawed = default(bool)) : base(declawed) + { + this.Kind = kind; + } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BigCat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as BigCat); + } + + /// + /// Returns true if BigCat instances are equal + /// + /// Instance of BigCat to be compared + /// Boolean + public bool Equals(BigCat input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Kind == input.Kind || + (this.Kind != null && + this.Kind.Equals(input.Kind)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Kind != null) + hashCode = hashCode * 59 + this.Kind.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + foreach(var x in base.BaseValidate(validationContext)) yield return x; + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/BigCatAllOf.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/BigCatAllOf.cs new file mode 100644 index 000000000000..79871b557bab --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/BigCatAllOf.cs @@ -0,0 +1,156 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// BigCatAllOf + /// + [DataContract] + public partial class BigCatAllOf : IEquatable, IValidatableObject + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// kind. + public BigCatAllOf(KindEnum? kind = default(KindEnum?)) + { + this.Kind = kind; + } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BigCatAllOf {\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as BigCatAllOf); + } + + /// + /// Returns true if BigCatAllOf instances are equal + /// + /// Instance of BigCatAllOf to be compared + /// Boolean + public bool Equals(BigCatAllOf input) + { + if (input == null) + return false; + + return + ( + this.Kind == input.Kind || + (this.Kind != null && + this.Kind.Equals(input.Kind)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Kind != null) + hashCode = hashCode * 59 + this.Kind.GetHashCode(); + return hashCode; + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Cat.cs index 1c28fb2755f7..42674c5ffce8 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/src/Org.OpenAPITools/Model/Cat.cs @@ -122,6 +122,16 @@ public override int GetHashCode() /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach(var x in base.BaseValidate(validationContext)) yield return x; yield break; diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION index c3a2c7076fa8..58592f031f65 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/README.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/README.md index a5bb974627f4..87280d665a0b 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/README.md @@ -135,6 +135,8 @@ Class | Method | HTTP request | Description - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Model.ArrayTest](docs/ArrayTest.md) + - [Model.BigCat](docs/BigCat.md) + - [Model.BigCatAllOf](docs/BigCatAllOf.md) - [Model.Capitalization](docs/Capitalization.md) - [Model.Cat](docs/Cat.md) - [Model.CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/BigCat.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/BigCat.md new file mode 100644 index 000000000000..6247107ab35f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/BigCat.md @@ -0,0 +1,14 @@ + +# Org.OpenAPITools.Model.BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | **bool** | | [optional] +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/BigCatAllOf.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/BigCatAllOf.md new file mode 100644 index 000000000000..864c2298e03c --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/BigCatAllOf.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Animal.cs index 7f63524790a4..1f209ecbc1c4 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/Animal.cs @@ -30,6 +30,7 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(JsonSubtypes), "ClassName")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + [JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")] public partial class Animal : IEquatable { /// diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/BigCat.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/BigCat.cs new file mode 100644 index 000000000000..0b09a9d1a3bd --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/BigCat.cs @@ -0,0 +1,150 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// BigCat + /// + [DataContract] + public partial class BigCat : Cat, IEquatable + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BigCat() { } + /// + /// Initializes a new instance of the class. + /// + /// kind. + public BigCat(KindEnum? kind = default(KindEnum?), string className = default(string), string color = "red", bool declawed = default(bool)) : base(declawed) + { + this.Kind = kind; + } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BigCat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as BigCat); + } + + /// + /// Returns true if BigCat instances are equal + /// + /// Instance of BigCat to be compared + /// Boolean + public bool Equals(BigCat input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Kind == input.Kind || + (this.Kind != null && + this.Kind.Equals(input.Kind)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Kind != null) + hashCode = hashCode * 59 + this.Kind.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/BigCatAllOf.cs b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/BigCatAllOf.cs new file mode 100644 index 000000000000..f0b9775277ee --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Model/BigCatAllOf.cs @@ -0,0 +1,144 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// BigCatAllOf + /// + [DataContract] + public partial class BigCatAllOf : IEquatable + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=false)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// kind. + public BigCatAllOf(KindEnum? kind = default(KindEnum?)) + { + this.Kind = kind; + } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BigCatAllOf {\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as BigCatAllOf); + } + + /// + /// Returns true if BigCatAllOf instances are equal + /// + /// Instance of BigCatAllOf to be compared + /// Boolean + public bool Equals(BigCatAllOf input) + { + if (input == null) + return false; + + return + ( + this.Kind == input.Kind || + (this.Kind != null && + this.Kind.Equals(input.Kind)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Kind != null) + hashCode = hashCode * 59 + this.Kind.GetHashCode(); + return hashCode; + } + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION index c3a2c7076fa8..58592f031f65 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/README.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/README.md index 7bd9201f88b7..5f55053b6f59 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/README.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/README.md @@ -159,6 +159,8 @@ Class | Method | HTTP request | Description - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Model.ArrayTest](docs/ArrayTest.md) + - [Model.BigCat](docs/BigCat.md) + - [Model.BigCatAllOf](docs/BigCatAllOf.md) - [Model.Capitalization](docs/Capitalization.md) - [Model.Cat](docs/Cat.md) - [Model.CatAllOf](docs/CatAllOf.md) diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/BigCat.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/BigCat.md new file mode 100644 index 000000000000..6247107ab35f --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/BigCat.md @@ -0,0 +1,14 @@ + +# Org.OpenAPITools.Model.BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | **bool** | | [optional] +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/BigCatAllOf.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/BigCatAllOf.md new file mode 100644 index 000000000000..864c2298e03c --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/BigCatAllOf.md @@ -0,0 +1,13 @@ + +# Org.OpenAPITools.Model.BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Kind** | **string** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to README]](../README.md) + diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs new file mode 100644 index 000000000000..4cbdb4b8a5e5 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools.Test/Model/BigCatAllOfTests.cs @@ -0,0 +1,79 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing BigCatAllOf + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BigCatAllOfTests + { + // TODO uncomment below to declare an instance variable for BigCatAllOf + //private BigCatAllOf instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of BigCatAllOf + //instance = new BigCatAllOf(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of BigCatAllOf + /// + [Test] + public void BigCatAllOfInstanceTest() + { + // TODO uncomment below to test "IsInstanceOf" BigCatAllOf + //Assert.IsInstanceOf(typeof(BigCatAllOf), instance); + } + + + /// + /// Test the property 'Kind' + /// + [Test] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools.Test/Model/BigCatTests.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools.Test/Model/BigCatTests.cs new file mode 100644 index 000000000000..1d78ea9f1e6d --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools.Test/Model/BigCatTests.cs @@ -0,0 +1,79 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; +using Org.OpenAPITools.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Org.OpenAPITools.Test +{ + /// + /// Class for testing BigCat + /// + /// + /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). + /// Please update the test case below to test the model. + /// + public class BigCatTests + { + // TODO uncomment below to declare an instance variable for BigCat + //private BigCat instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of BigCat + //instance = new BigCat(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of BigCat + /// + [Test] + public void BigCatInstanceTest() + { + // TODO uncomment below to test "IsInstanceOf" BigCat + //Assert.IsInstanceOf(typeof(BigCat), instance); + } + + + /// + /// Test the property 'Kind' + /// + [Test] + public void KindTest() + { + // TODO unit test for the property 'Kind' + } + + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Animal.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Animal.cs index f89e68c527b8..2180878c9cd3 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Animal.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Animal.cs @@ -34,6 +34,7 @@ namespace Org.OpenAPITools.Model [JsonConverter(typeof(JsonSubtypes), "ClassName")] [JsonSubtypes.KnownSubType(typeof(Dog), "Dog")] [JsonSubtypes.KnownSubType(typeof(Cat), "Cat")] + [JsonSubtypes.KnownSubType(typeof(BigCat), "BigCat")] [ImplementPropertyChanged] public partial class Animal : IEquatable, IValidatableObject { diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/BigCat.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/BigCat.cs new file mode 100644 index 000000000000..af701bbc6f79 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/BigCat.cs @@ -0,0 +1,186 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using PropertyChanged; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// BigCat + /// + [DataContract] + [ImplementPropertyChanged] + public partial class BigCat : Cat, IEquatable, IValidatableObject + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=true)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected BigCat() { } + /// + /// Initializes a new instance of the class. + /// + /// kind. + public BigCat(KindEnum? kind = default(KindEnum?), string className = default(string), string color = "red", bool declawed = default(bool)) : base(declawed) + { + this.Kind = kind; + } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BigCat {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as BigCat); + } + + /// + /// Returns true if BigCat instances are equal + /// + /// Instance of BigCat to be compared + /// Boolean + public bool Equals(BigCat input) + { + if (input == null) + return false; + + return base.Equals(input) && + ( + this.Kind == input.Kind || + (this.Kind != null && + this.Kind.Equals(input.Kind)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = base.GetHashCode(); + if (this.Kind != null) + hashCode = hashCode * 59 + this.Kind.GetHashCode(); + return hashCode; + } + } + + /// + /// Property changed event handler + /// + public event PropertyChangedEventHandler PropertyChanged; + + /// + /// Trigger when a property changed + /// + /// Property Name + public virtual void OnPropertyChanged(string propertyName) + { + // NOTE: property changed is handled via "code weaving" using Fody. + // Properties with setters are modified at compile time to notify of changes. + var propertyChanged = PropertyChanged; + if (propertyChanged != null) + { + propertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + foreach(var x in base.BaseValidate(validationContext)) yield return x; + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/BigCatAllOf.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/BigCatAllOf.cs new file mode 100644 index 000000000000..f99b5acebac2 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/BigCatAllOf.cs @@ -0,0 +1,179 @@ +/* + * OpenAPI Petstore + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using PropertyChanged; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; + +namespace Org.OpenAPITools.Model +{ + /// + /// BigCatAllOf + /// + [DataContract] + [ImplementPropertyChanged] + public partial class BigCatAllOf : IEquatable, IValidatableObject + { + /// + /// Defines Kind + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum KindEnum + { + /// + /// Enum Lions for value: lions + /// + [EnumMember(Value = "lions")] + Lions = 1, + + /// + /// Enum Tigers for value: tigers + /// + [EnumMember(Value = "tigers")] + Tigers = 2, + + /// + /// Enum Leopards for value: leopards + /// + [EnumMember(Value = "leopards")] + Leopards = 3, + + /// + /// Enum Jaguars for value: jaguars + /// + [EnumMember(Value = "jaguars")] + Jaguars = 4 + + } + + /// + /// Gets or Sets Kind + /// + [DataMember(Name="kind", EmitDefaultValue=true)] + public KindEnum? Kind { get; set; } + /// + /// Initializes a new instance of the class. + /// + /// kind. + public BigCatAllOf(KindEnum? kind = default(KindEnum?)) + { + this.Kind = kind; + } + + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class BigCatAllOf {\n"); + sb.Append(" Kind: ").Append(Kind).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return JsonConvert.SerializeObject(this, Formatting.Indented); + } + + /// + /// Returns true if objects are equal + /// + /// Object to be compared + /// Boolean + public override bool Equals(object input) + { + return this.Equals(input as BigCatAllOf); + } + + /// + /// Returns true if BigCatAllOf instances are equal + /// + /// Instance of BigCatAllOf to be compared + /// Boolean + public bool Equals(BigCatAllOf input) + { + if (input == null) + return false; + + return + ( + this.Kind == input.Kind || + (this.Kind != null && + this.Kind.Equals(input.Kind)) + ); + } + + /// + /// Gets the hash code + /// + /// Hash code + public override int GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + int hashCode = 41; + if (this.Kind != null) + hashCode = hashCode * 59 + this.Kind.GetHashCode(); + return hashCode; + } + } + + /// + /// Property changed event handler + /// + public event PropertyChangedEventHandler PropertyChanged; + + /// + /// Trigger when a property changed + /// + /// Property Name + public virtual void OnPropertyChanged(string propertyName) + { + // NOTE: property changed is handled via "code weaving" using Fody. + // Properties with setters are modified at compile time to notify of changes. + var propertyChanged = PropertyChanged; + if (propertyChanged != null) + { + propertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Cat.cs b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Cat.cs index 0a3fe2a67f33..364ef5df0d8f 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Cat.cs +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/src/Org.OpenAPITools/Model/Cat.cs @@ -145,6 +145,16 @@ public virtual void OnPropertyChanged(string propertyName) /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) { foreach(var x in base.BaseValidate(validationContext)) yield return x; yield break; diff --git a/samples/client/petstore/dart2/openapi/README.md b/samples/client/petstore/dart2/openapi/README.md index a32c667b4ee4..1cf4ca28f0a8 100644 --- a/samples/client/petstore/dart2/openapi/README.md +++ b/samples/client/petstore/dart2/openapi/README.md @@ -59,36 +59,36 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](docs//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*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* | [**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* | [**getInventory**](docs//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*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 -*UserApi* | [**createUsersWithArrayInput**](docs//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](docs//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](docs//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user +*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user ## Documentation For Models - - [ApiResponse](docs//ApiResponse.md) - - [Category](docs//Category.md) - - [Order](docs//Order.md) - - [Pet](docs//Pet.md) - - [Tag](docs//Tag.md) - - [User](docs//User.md) + - [ApiResponse](doc//ApiResponse.md) + - [Category](doc//Category.md) + - [Order](doc//Order.md) + - [Pet](doc//Pet.md) + - [Tag](doc//Tag.md) + - [User](doc//User.md) ## Documentation For Authorization diff --git a/samples/client/petstore/dart2/openapi/pubspec.yaml b/samples/client/petstore/dart2/openapi/pubspec.yaml index be7bf663b8fd..58c44ac9eb57 100644 --- a/samples/client/petstore/dart2/openapi/pubspec.yaml +++ b/samples/client/petstore/dart2/openapi/pubspec.yaml @@ -1,6 +1,9 @@ name: openapi version: 1.0.0 description: OpenAPI API client +authors: + - Author +homepage: homepage environment: sdk: '>=2.0.0 <3.0.0' dependencies: diff --git a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION index 0e97bd19efbf..58592f031f65 100644 --- a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.3-SNAPSHOT \ No newline at end of file +4.2.3-SNAPSHOT \ No newline at end of file