diff --git a/.github/workflows/samples-dotnet.yaml b/.github/workflows/samples-dotnet.yaml
index c345dad2829..ea2d5b6d2cc 100644
--- a/.github/workflows/samples-dotnet.yaml
+++ b/.github/workflows/samples-dotnet.yaml
@@ -7,12 +7,14 @@ on:
- 'samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore**/'
- 'samples/server/petstore/aspnetcore-6.0/**'
- 'samples/server/petstore/aspnetcore-6.0-pocoModels/**'
+ - 'samples/server/petstore/aspnetcore-6.0-useSwashBuckle/**'
pull_request:
paths:
- 'samples/client/petstore/csharp-netcore/**net6.0**/'
- 'samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netcore**/'
- 'samples/server/petstore/aspnetcore-6.0/**'
- 'samples/server/petstore/aspnetcore-6.0-pocoModels/**'
+ - 'samples/server/petstore/aspnetcore-6.0-useSwashBuckle/**'
jobs:
build:
name: Build .Net projects
@@ -30,6 +32,7 @@ jobs:
- samples/server/petstore/aspnetcore-6.0
- samples/server/petstore/aspnetcore-6.0-pocoModels
- samples/server/petstore/aspnetcore-6.0-project4Models
+ - samples/server/petstore/aspnetcore-6.0-useSwashBuckle
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3.0.3
diff --git a/bin/configs/aspnetcore-6.0-useSwashBuckle.yaml b/bin/configs/aspnetcore-6.0-useSwashBuckle.yaml
new file mode 100644
index 00000000000..e0e873e8ec4
--- /dev/null
+++ b/bin/configs/aspnetcore-6.0-useSwashBuckle.yaml
@@ -0,0 +1,11 @@
+generatorName: aspnetcore
+outputDir: samples/server/petstore/aspnetcore-6.0-useSwashBuckle
+inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml
+templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0
+additionalProperties:
+ packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
+ aspnetCoreVersion: "6.0"
+ userSecretsGuid: 'cb87e868-8646-48ef-9bb6-344b537d0d37'
+ useSwashBuckle: false
+ buildTarget: library
+ isLibrary: true
diff --git a/modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml b/modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml
index c0ca877d6f9..1ba98052485 100644
--- a/modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml
+++ b/modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml
@@ -752,3 +752,32 @@ components:
type: string
message:
type: string
+ Dog:
+ allOf:
+ - $ref: '#/components/schemas/Animal'
+ - type: object
+ properties:
+ breed:
+ type: string
+ Cat:
+ allOf:
+ - $ref: '#/components/schemas/Animal'
+ - type: object
+ properties:
+ declawed:
+ type: boolean
+ Animal:
+ type: object
+ discriminator:
+ propertyName: className
+ mapping:
+ DOG: '#/components/schemas/Dog'
+ CAT: '#/components/schemas/Cat'
+ required:
+ - className
+ properties:
+ className:
+ type: string
+ color:
+ type: string
+ default: red
diff --git a/samples/server/petstore/aspnetcore-3.0/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-3.0/.openapi-generator/FILES
index 8dc5fd25605..f36d2528d09 100644
--- a/samples/server/petstore/aspnetcore-3.0/.openapi-generator/FILES
+++ b/samples/server/petstore/aspnetcore-3.0/.openapi-generator/FILES
@@ -14,8 +14,13 @@ src/Org.OpenAPITools/Dockerfile
src/Org.OpenAPITools/Filters/BasePathFilter.cs
src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs
src/Org.OpenAPITools/Formatters/InputFormatterStream.cs
+src/Org.OpenAPITools/Models/Animal.cs
src/Org.OpenAPITools/Models/ApiResponse.cs
+src/Org.OpenAPITools/Models/Cat.cs
+src/Org.OpenAPITools/Models/CatAllOf.cs
src/Org.OpenAPITools/Models/Category.cs
+src/Org.OpenAPITools/Models/Dog.cs
+src/Org.OpenAPITools/Models/DogAllOf.cs
src/Org.OpenAPITools/Models/Order.cs
src/Org.OpenAPITools/Models/Pet.cs
src/Org.OpenAPITools/Models/Tag.cs
diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Animal.cs
new file mode 100644
index 00000000000..01f525396dc
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Animal.cs
@@ -0,0 +1,142 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using JsonSubTypes;
+using Swashbuckle.AspNetCore.Annotations;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ [JsonConverter(typeof(JsonSubtypes), "ClassName")]
+ [SwaggerDiscriminator("ClassName")]
+ [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")]
+ [SwaggerSubType(typeof(Cat), DiscriminatorValue = "CAT")]
+ [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")]
+ [SwaggerSubType(typeof(Dog), DiscriminatorValue = "DOG")]
+ public partial class Animal : IEquatable
+ {
+ ///
+ /// Gets or Sets ClassName
+ ///
+ [Required]
+ [DataMember(Name="className", EmitDefaultValue=false)]
+ public string ClassName { get; set; }
+
+ ///
+ /// Gets or Sets Color
+ ///
+ [DataMember(Name="color", EmitDefaultValue=false)]
+ public string Color { get; set; } = "red";
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Animal {\n");
+ sb.Append(" ClassName: ").Append(ClassName).Append("\n");
+ sb.Append(" Color: ").Append(Color).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Animal)obj);
+ }
+
+ ///
+ /// Returns true if Animal instances are equal
+ ///
+ /// Instance of Animal to be compared
+ /// Boolean
+ public bool Equals(Animal other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ ClassName == other.ClassName ||
+ ClassName != null &&
+ ClassName.Equals(other.ClassName)
+ ) &&
+ (
+ Color == other.Color ||
+ Color != null &&
+ Color.Equals(other.Color)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+ if (ClassName != null)
+ hashCode = hashCode * 59 + ClassName.GetHashCode();
+ if (Color != null)
+ hashCode = hashCode * 59 + Color.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Animal left, Animal right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Animal left, Animal right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Cat.cs
new file mode 100644
index 00000000000..9bb95fe5a4e
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Cat.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class Cat : Animal, IEquatable
+ {
+ ///
+ /// Gets or Sets Declawed
+ ///
+ [DataMember(Name="declawed", EmitDefaultValue=true)]
+ public bool Declawed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Cat {\n");
+ sb.Append(" Declawed: ").Append(Declawed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public new string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Cat)obj);
+ }
+
+ ///
+ /// Returns true if Cat instances are equal
+ ///
+ /// Instance of Cat to be compared
+ /// Boolean
+ public bool Equals(Cat other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Declawed == other.Declawed ||
+
+ Declawed.Equals(other.Declawed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+
+ hashCode = hashCode * 59 + Declawed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Cat left, Cat right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Cat left, Cat right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/CatAllOf.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/CatAllOf.cs
new file mode 100644
index 00000000000..ca2b213b0cf
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/CatAllOf.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class CatAllOf : IEquatable
+ {
+ ///
+ /// Gets or Sets Declawed
+ ///
+ [DataMember(Name="declawed", EmitDefaultValue=true)]
+ public bool Declawed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class CatAllOf {\n");
+ sb.Append(" Declawed: ").Append(Declawed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((CatAllOf)obj);
+ }
+
+ ///
+ /// Returns true if CatAllOf instances are equal
+ ///
+ /// Instance of CatAllOf to be compared
+ /// Boolean
+ public bool Equals(CatAllOf other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Declawed == other.Declawed ||
+
+ Declawed.Equals(other.Declawed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+
+ hashCode = hashCode * 59 + Declawed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(CatAllOf left, CatAllOf right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(CatAllOf left, CatAllOf right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Dog.cs
new file mode 100644
index 00000000000..ff3a582cc13
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/Dog.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class Dog : Animal, IEquatable
+ {
+ ///
+ /// Gets or Sets Breed
+ ///
+ [DataMember(Name="breed", EmitDefaultValue=false)]
+ public string Breed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Dog {\n");
+ sb.Append(" Breed: ").Append(Breed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public new string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Dog)obj);
+ }
+
+ ///
+ /// Returns true if Dog instances are equal
+ ///
+ /// Instance of Dog to be compared
+ /// Boolean
+ public bool Equals(Dog other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Breed == other.Breed ||
+ Breed != null &&
+ Breed.Equals(other.Breed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+ if (Breed != null)
+ hashCode = hashCode * 59 + Breed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Dog left, Dog right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Dog left, Dog right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/DogAllOf.cs b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/DogAllOf.cs
new file mode 100644
index 00000000000..6be8ff2fe4e
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/Models/DogAllOf.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class DogAllOf : IEquatable
+ {
+ ///
+ /// Gets or Sets Breed
+ ///
+ [DataMember(Name="breed", EmitDefaultValue=false)]
+ public string Breed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class DogAllOf {\n");
+ sb.Append(" Breed: ").Append(Breed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((DogAllOf)obj);
+ }
+
+ ///
+ /// Returns true if DogAllOf instances are equal
+ ///
+ /// Instance of DogAllOf to be compared
+ /// Boolean
+ public bool Equals(DogAllOf other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Breed == other.Breed ||
+ Breed != null &&
+ Breed.Equals(other.Breed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+ if (Breed != null)
+ hashCode = hashCode * 59 + Breed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(DogAllOf left, DogAllOf right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(DogAllOf left, DogAllOf right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/wwwroot/openapi-original.json
index 0ccbb4c793c..53d1a8e9b10 100644
--- a/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/wwwroot/openapi-original.json
+++ b/samples/server/petstore/aspnetcore-3.0/src/Org.OpenAPITools/wwwroot/openapi-original.json
@@ -1048,6 +1048,40 @@
"title" : "An uploaded response",
"type" : "object"
},
+ "Dog" : {
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/Animal"
+ }, {
+ "$ref" : "#/components/schemas/Dog_allOf"
+ } ]
+ },
+ "Cat" : {
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/Animal"
+ }, {
+ "$ref" : "#/components/schemas/Cat_allOf"
+ } ]
+ },
+ "Animal" : {
+ "discriminator" : {
+ "mapping" : {
+ "DOG" : "#/components/schemas/Dog",
+ "CAT" : "#/components/schemas/Cat"
+ },
+ "propertyName" : "className"
+ },
+ "properties" : {
+ "className" : {
+ "type" : "string"
+ },
+ "color" : {
+ "default" : "red",
+ "type" : "string"
+ }
+ },
+ "required" : [ "className" ],
+ "type" : "object"
+ },
"updatePetWithForm_request" : {
"properties" : {
"name" : {
@@ -1074,6 +1108,24 @@
}
},
"type" : "object"
+ },
+ "Dog_allOf" : {
+ "properties" : {
+ "breed" : {
+ "type" : "string"
+ }
+ },
+ "type" : "object",
+ "example" : null
+ },
+ "Cat_allOf" : {
+ "properties" : {
+ "declawed" : {
+ "type" : "boolean"
+ }
+ },
+ "type" : "object",
+ "example" : null
}
},
"securitySchemes" : {
diff --git a/samples/server/petstore/aspnetcore-3.1/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-3.1/.openapi-generator/FILES
index 8dc5fd25605..f36d2528d09 100644
--- a/samples/server/petstore/aspnetcore-3.1/.openapi-generator/FILES
+++ b/samples/server/petstore/aspnetcore-3.1/.openapi-generator/FILES
@@ -14,8 +14,13 @@ src/Org.OpenAPITools/Dockerfile
src/Org.OpenAPITools/Filters/BasePathFilter.cs
src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs
src/Org.OpenAPITools/Formatters/InputFormatterStream.cs
+src/Org.OpenAPITools/Models/Animal.cs
src/Org.OpenAPITools/Models/ApiResponse.cs
+src/Org.OpenAPITools/Models/Cat.cs
+src/Org.OpenAPITools/Models/CatAllOf.cs
src/Org.OpenAPITools/Models/Category.cs
+src/Org.OpenAPITools/Models/Dog.cs
+src/Org.OpenAPITools/Models/DogAllOf.cs
src/Org.OpenAPITools/Models/Order.cs
src/Org.OpenAPITools/Models/Pet.cs
src/Org.OpenAPITools/Models/Tag.cs
diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Animal.cs
new file mode 100644
index 00000000000..01f525396dc
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Animal.cs
@@ -0,0 +1,142 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using JsonSubTypes;
+using Swashbuckle.AspNetCore.Annotations;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ [JsonConverter(typeof(JsonSubtypes), "ClassName")]
+ [SwaggerDiscriminator("ClassName")]
+ [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")]
+ [SwaggerSubType(typeof(Cat), DiscriminatorValue = "CAT")]
+ [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")]
+ [SwaggerSubType(typeof(Dog), DiscriminatorValue = "DOG")]
+ public partial class Animal : IEquatable
+ {
+ ///
+ /// Gets or Sets ClassName
+ ///
+ [Required]
+ [DataMember(Name="className", EmitDefaultValue=false)]
+ public string ClassName { get; set; }
+
+ ///
+ /// Gets or Sets Color
+ ///
+ [DataMember(Name="color", EmitDefaultValue=false)]
+ public string Color { get; set; } = "red";
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Animal {\n");
+ sb.Append(" ClassName: ").Append(ClassName).Append("\n");
+ sb.Append(" Color: ").Append(Color).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Animal)obj);
+ }
+
+ ///
+ /// Returns true if Animal instances are equal
+ ///
+ /// Instance of Animal to be compared
+ /// Boolean
+ public bool Equals(Animal other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ ClassName == other.ClassName ||
+ ClassName != null &&
+ ClassName.Equals(other.ClassName)
+ ) &&
+ (
+ Color == other.Color ||
+ Color != null &&
+ Color.Equals(other.Color)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+ if (ClassName != null)
+ hashCode = hashCode * 59 + ClassName.GetHashCode();
+ if (Color != null)
+ hashCode = hashCode * 59 + Color.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Animal left, Animal right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Animal left, Animal right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Cat.cs
new file mode 100644
index 00000000000..9bb95fe5a4e
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Cat.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class Cat : Animal, IEquatable
+ {
+ ///
+ /// Gets or Sets Declawed
+ ///
+ [DataMember(Name="declawed", EmitDefaultValue=true)]
+ public bool Declawed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Cat {\n");
+ sb.Append(" Declawed: ").Append(Declawed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public new string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Cat)obj);
+ }
+
+ ///
+ /// Returns true if Cat instances are equal
+ ///
+ /// Instance of Cat to be compared
+ /// Boolean
+ public bool Equals(Cat other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Declawed == other.Declawed ||
+
+ Declawed.Equals(other.Declawed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+
+ hashCode = hashCode * 59 + Declawed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Cat left, Cat right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Cat left, Cat right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/CatAllOf.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/CatAllOf.cs
new file mode 100644
index 00000000000..ca2b213b0cf
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/CatAllOf.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class CatAllOf : IEquatable
+ {
+ ///
+ /// Gets or Sets Declawed
+ ///
+ [DataMember(Name="declawed", EmitDefaultValue=true)]
+ public bool Declawed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class CatAllOf {\n");
+ sb.Append(" Declawed: ").Append(Declawed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((CatAllOf)obj);
+ }
+
+ ///
+ /// Returns true if CatAllOf instances are equal
+ ///
+ /// Instance of CatAllOf to be compared
+ /// Boolean
+ public bool Equals(CatAllOf other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Declawed == other.Declawed ||
+
+ Declawed.Equals(other.Declawed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+
+ hashCode = hashCode * 59 + Declawed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(CatAllOf left, CatAllOf right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(CatAllOf left, CatAllOf right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Dog.cs
new file mode 100644
index 00000000000..ff3a582cc13
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/Dog.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class Dog : Animal, IEquatable
+ {
+ ///
+ /// Gets or Sets Breed
+ ///
+ [DataMember(Name="breed", EmitDefaultValue=false)]
+ public string Breed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Dog {\n");
+ sb.Append(" Breed: ").Append(Breed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public new string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Dog)obj);
+ }
+
+ ///
+ /// Returns true if Dog instances are equal
+ ///
+ /// Instance of Dog to be compared
+ /// Boolean
+ public bool Equals(Dog other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Breed == other.Breed ||
+ Breed != null &&
+ Breed.Equals(other.Breed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+ if (Breed != null)
+ hashCode = hashCode * 59 + Breed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Dog left, Dog right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Dog left, Dog right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/DogAllOf.cs b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/DogAllOf.cs
new file mode 100644
index 00000000000..6be8ff2fe4e
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/Models/DogAllOf.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class DogAllOf : IEquatable
+ {
+ ///
+ /// Gets or Sets Breed
+ ///
+ [DataMember(Name="breed", EmitDefaultValue=false)]
+ public string Breed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class DogAllOf {\n");
+ sb.Append(" Breed: ").Append(Breed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((DogAllOf)obj);
+ }
+
+ ///
+ /// Returns true if DogAllOf instances are equal
+ ///
+ /// Instance of DogAllOf to be compared
+ /// Boolean
+ public bool Equals(DogAllOf other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Breed == other.Breed ||
+ Breed != null &&
+ Breed.Equals(other.Breed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+ if (Breed != null)
+ hashCode = hashCode * 59 + Breed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(DogAllOf left, DogAllOf right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(DogAllOf left, DogAllOf right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/wwwroot/openapi-original.json
index 0ccbb4c793c..53d1a8e9b10 100644
--- a/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/wwwroot/openapi-original.json
+++ b/samples/server/petstore/aspnetcore-3.1/src/Org.OpenAPITools/wwwroot/openapi-original.json
@@ -1048,6 +1048,40 @@
"title" : "An uploaded response",
"type" : "object"
},
+ "Dog" : {
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/Animal"
+ }, {
+ "$ref" : "#/components/schemas/Dog_allOf"
+ } ]
+ },
+ "Cat" : {
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/Animal"
+ }, {
+ "$ref" : "#/components/schemas/Cat_allOf"
+ } ]
+ },
+ "Animal" : {
+ "discriminator" : {
+ "mapping" : {
+ "DOG" : "#/components/schemas/Dog",
+ "CAT" : "#/components/schemas/Cat"
+ },
+ "propertyName" : "className"
+ },
+ "properties" : {
+ "className" : {
+ "type" : "string"
+ },
+ "color" : {
+ "default" : "red",
+ "type" : "string"
+ }
+ },
+ "required" : [ "className" ],
+ "type" : "object"
+ },
"updatePetWithForm_request" : {
"properties" : {
"name" : {
@@ -1074,6 +1108,24 @@
}
},
"type" : "object"
+ },
+ "Dog_allOf" : {
+ "properties" : {
+ "breed" : {
+ "type" : "string"
+ }
+ },
+ "type" : "object",
+ "example" : null
+ },
+ "Cat_allOf" : {
+ "properties" : {
+ "declawed" : {
+ "type" : "boolean"
+ }
+ },
+ "type" : "object",
+ "example" : null
}
},
"securitySchemes" : {
diff --git a/samples/server/petstore/aspnetcore-5.0/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-5.0/.openapi-generator/FILES
index 8dc5fd25605..f36d2528d09 100644
--- a/samples/server/petstore/aspnetcore-5.0/.openapi-generator/FILES
+++ b/samples/server/petstore/aspnetcore-5.0/.openapi-generator/FILES
@@ -14,8 +14,13 @@ src/Org.OpenAPITools/Dockerfile
src/Org.OpenAPITools/Filters/BasePathFilter.cs
src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs
src/Org.OpenAPITools/Formatters/InputFormatterStream.cs
+src/Org.OpenAPITools/Models/Animal.cs
src/Org.OpenAPITools/Models/ApiResponse.cs
+src/Org.OpenAPITools/Models/Cat.cs
+src/Org.OpenAPITools/Models/CatAllOf.cs
src/Org.OpenAPITools/Models/Category.cs
+src/Org.OpenAPITools/Models/Dog.cs
+src/Org.OpenAPITools/Models/DogAllOf.cs
src/Org.OpenAPITools/Models/Order.cs
src/Org.OpenAPITools/Models/Pet.cs
src/Org.OpenAPITools/Models/Tag.cs
diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Animal.cs
new file mode 100644
index 00000000000..01f525396dc
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Animal.cs
@@ -0,0 +1,142 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using JsonSubTypes;
+using Swashbuckle.AspNetCore.Annotations;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ [JsonConverter(typeof(JsonSubtypes), "ClassName")]
+ [SwaggerDiscriminator("ClassName")]
+ [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")]
+ [SwaggerSubType(typeof(Cat), DiscriminatorValue = "CAT")]
+ [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")]
+ [SwaggerSubType(typeof(Dog), DiscriminatorValue = "DOG")]
+ public partial class Animal : IEquatable
+ {
+ ///
+ /// Gets or Sets ClassName
+ ///
+ [Required]
+ [DataMember(Name="className", EmitDefaultValue=false)]
+ public string ClassName { get; set; }
+
+ ///
+ /// Gets or Sets Color
+ ///
+ [DataMember(Name="color", EmitDefaultValue=false)]
+ public string Color { get; set; } = "red";
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Animal {\n");
+ sb.Append(" ClassName: ").Append(ClassName).Append("\n");
+ sb.Append(" Color: ").Append(Color).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Animal)obj);
+ }
+
+ ///
+ /// Returns true if Animal instances are equal
+ ///
+ /// Instance of Animal to be compared
+ /// Boolean
+ public bool Equals(Animal other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ ClassName == other.ClassName ||
+ ClassName != null &&
+ ClassName.Equals(other.ClassName)
+ ) &&
+ (
+ Color == other.Color ||
+ Color != null &&
+ Color.Equals(other.Color)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+ if (ClassName != null)
+ hashCode = hashCode * 59 + ClassName.GetHashCode();
+ if (Color != null)
+ hashCode = hashCode * 59 + Color.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Animal left, Animal right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Animal left, Animal right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Cat.cs
new file mode 100644
index 00000000000..9bb95fe5a4e
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Cat.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class Cat : Animal, IEquatable
+ {
+ ///
+ /// Gets or Sets Declawed
+ ///
+ [DataMember(Name="declawed", EmitDefaultValue=true)]
+ public bool Declawed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Cat {\n");
+ sb.Append(" Declawed: ").Append(Declawed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public new string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Cat)obj);
+ }
+
+ ///
+ /// Returns true if Cat instances are equal
+ ///
+ /// Instance of Cat to be compared
+ /// Boolean
+ public bool Equals(Cat other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Declawed == other.Declawed ||
+
+ Declawed.Equals(other.Declawed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+
+ hashCode = hashCode * 59 + Declawed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Cat left, Cat right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Cat left, Cat right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/CatAllOf.cs b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/CatAllOf.cs
new file mode 100644
index 00000000000..ca2b213b0cf
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/CatAllOf.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class CatAllOf : IEquatable
+ {
+ ///
+ /// Gets or Sets Declawed
+ ///
+ [DataMember(Name="declawed", EmitDefaultValue=true)]
+ public bool Declawed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class CatAllOf {\n");
+ sb.Append(" Declawed: ").Append(Declawed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((CatAllOf)obj);
+ }
+
+ ///
+ /// Returns true if CatAllOf instances are equal
+ ///
+ /// Instance of CatAllOf to be compared
+ /// Boolean
+ public bool Equals(CatAllOf other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Declawed == other.Declawed ||
+
+ Declawed.Equals(other.Declawed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+
+ hashCode = hashCode * 59 + Declawed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(CatAllOf left, CatAllOf right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(CatAllOf left, CatAllOf right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Dog.cs
new file mode 100644
index 00000000000..ff3a582cc13
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/Dog.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class Dog : Animal, IEquatable
+ {
+ ///
+ /// Gets or Sets Breed
+ ///
+ [DataMember(Name="breed", EmitDefaultValue=false)]
+ public string Breed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Dog {\n");
+ sb.Append(" Breed: ").Append(Breed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public new string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Dog)obj);
+ }
+
+ ///
+ /// Returns true if Dog instances are equal
+ ///
+ /// Instance of Dog to be compared
+ /// Boolean
+ public bool Equals(Dog other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Breed == other.Breed ||
+ Breed != null &&
+ Breed.Equals(other.Breed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+ if (Breed != null)
+ hashCode = hashCode * 59 + Breed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Dog left, Dog right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Dog left, Dog right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/DogAllOf.cs b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/DogAllOf.cs
new file mode 100644
index 00000000000..6be8ff2fe4e
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/Models/DogAllOf.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class DogAllOf : IEquatable
+ {
+ ///
+ /// Gets or Sets Breed
+ ///
+ [DataMember(Name="breed", EmitDefaultValue=false)]
+ public string Breed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class DogAllOf {\n");
+ sb.Append(" Breed: ").Append(Breed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((DogAllOf)obj);
+ }
+
+ ///
+ /// Returns true if DogAllOf instances are equal
+ ///
+ /// Instance of DogAllOf to be compared
+ /// Boolean
+ public bool Equals(DogAllOf other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Breed == other.Breed ||
+ Breed != null &&
+ Breed.Equals(other.Breed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+ if (Breed != null)
+ hashCode = hashCode * 59 + Breed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(DogAllOf left, DogAllOf right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(DogAllOf left, DogAllOf right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json
index 0ccbb4c793c..53d1a8e9b10 100644
--- a/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json
+++ b/samples/server/petstore/aspnetcore-5.0/src/Org.OpenAPITools/wwwroot/openapi-original.json
@@ -1048,6 +1048,40 @@
"title" : "An uploaded response",
"type" : "object"
},
+ "Dog" : {
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/Animal"
+ }, {
+ "$ref" : "#/components/schemas/Dog_allOf"
+ } ]
+ },
+ "Cat" : {
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/Animal"
+ }, {
+ "$ref" : "#/components/schemas/Cat_allOf"
+ } ]
+ },
+ "Animal" : {
+ "discriminator" : {
+ "mapping" : {
+ "DOG" : "#/components/schemas/Dog",
+ "CAT" : "#/components/schemas/Cat"
+ },
+ "propertyName" : "className"
+ },
+ "properties" : {
+ "className" : {
+ "type" : "string"
+ },
+ "color" : {
+ "default" : "red",
+ "type" : "string"
+ }
+ },
+ "required" : [ "className" ],
+ "type" : "object"
+ },
"updatePetWithForm_request" : {
"properties" : {
"name" : {
@@ -1074,6 +1108,24 @@
}
},
"type" : "object"
+ },
+ "Dog_allOf" : {
+ "properties" : {
+ "breed" : {
+ "type" : "string"
+ }
+ },
+ "type" : "object",
+ "example" : null
+ },
+ "Cat_allOf" : {
+ "properties" : {
+ "declawed" : {
+ "type" : "boolean"
+ }
+ },
+ "type" : "object",
+ "example" : null
}
},
"securitySchemes" : {
diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-6.0-pocoModels/.openapi-generator/FILES
index 9e47b8916d5..2d78823754e 100644
--- a/samples/server/petstore/aspnetcore-6.0-pocoModels/.openapi-generator/FILES
+++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/.openapi-generator/FILES
@@ -14,8 +14,13 @@ src/Org.OpenAPITools/Dockerfile
src/Org.OpenAPITools/Filters/BasePathFilter.cs
src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs
src/Org.OpenAPITools/Formatters/InputFormatterStream.cs
+src/Org.OpenAPITools/Models/Animal.cs
src/Org.OpenAPITools/Models/ApiResponse.cs
+src/Org.OpenAPITools/Models/Cat.cs
+src/Org.OpenAPITools/Models/CatAllOf.cs
src/Org.OpenAPITools/Models/Category.cs
+src/Org.OpenAPITools/Models/Dog.cs
+src/Org.OpenAPITools/Models/DogAllOf.cs
src/Org.OpenAPITools/Models/Order.cs
src/Org.OpenAPITools/Models/Pet.cs
src/Org.OpenAPITools/Models/Tag.cs
diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Animal.cs
new file mode 100644
index 00000000000..c7a6ae09eaa
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Animal.cs
@@ -0,0 +1,51 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using JsonSubTypes;
+using Swashbuckle.AspNetCore.Annotations;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ [JsonConverter(typeof(JsonSubtypes), "ClassName")]
+ [SwaggerDiscriminator("ClassName")]
+ [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")]
+ [SwaggerSubType(typeof(Cat), DiscriminatorValue = "CAT")]
+ [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")]
+ [SwaggerSubType(typeof(Dog), DiscriminatorValue = "DOG")]
+ public partial class Animal
+ {
+ ///
+ /// Gets or Sets ClassName
+ ///
+ [Required]
+ [DataMember(Name="className", EmitDefaultValue=false)]
+ public string ClassName { get; set; }
+
+ ///
+ /// Gets or Sets Color
+ ///
+ [DataMember(Name="color", EmitDefaultValue=false)]
+ public string Color { get; set; } = "red";
+
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Cat.cs
new file mode 100644
index 00000000000..537c0f7f714
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Cat.cs
@@ -0,0 +1,36 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class Cat : Animal
+ {
+ ///
+ /// Gets or Sets Declawed
+ ///
+ [DataMember(Name="declawed", EmitDefaultValue=true)]
+ public bool Declawed { get; set; }
+
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/CatAllOf.cs b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/CatAllOf.cs
new file mode 100644
index 00000000000..26eaeb38167
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/CatAllOf.cs
@@ -0,0 +1,36 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class CatAllOf
+ {
+ ///
+ /// Gets or Sets Declawed
+ ///
+ [DataMember(Name="declawed", EmitDefaultValue=true)]
+ public bool Declawed { get; set; }
+
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Dog.cs
new file mode 100644
index 00000000000..f1a52695233
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/Dog.cs
@@ -0,0 +1,36 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class Dog : Animal
+ {
+ ///
+ /// Gets or Sets Breed
+ ///
+ [DataMember(Name="breed", EmitDefaultValue=false)]
+ public string Breed { get; set; }
+
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/DogAllOf.cs b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/DogAllOf.cs
new file mode 100644
index 00000000000..c4029b4d981
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/Models/DogAllOf.cs
@@ -0,0 +1,36 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class DogAllOf
+ {
+ ///
+ /// Gets or Sets Breed
+ ///
+ [DataMember(Name="breed", EmitDefaultValue=false)]
+ public string Breed { get; set; }
+
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/wwwroot/openapi-original.json
index 0ccbb4c793c..53d1a8e9b10 100644
--- a/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/wwwroot/openapi-original.json
+++ b/samples/server/petstore/aspnetcore-6.0-pocoModels/src/Org.OpenAPITools/wwwroot/openapi-original.json
@@ -1048,6 +1048,40 @@
"title" : "An uploaded response",
"type" : "object"
},
+ "Dog" : {
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/Animal"
+ }, {
+ "$ref" : "#/components/schemas/Dog_allOf"
+ } ]
+ },
+ "Cat" : {
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/Animal"
+ }, {
+ "$ref" : "#/components/schemas/Cat_allOf"
+ } ]
+ },
+ "Animal" : {
+ "discriminator" : {
+ "mapping" : {
+ "DOG" : "#/components/schemas/Dog",
+ "CAT" : "#/components/schemas/Cat"
+ },
+ "propertyName" : "className"
+ },
+ "properties" : {
+ "className" : {
+ "type" : "string"
+ },
+ "color" : {
+ "default" : "red",
+ "type" : "string"
+ }
+ },
+ "required" : [ "className" ],
+ "type" : "object"
+ },
"updatePetWithForm_request" : {
"properties" : {
"name" : {
@@ -1074,6 +1108,24 @@
}
},
"type" : "object"
+ },
+ "Dog_allOf" : {
+ "properties" : {
+ "breed" : {
+ "type" : "string"
+ }
+ },
+ "type" : "object",
+ "example" : null
+ },
+ "Cat_allOf" : {
+ "properties" : {
+ "declawed" : {
+ "type" : "boolean"
+ }
+ },
+ "type" : "object",
+ "example" : null
}
},
"securitySchemes" : {
diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-6.0-project4Models/.openapi-generator/FILES
index fe403832ad9..6d74d26da32 100644
--- a/samples/server/petstore/aspnetcore-6.0-project4Models/.openapi-generator/FILES
+++ b/samples/server/petstore/aspnetcore-6.0-project4Models/.openapi-generator/FILES
@@ -2,9 +2,14 @@ Org.OpenAPITools.sln
README.md
build.bat
build.sh
+src/Org.OpenAPITools.Models/Animal.cs
src/Org.OpenAPITools.Models/ApiResponse.cs
+src/Org.OpenAPITools.Models/Cat.cs
+src/Org.OpenAPITools.Models/CatAllOf.cs
src/Org.OpenAPITools.Models/Category.cs
src/Org.OpenAPITools.Models/Converters/CustomEnumConverter.cs
+src/Org.OpenAPITools.Models/Dog.cs
+src/Org.OpenAPITools.Models/DogAllOf.cs
src/Org.OpenAPITools.Models/Order.cs
src/Org.OpenAPITools.Models/Org.OpenAPITools.Models.csproj
src/Org.OpenAPITools.Models/Pet.cs
diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Animal.cs b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Animal.cs
new file mode 100644
index 00000000000..01f525396dc
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Animal.cs
@@ -0,0 +1,142 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using JsonSubTypes;
+using Swashbuckle.AspNetCore.Annotations;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ [JsonConverter(typeof(JsonSubtypes), "ClassName")]
+ [SwaggerDiscriminator("ClassName")]
+ [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")]
+ [SwaggerSubType(typeof(Cat), DiscriminatorValue = "CAT")]
+ [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")]
+ [SwaggerSubType(typeof(Dog), DiscriminatorValue = "DOG")]
+ public partial class Animal : IEquatable
+ {
+ ///
+ /// Gets or Sets ClassName
+ ///
+ [Required]
+ [DataMember(Name="className", EmitDefaultValue=false)]
+ public string ClassName { get; set; }
+
+ ///
+ /// Gets or Sets Color
+ ///
+ [DataMember(Name="color", EmitDefaultValue=false)]
+ public string Color { get; set; } = "red";
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Animal {\n");
+ sb.Append(" ClassName: ").Append(ClassName).Append("\n");
+ sb.Append(" Color: ").Append(Color).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Animal)obj);
+ }
+
+ ///
+ /// Returns true if Animal instances are equal
+ ///
+ /// Instance of Animal to be compared
+ /// Boolean
+ public bool Equals(Animal other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ ClassName == other.ClassName ||
+ ClassName != null &&
+ ClassName.Equals(other.ClassName)
+ ) &&
+ (
+ Color == other.Color ||
+ Color != null &&
+ Color.Equals(other.Color)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+ if (ClassName != null)
+ hashCode = hashCode * 59 + ClassName.GetHashCode();
+ if (Color != null)
+ hashCode = hashCode * 59 + Color.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Animal left, Animal right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Animal left, Animal right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Cat.cs b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Cat.cs
new file mode 100644
index 00000000000..9bb95fe5a4e
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Cat.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class Cat : Animal, IEquatable
+ {
+ ///
+ /// Gets or Sets Declawed
+ ///
+ [DataMember(Name="declawed", EmitDefaultValue=true)]
+ public bool Declawed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Cat {\n");
+ sb.Append(" Declawed: ").Append(Declawed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public new string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Cat)obj);
+ }
+
+ ///
+ /// Returns true if Cat instances are equal
+ ///
+ /// Instance of Cat to be compared
+ /// Boolean
+ public bool Equals(Cat other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Declawed == other.Declawed ||
+
+ Declawed.Equals(other.Declawed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+
+ hashCode = hashCode * 59 + Declawed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Cat left, Cat right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Cat left, Cat right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/CatAllOf.cs b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/CatAllOf.cs
new file mode 100644
index 00000000000..ca2b213b0cf
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/CatAllOf.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class CatAllOf : IEquatable
+ {
+ ///
+ /// Gets or Sets Declawed
+ ///
+ [DataMember(Name="declawed", EmitDefaultValue=true)]
+ public bool Declawed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class CatAllOf {\n");
+ sb.Append(" Declawed: ").Append(Declawed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((CatAllOf)obj);
+ }
+
+ ///
+ /// Returns true if CatAllOf instances are equal
+ ///
+ /// Instance of CatAllOf to be compared
+ /// Boolean
+ public bool Equals(CatAllOf other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Declawed == other.Declawed ||
+
+ Declawed.Equals(other.Declawed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+
+ hashCode = hashCode * 59 + Declawed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(CatAllOf left, CatAllOf right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(CatAllOf left, CatAllOf right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Dog.cs b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Dog.cs
new file mode 100644
index 00000000000..ff3a582cc13
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/Dog.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class Dog : Animal, IEquatable
+ {
+ ///
+ /// Gets or Sets Breed
+ ///
+ [DataMember(Name="breed", EmitDefaultValue=false)]
+ public string Breed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Dog {\n");
+ sb.Append(" Breed: ").Append(Breed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public new string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Dog)obj);
+ }
+
+ ///
+ /// Returns true if Dog instances are equal
+ ///
+ /// Instance of Dog to be compared
+ /// Boolean
+ public bool Equals(Dog other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Breed == other.Breed ||
+ Breed != null &&
+ Breed.Equals(other.Breed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+ if (Breed != null)
+ hashCode = hashCode * 59 + Breed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Dog left, Dog right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Dog left, Dog right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/DogAllOf.cs b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/DogAllOf.cs
new file mode 100644
index 00000000000..6be8ff2fe4e
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools.Models/DogAllOf.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class DogAllOf : IEquatable
+ {
+ ///
+ /// Gets or Sets Breed
+ ///
+ [DataMember(Name="breed", EmitDefaultValue=false)]
+ public string Breed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class DogAllOf {\n");
+ sb.Append(" Breed: ").Append(Breed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((DogAllOf)obj);
+ }
+
+ ///
+ /// Returns true if DogAllOf instances are equal
+ ///
+ /// Instance of DogAllOf to be compared
+ /// Boolean
+ public bool Equals(DogAllOf other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Breed == other.Breed ||
+ Breed != null &&
+ Breed.Equals(other.Breed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+ if (Breed != null)
+ hashCode = hashCode * 59 + Breed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(DogAllOf left, DogAllOf right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(DogAllOf left, DogAllOf right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/wwwroot/openapi-original.json
index 0ccbb4c793c..53d1a8e9b10 100644
--- a/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/wwwroot/openapi-original.json
+++ b/samples/server/petstore/aspnetcore-6.0-project4Models/src/Org.OpenAPITools/wwwroot/openapi-original.json
@@ -1048,6 +1048,40 @@
"title" : "An uploaded response",
"type" : "object"
},
+ "Dog" : {
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/Animal"
+ }, {
+ "$ref" : "#/components/schemas/Dog_allOf"
+ } ]
+ },
+ "Cat" : {
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/Animal"
+ }, {
+ "$ref" : "#/components/schemas/Cat_allOf"
+ } ]
+ },
+ "Animal" : {
+ "discriminator" : {
+ "mapping" : {
+ "DOG" : "#/components/schemas/Dog",
+ "CAT" : "#/components/schemas/Cat"
+ },
+ "propertyName" : "className"
+ },
+ "properties" : {
+ "className" : {
+ "type" : "string"
+ },
+ "color" : {
+ "default" : "red",
+ "type" : "string"
+ }
+ },
+ "required" : [ "className" ],
+ "type" : "object"
+ },
"updatePetWithForm_request" : {
"properties" : {
"name" : {
@@ -1074,6 +1108,24 @@
}
},
"type" : "object"
+ },
+ "Dog_allOf" : {
+ "properties" : {
+ "breed" : {
+ "type" : "string"
+ }
+ },
+ "type" : "object",
+ "example" : null
+ },
+ "Cat_allOf" : {
+ "properties" : {
+ "declawed" : {
+ "type" : "boolean"
+ }
+ },
+ "type" : "object",
+ "example" : null
}
},
"securitySchemes" : {
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator-ignore b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator-ignore
new file mode 100644
index 00000000000..7484ee590a3
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator-ignore
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator/FILES
new file mode 100644
index 00000000000..94dce5508ef
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator/FILES
@@ -0,0 +1,27 @@
+Org.OpenAPITools.sln
+README.md
+build.bat
+build.sh
+src/Org.OpenAPITools/.gitignore
+src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs
+src/Org.OpenAPITools/Authentication/ApiAuthentication.cs
+src/Org.OpenAPITools/Controllers/FakeApi.cs
+src/Org.OpenAPITools/Controllers/PetApi.cs
+src/Org.OpenAPITools/Controllers/StoreApi.cs
+src/Org.OpenAPITools/Controllers/UserApi.cs
+src/Org.OpenAPITools/Converters/CustomEnumConverter.cs
+src/Org.OpenAPITools/Formatters/InputFormatterStream.cs
+src/Org.OpenAPITools/Models/Animal.cs
+src/Org.OpenAPITools/Models/ApiResponse.cs
+src/Org.OpenAPITools/Models/Cat.cs
+src/Org.OpenAPITools/Models/CatAllOf.cs
+src/Org.OpenAPITools/Models/Category.cs
+src/Org.OpenAPITools/Models/Dog.cs
+src/Org.OpenAPITools/Models/DogAllOf.cs
+src/Org.OpenAPITools/Models/Order.cs
+src/Org.OpenAPITools/Models/Pet.cs
+src/Org.OpenAPITools/Models/Tag.cs
+src/Org.OpenAPITools/Models/User.cs
+src/Org.OpenAPITools/OpenApi/TypeExtensions.cs
+src/Org.OpenAPITools/Org.OpenAPITools.csproj
+src/Org.OpenAPITools/Org.OpenAPITools.nuspec
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator/VERSION
new file mode 100644
index 00000000000..ba8a874deab
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/.openapi-generator/VERSION
@@ -0,0 +1 @@
+6.6.0-SNAPSHOT
\ No newline at end of file
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/Org.OpenAPITools.sln
new file mode 100644
index 00000000000..c2bc3876420
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/Org.OpenAPITools.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.27428.2043
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/README.md b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/README.md
new file mode 100644
index 00000000000..06ddde516ac
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/README.md
@@ -0,0 +1,43 @@
+# Org.OpenAPITools - ASP.NET Core 6.0 Server
+
+This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+
+## Upgrade NuGet Packages
+
+NuGet packages get frequently updated.
+
+To upgrade this solution to the latest version of all NuGet packages, use the dotnet-outdated tool.
+
+
+Install dotnet-outdated tool:
+
+```
+dotnet tool install --global dotnet-outdated-tool
+```
+
+Upgrade only to new minor versions of packages
+
+```
+dotnet outdated --upgrade --version-lock Major
+```
+
+Upgrade to all new versions of packages (more likely to include breaking API changes)
+
+```
+dotnet outdated --upgrade
+```
+
+
+## Run
+
+Linux/OS X:
+
+```
+sh build.sh
+```
+
+Windows:
+
+```
+build.bat
+```
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/build.bat b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/build.bat
new file mode 100644
index 00000000000..cd65518e428
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/build.bat
@@ -0,0 +1,9 @@
+:: Generated by: https://openapi-generator.tech
+::
+
+@echo off
+
+dotnet restore src\Org.OpenAPITools
+dotnet build src\Org.OpenAPITools
+echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile web.
+echo.
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/build.sh b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/build.sh
new file mode 100644
index 00000000000..afbeddb8378
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/build.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+#
+# Generated by: https://openapi-generator.tech
+#
+
+dotnet restore src/Org.OpenAPITools/ && \
+ dotnet build src/Org.OpenAPITools/ && \
+ echo "Now, run the following to start the project: dotnet run -p src/Org.OpenAPITools/Org.OpenAPITools.csproj --launch-profile web"
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/.gitignore b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/.gitignore
new file mode 100644
index 00000000000..1ee53850b84
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/.gitignore
@@ -0,0 +1,362 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Ww][Ii][Nn]32/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*.json
+coverage*.xml
+coverage*.info
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs
new file mode 100644
index 00000000000..3ed1bc5b5ab
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs
@@ -0,0 +1,61 @@
+using System.ComponentModel.DataAnnotations;
+using System.Reflection;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.Controllers;
+using Microsoft.AspNetCore.Mvc.Filters;
+using Microsoft.AspNetCore.Mvc.ModelBinding;
+
+namespace Org.OpenAPITools.Attributes
+{
+ ///
+ /// Model state validation attribute
+ ///
+ public class ValidateModelStateAttribute : ActionFilterAttribute
+ {
+ ///
+ /// Called before the action method is invoked
+ ///
+ ///
+ public override void OnActionExecuting(ActionExecutingContext context)
+ {
+ // Per https://blog.markvincze.com/how-to-validate-action-parameters-with-dataannotation-attributes/
+ var descriptor = context.ActionDescriptor as ControllerActionDescriptor;
+ if (descriptor != null)
+ {
+ foreach (var parameter in descriptor.MethodInfo.GetParameters())
+ {
+ object args = null;
+ if (context.ActionArguments.ContainsKey(parameter.Name))
+ {
+ args = context.ActionArguments[parameter.Name];
+ }
+
+ ValidateAttributes(parameter, args, context.ModelState);
+ }
+ }
+
+ if (!context.ModelState.IsValid)
+ {
+ context.Result = new BadRequestObjectResult(context.ModelState);
+ }
+ }
+
+ private void ValidateAttributes(ParameterInfo parameter, object args, ModelStateDictionary modelState)
+ {
+ foreach (var attributeData in parameter.CustomAttributes)
+ {
+ var attributeInstance = parameter.GetCustomAttribute(attributeData.AttributeType);
+
+ var validationAttribute = attributeInstance as ValidationAttribute;
+ if (validationAttribute != null)
+ {
+ var isValid = validationAttribute.IsValid(args);
+ if (!isValid)
+ {
+ modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name));
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs
new file mode 100644
index 00000000000..85be8593fce
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs
@@ -0,0 +1,62 @@
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc.Filters;
+
+namespace Org.OpenAPITools.Authentication
+{
+ ///
+ /// A requirement that an ApiKey must be present.
+ ///
+ public class ApiKeyRequirement : IAuthorizationRequirement
+ {
+ ///
+ /// Get the list of api keys
+ ///
+ public IReadOnlyList ApiKeys { get; }
+
+ ///
+ /// Get the policy name,
+ ///
+ public string PolicyName { get; }
+
+ ///
+ /// Create a new instance of the class.
+ ///
+ ///
+ ///
+ public ApiKeyRequirement(IEnumerable apiKeys, string policyName)
+ {
+ ApiKeys = apiKeys?.ToList() ?? new List();
+ PolicyName = policyName;
+ }
+ }
+
+ ///
+ /// Enforce that an api key is present.
+ ///
+ public class ApiKeyRequirementHandler : AuthorizationHandler
+ {
+ ///
+ protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ApiKeyRequirement requirement)
+ {
+ SucceedRequirementIfApiKeyPresentAndValid(context, requirement);
+ return Task.CompletedTask;
+ }
+
+ private void SucceedRequirementIfApiKeyPresentAndValid(AuthorizationHandlerContext context, ApiKeyRequirement requirement)
+ {
+
+ if (context.Resource is AuthorizationFilterContext authorizationFilterContext)
+ {
+ var apiKey = authorizationFilterContext.HttpContext.Request.Headers["api_key"].FirstOrDefault();
+ if (requirement.PolicyName == "api_key" && apiKey != null && requirement.ApiKeys.Any(requiredApiKey => apiKey == requiredApiKey))
+ {
+ context.Succeed(requirement);
+ }
+ }
+
+ }
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/FakeApi.cs
new file mode 100644
index 00000000000..07c44c86143
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/FakeApi.cs
@@ -0,0 +1,38 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Http;
+using Org.OpenAPITools.Attributes;
+using Org.OpenAPITools.Models;
+
+namespace Org.OpenAPITools.Controllers
+{
+ ///
+ ///
+ ///
+ [ApiController]
+ public abstract class FakeApiController : ControllerBase
+ {
+ ///
+ /// fake endpoint to test parameter example (object)
+ ///
+ ///
+ /// successful operation
+ [HttpGet]
+ [Route("/v2/fake/parameter_example_test")]
+ [ValidateModelState]
+ public abstract IActionResult FakeParameterExampleTest([FromQuery (Name = "data")][Required()]Pet data);
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/PetApi.cs
new file mode 100644
index 00000000000..8cd072efb95
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/PetApi.cs
@@ -0,0 +1,136 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Http;
+using Org.OpenAPITools.Attributes;
+using Org.OpenAPITools.Models;
+
+namespace Org.OpenAPITools.Controllers
+{
+ ///
+ ///
+ ///
+ [ApiController]
+ public abstract class PetApiController : ControllerBase
+ {
+ ///
+ /// Add a new pet to the store
+ ///
+ /// Pet object that needs to be added to the store
+ /// successful operation
+ /// Invalid input
+ [HttpPost]
+ [Route("/v2/pet")]
+ [Consumes("application/json", "application/xml")]
+ [ValidateModelState]
+ [ProducesResponseType(statusCode: 200, type: typeof(Pet))]
+ public abstract IActionResult AddPet([FromBody]Pet pet);
+
+ ///
+ /// Deletes a pet
+ ///
+ /// Pet id to delete
+ ///
+ /// Invalid pet value
+ [HttpDelete]
+ [Route("/v2/pet/{petId}")]
+ [ValidateModelState]
+ public abstract IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader]string apiKey);
+
+ ///
+ /// Finds Pets by status
+ ///
+ /// Multiple status values can be provided with comma separated strings
+ /// Status values that need to be considered for filter (deprecated)
+ /// successful operation
+ /// Invalid status value
+ [HttpGet]
+ [Route("/v2/pet/findByStatus")]
+ [ValidateModelState]
+ [ProducesResponseType(statusCode: 200, type: typeof(List))]
+ public abstract IActionResult FindPetsByStatus([FromQuery (Name = "status")][Required()]List status);
+
+ ///
+ /// Finds Pets by tags
+ ///
+ /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ /// Tags to filter by
+ /// successful operation
+ /// Invalid tag value
+ [HttpGet]
+ [Route("/v2/pet/findByTags")]
+ [ValidateModelState]
+ [ProducesResponseType(statusCode: 200, type: typeof(List))]
+ [Obsolete]
+ public abstract IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required()]List tags);
+
+ ///
+ /// Find pet by ID
+ ///
+ /// Returns a single pet
+ /// ID of pet to return
+ /// successful operation
+ /// Invalid ID supplied
+ /// Pet not found
+ [HttpGet]
+ [Route("/v2/pet/{petId}")]
+ [Authorize(Policy = "api_key")]
+ [ValidateModelState]
+ [ProducesResponseType(statusCode: 200, type: typeof(Pet))]
+ public abstract IActionResult GetPetById([FromRoute (Name = "petId")][Required]long petId);
+
+ ///
+ /// Update an existing pet
+ ///
+ /// Pet object that needs to be added to the store
+ /// successful operation
+ /// Invalid ID supplied
+ /// Pet not found
+ /// Validation exception
+ [HttpPut]
+ [Route("/v2/pet")]
+ [Consumes("application/json", "application/xml")]
+ [ValidateModelState]
+ [ProducesResponseType(statusCode: 200, type: typeof(Pet))]
+ public abstract IActionResult UpdatePet([FromBody]Pet pet);
+
+ ///
+ /// Updates a pet in the store with form data
+ ///
+ /// ID of pet that needs to be updated
+ /// Updated name of the pet
+ /// Updated status of the pet
+ /// Invalid input
+ [HttpPost]
+ [Route("/v2/pet/{petId}")]
+ [Consumes("application/x-www-form-urlencoded")]
+ [ValidateModelState]
+ public abstract IActionResult UpdatePetWithForm([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "name")]string name, [FromForm (Name = "status")]string status);
+
+ ///
+ /// uploads an image
+ ///
+ /// ID of pet to update
+ /// Additional data to pass to server
+ /// file to upload
+ /// successful operation
+ [HttpPost]
+ [Route("/v2/pet/{petId}/uploadImage")]
+ [Consumes("multipart/form-data")]
+ [ValidateModelState]
+ [ProducesResponseType(statusCode: 200, type: typeof(ApiResponse))]
+ public abstract IActionResult UploadFile([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "additionalMetadata")]string additionalMetadata, IFormFile file);
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/StoreApi.cs
new file mode 100644
index 00000000000..3ec0d549c4a
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/StoreApi.cs
@@ -0,0 +1,79 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Http;
+using Org.OpenAPITools.Attributes;
+using Org.OpenAPITools.Models;
+
+namespace Org.OpenAPITools.Controllers
+{
+ ///
+ ///
+ ///
+ [ApiController]
+ public abstract class StoreApiController : ControllerBase
+ {
+ ///
+ /// Delete purchase order by ID
+ ///
+ /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ /// ID of the order that needs to be deleted
+ /// Invalid ID supplied
+ /// Order not found
+ [HttpDelete]
+ [Route("/v2/store/order/{orderId}")]
+ [ValidateModelState]
+ public abstract IActionResult DeleteOrder([FromRoute (Name = "orderId")][Required]string orderId);
+
+ ///
+ /// Returns pet inventories by status
+ ///
+ /// Returns a map of status codes to quantities
+ /// successful operation
+ [HttpGet]
+ [Route("/v2/store/inventory")]
+ [Authorize(Policy = "api_key")]
+ [ValidateModelState]
+ [ProducesResponseType(statusCode: 200, type: typeof(Dictionary))]
+ public abstract IActionResult GetInventory();
+
+ ///
+ /// Find purchase order by ID
+ ///
+ /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
+ /// ID of pet that needs to be fetched
+ /// successful operation
+ /// Invalid ID supplied
+ /// Order not found
+ [HttpGet]
+ [Route("/v2/store/order/{orderId}")]
+ [ValidateModelState]
+ [ProducesResponseType(statusCode: 200, type: typeof(Order))]
+ public abstract IActionResult GetOrderById([FromRoute (Name = "orderId")][Required][Range(1, 5)]long orderId);
+
+ ///
+ /// Place an order for a pet
+ ///
+ /// order placed for purchasing the pet
+ /// successful operation
+ /// Invalid Order
+ [HttpPost]
+ [Route("/v2/store/order")]
+ [Consumes("application/json")]
+ [ValidateModelState]
+ [ProducesResponseType(statusCode: 200, type: typeof(Order))]
+ public abstract IActionResult PlaceOrder([FromBody]Order order);
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/UserApi.cs
new file mode 100644
index 00000000000..2de74542f79
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Controllers/UserApi.cs
@@ -0,0 +1,129 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Http;
+using Org.OpenAPITools.Attributes;
+using Org.OpenAPITools.Models;
+
+namespace Org.OpenAPITools.Controllers
+{
+ ///
+ ///
+ ///
+ [ApiController]
+ public abstract class UserApiController : ControllerBase
+ {
+ ///
+ /// Create user
+ ///
+ /// This can only be done by the logged in user.
+ /// Created user object
+ /// successful operation
+ [HttpPost]
+ [Route("/v2/user")]
+ [Authorize(Policy = "api_key")]
+ [Consumes("application/json")]
+ [ValidateModelState]
+ public abstract IActionResult CreateUser([FromBody]User user);
+
+ ///
+ /// Creates list of users with given input array
+ ///
+ /// List of user object
+ /// successful operation
+ [HttpPost]
+ [Route("/v2/user/createWithArray")]
+ [Authorize(Policy = "api_key")]
+ [Consumes("application/json")]
+ [ValidateModelState]
+ public abstract IActionResult CreateUsersWithArrayInput([FromBody]List user);
+
+ ///
+ /// Creates list of users with given input array
+ ///
+ /// List of user object
+ /// successful operation
+ [HttpPost]
+ [Route("/v2/user/createWithList")]
+ [Authorize(Policy = "api_key")]
+ [Consumes("application/json")]
+ [ValidateModelState]
+ public abstract IActionResult CreateUsersWithListInput([FromBody]List user);
+
+ ///
+ /// Delete user
+ ///
+ /// This can only be done by the logged in user.
+ /// The name that needs to be deleted
+ /// Invalid username supplied
+ /// User not found
+ [HttpDelete]
+ [Route("/v2/user/{username}")]
+ [Authorize(Policy = "api_key")]
+ [ValidateModelState]
+ public abstract IActionResult DeleteUser([FromRoute (Name = "username")][Required]string username);
+
+ ///
+ /// Get user by user name
+ ///
+ /// The name that needs to be fetched. Use user1 for testing.
+ /// successful operation
+ /// Invalid username supplied
+ /// User not found
+ [HttpGet]
+ [Route("/v2/user/{username}")]
+ [ValidateModelState]
+ [ProducesResponseType(statusCode: 200, type: typeof(User))]
+ public abstract IActionResult GetUserByName([FromRoute (Name = "username")][Required]string username);
+
+ ///
+ /// Logs user into the system
+ ///
+ /// The user name for login
+ /// The password for login in clear text
+ /// successful operation
+ /// Invalid username/password supplied
+ [HttpGet]
+ [Route("/v2/user/login")]
+ [ValidateModelState]
+ [ProducesResponseType(statusCode: 200, type: typeof(string))]
+ public abstract IActionResult LoginUser([FromQuery (Name = "username")][Required()][RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")]string username, [FromQuery (Name = "password")][Required()]string password);
+
+ ///
+ /// Logs out current logged in user session
+ ///
+ /// successful operation
+ [HttpGet]
+ [Route("/v2/user/logout")]
+ [Authorize(Policy = "api_key")]
+ [ValidateModelState]
+ public abstract IActionResult LogoutUser();
+
+ ///
+ /// Updated user
+ ///
+ /// This can only be done by the logged in user.
+ /// name that need to be deleted
+ /// Updated user object
+ /// Invalid user supplied
+ /// User not found
+ [HttpPut]
+ [Route("/v2/user/{username}")]
+ [Authorize(Policy = "api_key")]
+ [Consumes("application/json")]
+ [ValidateModelState]
+ public abstract IActionResult UpdateUser([FromRoute (Name = "username")][Required]string username, [FromBody]User user);
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs
new file mode 100644
index 00000000000..00b75a3cc7c
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs
@@ -0,0 +1,42 @@
+using System;
+using System.ComponentModel;
+using System.Globalization;
+using Newtonsoft.Json;
+
+namespace Org.OpenAPITools.Converters
+{
+ ///
+ /// Custom string to enum converter
+ ///
+ public class CustomEnumConverter : TypeConverter
+ {
+ ///
+ /// Determine if we can convert a type to an enum
+ ///
+ ///
+ ///
+ ///
+ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
+ {
+ return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType);
+ }
+
+ ///
+ /// Convert from a type value to an enum
+ ///
+ ///
+ ///
+ ///
+ ///
+ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
+ {
+ var s = value as string;
+ if (string.IsNullOrEmpty(s))
+ {
+ return null;
+ }
+
+ return JsonConvert.DeserializeObject(@"""" + value.ToString() + @"""");
+ }
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs
new file mode 100644
index 00000000000..9c437b1919a
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs
@@ -0,0 +1,32 @@
+using System;
+using System.IO;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc.Formatters;
+
+namespace Org.OpenAPITools.Formatters
+{
+ // Input Type Formatter to allow model binding to Streams
+ public class InputFormatterStream : InputFormatter
+ {
+ public InputFormatterStream()
+ {
+ SupportedMediaTypes.Add("application/octet-stream");
+ SupportedMediaTypes.Add("image/jpeg");
+ }
+
+ protected override bool CanReadType(Type type)
+ {
+ if (type == typeof(Stream))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ public override Task ReadRequestBodyAsync(InputFormatterContext context)
+ {
+ return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body);
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Animal.cs
new file mode 100644
index 00000000000..fcc9a35520d
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Animal.cs
@@ -0,0 +1,138 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using JsonSubTypes;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ [JsonConverter(typeof(JsonSubtypes), "ClassName")]
+ [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")]
+ [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")]
+ public class Animal : IEquatable
+ {
+ ///
+ /// Gets or Sets ClassName
+ ///
+ [Required]
+ [DataMember(Name="className", EmitDefaultValue=false)]
+ public string ClassName { get; set; }
+
+ ///
+ /// Gets or Sets Color
+ ///
+ [DataMember(Name="color", EmitDefaultValue=false)]
+ public string Color { get; set; } = "red";
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Animal {\n");
+ sb.Append(" ClassName: ").Append(ClassName).Append("\n");
+ sb.Append(" Color: ").Append(Color).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Animal)obj);
+ }
+
+ ///
+ /// Returns true if Animal instances are equal
+ ///
+ /// Instance of Animal to be compared
+ /// Boolean
+ public bool Equals(Animal other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ ClassName == other.ClassName ||
+ ClassName != null &&
+ ClassName.Equals(other.ClassName)
+ ) &&
+ (
+ Color == other.Color ||
+ Color != null &&
+ Color.Equals(other.Color)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+ if (ClassName != null)
+ hashCode = hashCode * 59 + ClassName.GetHashCode();
+ if (Color != null)
+ hashCode = hashCode * 59 + Color.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Animal left, Animal right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Animal left, Animal right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/ApiResponse.cs
new file mode 100644
index 00000000000..9932c3d79ef
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/ApiResponse.cs
@@ -0,0 +1,147 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ /// Describes the result of uploading an image resource
+ ///
+ [DataContract]
+ public class ApiResponse : IEquatable
+ {
+ ///
+ /// Gets or Sets Code
+ ///
+ [DataMember(Name="code", EmitDefaultValue=true)]
+ 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
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ 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("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((ApiResponse)obj);
+ }
+
+ ///
+ /// Returns true if ApiResponse instances are equal
+ ///
+ /// Instance of ApiResponse to be compared
+ /// Boolean
+ public bool Equals(ApiResponse other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Code == other.Code ||
+
+ Code.Equals(other.Code)
+ ) &&
+ (
+ Type == other.Type ||
+ Type != null &&
+ Type.Equals(other.Type)
+ ) &&
+ (
+ Message == other.Message ||
+ Message != null &&
+ Message.Equals(other.Message)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+
+ hashCode = hashCode * 59 + Code.GetHashCode();
+ if (Type != null)
+ hashCode = hashCode * 59 + Type.GetHashCode();
+ if (Message != null)
+ hashCode = hashCode * 59 + Message.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(ApiResponse left, ApiResponse right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(ApiResponse left, ApiResponse right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Cat.cs
new file mode 100644
index 00000000000..faae4a77964
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Cat.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public class Cat : Animal, IEquatable
+ {
+ ///
+ /// Gets or Sets Declawed
+ ///
+ [DataMember(Name="declawed", EmitDefaultValue=true)]
+ public bool Declawed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Cat {\n");
+ sb.Append(" Declawed: ").Append(Declawed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public new string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Cat)obj);
+ }
+
+ ///
+ /// Returns true if Cat instances are equal
+ ///
+ /// Instance of Cat to be compared
+ /// Boolean
+ public bool Equals(Cat other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Declawed == other.Declawed ||
+
+ Declawed.Equals(other.Declawed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+
+ hashCode = hashCode * 59 + Declawed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Cat left, Cat right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Cat left, Cat right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/CatAllOf.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/CatAllOf.cs
new file mode 100644
index 00000000000..39cedeca0a5
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/CatAllOf.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public class CatAllOf : IEquatable
+ {
+ ///
+ /// Gets or Sets Declawed
+ ///
+ [DataMember(Name="declawed", EmitDefaultValue=true)]
+ public bool Declawed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class CatAllOf {\n");
+ sb.Append(" Declawed: ").Append(Declawed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((CatAllOf)obj);
+ }
+
+ ///
+ /// Returns true if CatAllOf instances are equal
+ ///
+ /// Instance of CatAllOf to be compared
+ /// Boolean
+ public bool Equals(CatAllOf other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Declawed == other.Declawed ||
+
+ Declawed.Equals(other.Declawed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+
+ hashCode = hashCode * 59 + Declawed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(CatAllOf left, CatAllOf right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(CatAllOf left, CatAllOf right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Category.cs
new file mode 100644
index 00000000000..585afaebf2f
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Category.cs
@@ -0,0 +1,134 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ /// A category for a pet
+ ///
+ [DataContract]
+ public class Category : IEquatable
+ {
+ ///
+ /// Gets or Sets Id
+ ///
+ [DataMember(Name="id", EmitDefaultValue=true)]
+ public long Id { get; set; }
+
+ ///
+ /// Gets or Sets Name
+ ///
+ [RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")]
+ [DataMember(Name="name", EmitDefaultValue=false)]
+ public string Name { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ 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("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Category)obj);
+ }
+
+ ///
+ /// Returns true if Category instances are equal
+ ///
+ /// Instance of Category to be compared
+ /// Boolean
+ public bool Equals(Category other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Id == other.Id ||
+
+ Id.Equals(other.Id)
+ ) &&
+ (
+ Name == other.Name ||
+ Name != null &&
+ Name.Equals(other.Name)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+
+ hashCode = hashCode * 59 + Id.GetHashCode();
+ if (Name != null)
+ hashCode = hashCode * 59 + Name.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Category left, Category right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Category left, Category right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Dog.cs
new file mode 100644
index 00000000000..db459e520a4
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Dog.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public class Dog : Animal, IEquatable
+ {
+ ///
+ /// Gets or Sets Breed
+ ///
+ [DataMember(Name="breed", EmitDefaultValue=false)]
+ public string Breed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Dog {\n");
+ sb.Append(" Breed: ").Append(Breed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public new string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Dog)obj);
+ }
+
+ ///
+ /// Returns true if Dog instances are equal
+ ///
+ /// Instance of Dog to be compared
+ /// Boolean
+ public bool Equals(Dog other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Breed == other.Breed ||
+ Breed != null &&
+ Breed.Equals(other.Breed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+ if (Breed != null)
+ hashCode = hashCode * 59 + Breed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Dog left, Dog right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Dog left, Dog right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/DogAllOf.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/DogAllOf.cs
new file mode 100644
index 00000000000..b30543c4332
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/DogAllOf.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public class DogAllOf : IEquatable
+ {
+ ///
+ /// Gets or Sets Breed
+ ///
+ [DataMember(Name="breed", EmitDefaultValue=false)]
+ public string Breed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class DogAllOf {\n");
+ sb.Append(" Breed: ").Append(Breed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((DogAllOf)obj);
+ }
+
+ ///
+ /// Returns true if DogAllOf instances are equal
+ ///
+ /// Instance of DogAllOf to be compared
+ /// Boolean
+ public bool Equals(DogAllOf other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Breed == other.Breed ||
+ Breed != null &&
+ Breed.Equals(other.Breed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+ if (Breed != null)
+ hashCode = hashCode * 59 + Breed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(DogAllOf left, DogAllOf right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(DogAllOf left, DogAllOf right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Order.cs
new file mode 100644
index 00000000000..e9d93703049
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Order.cs
@@ -0,0 +1,219 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ /// An order for a pets from the pet store
+ ///
+ [DataContract]
+ public class Order : IEquatable
+ {
+ ///
+ /// Gets or Sets Id
+ ///
+ [DataMember(Name="id", EmitDefaultValue=true)]
+ public long Id { get; set; }
+
+ ///
+ /// Gets or Sets PetId
+ ///
+ [DataMember(Name="petId", EmitDefaultValue=true)]
+ public long PetId { get; set; }
+
+ ///
+ /// Gets or Sets Quantity
+ ///
+ [DataMember(Name="quantity", EmitDefaultValue=true)]
+ public int Quantity { get; set; }
+
+ ///
+ /// Gets or Sets ShipDate
+ ///
+ [DataMember(Name="shipDate", EmitDefaultValue=false)]
+ public DateTime ShipDate { get; set; }
+
+
+ ///
+ /// Order Status
+ ///
+ /// Order Status
+ [TypeConverter(typeof(CustomEnumConverter))]
+ [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
+ public enum StatusEnum
+ {
+
+ ///
+ /// Enum PlacedEnum for placed
+ ///
+ [EnumMember(Value = "placed")]
+ PlacedEnum = 1,
+
+ ///
+ /// Enum ApprovedEnum for approved
+ ///
+ [EnumMember(Value = "approved")]
+ ApprovedEnum = 2,
+
+ ///
+ /// Enum DeliveredEnum for delivered
+ ///
+ [EnumMember(Value = "delivered")]
+ DeliveredEnum = 3
+ }
+
+ ///
+ /// Order Status
+ ///
+ /// Order Status
+ [DataMember(Name="status", EmitDefaultValue=true)]
+ public StatusEnum Status { get; set; }
+
+ ///
+ /// Gets or Sets Complete
+ ///
+ [DataMember(Name="complete", EmitDefaultValue=true)]
+ public bool Complete { get; set; } = false;
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ 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("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Order)obj);
+ }
+
+ ///
+ /// Returns true if Order instances are equal
+ ///
+ /// Instance of Order to be compared
+ /// Boolean
+ public bool Equals(Order other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Id == other.Id ||
+
+ Id.Equals(other.Id)
+ ) &&
+ (
+ PetId == other.PetId ||
+
+ PetId.Equals(other.PetId)
+ ) &&
+ (
+ Quantity == other.Quantity ||
+
+ Quantity.Equals(other.Quantity)
+ ) &&
+ (
+ ShipDate == other.ShipDate ||
+ ShipDate != null &&
+ ShipDate.Equals(other.ShipDate)
+ ) &&
+ (
+ Status == other.Status ||
+
+ Status.Equals(other.Status)
+ ) &&
+ (
+ Complete == other.Complete ||
+
+ Complete.Equals(other.Complete)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+
+ hashCode = hashCode * 59 + Id.GetHashCode();
+
+ hashCode = hashCode * 59 + PetId.GetHashCode();
+
+ hashCode = hashCode * 59 + Quantity.GetHashCode();
+ if (ShipDate != null)
+ hashCode = hashCode * 59 + ShipDate.GetHashCode();
+
+ hashCode = hashCode * 59 + Status.GetHashCode();
+
+ hashCode = hashCode * 59 + Complete.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Order left, Order right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Order left, Order right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Pet.cs
new file mode 100644
index 00000000000..c1981aa645f
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Pet.cs
@@ -0,0 +1,224 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ /// A pet for sale in the pet store
+ ///
+ [DataContract]
+ public class Pet : IEquatable
+ {
+ ///
+ /// Gets or Sets Id
+ ///
+ [DataMember(Name="id", EmitDefaultValue=true)]
+ public long Id { get; set; }
+
+ ///
+ /// Gets or Sets Category
+ ///
+ [DataMember(Name="category", EmitDefaultValue=false)]
+ public Category Category { get; set; }
+
+ ///
+ /// Gets or Sets Name
+ ///
+ /// "doggie"
+ [Required]
+ [DataMember(Name="name", EmitDefaultValue=false)]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or Sets PhotoUrls
+ ///
+ [Required]
+ [DataMember(Name="photoUrls", EmitDefaultValue=false)]
+ public List PhotoUrls { get; set; }
+
+ ///
+ /// Gets or Sets Tags
+ ///
+ [DataMember(Name="tags", EmitDefaultValue=false)]
+ public List Tags { get; set; }
+
+
+ ///
+ /// pet status in the store
+ ///
+ /// pet status in the store
+ [TypeConverter(typeof(CustomEnumConverter))]
+ [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
+ public enum StatusEnum
+ {
+
+ ///
+ /// Enum AvailableEnum for available
+ ///
+ [EnumMember(Value = "available")]
+ AvailableEnum = 1,
+
+ ///
+ /// Enum PendingEnum for pending
+ ///
+ [EnumMember(Value = "pending")]
+ PendingEnum = 2,
+
+ ///
+ /// Enum SoldEnum for sold
+ ///
+ [EnumMember(Value = "sold")]
+ SoldEnum = 3
+ }
+
+ ///
+ /// pet status in the store
+ ///
+ /// pet status in the store
+ [DataMember(Name="status", EmitDefaultValue=true)]
+ public StatusEnum Status { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ 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("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Pet)obj);
+ }
+
+ ///
+ /// Returns true if Pet instances are equal
+ ///
+ /// Instance of Pet to be compared
+ /// Boolean
+ public bool Equals(Pet other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Id == other.Id ||
+
+ Id.Equals(other.Id)
+ ) &&
+ (
+ Category == other.Category ||
+ Category != null &&
+ Category.Equals(other.Category)
+ ) &&
+ (
+ Name == other.Name ||
+ Name != null &&
+ Name.Equals(other.Name)
+ ) &&
+ (
+ PhotoUrls == other.PhotoUrls ||
+ PhotoUrls != null &&
+ other.PhotoUrls != null &&
+ PhotoUrls.SequenceEqual(other.PhotoUrls)
+ ) &&
+ (
+ Tags == other.Tags ||
+ Tags != null &&
+ other.Tags != null &&
+ Tags.SequenceEqual(other.Tags)
+ ) &&
+ (
+ Status == other.Status ||
+
+ Status.Equals(other.Status)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+
+ hashCode = hashCode * 59 + Id.GetHashCode();
+ if (Category != null)
+ hashCode = hashCode * 59 + Category.GetHashCode();
+ if (Name != null)
+ hashCode = hashCode * 59 + Name.GetHashCode();
+ if (PhotoUrls != null)
+ hashCode = hashCode * 59 + PhotoUrls.GetHashCode();
+ if (Tags != null)
+ hashCode = hashCode * 59 + Tags.GetHashCode();
+
+ hashCode = hashCode * 59 + Status.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Pet left, Pet right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Pet left, Pet right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Tag.cs
new file mode 100644
index 00000000000..18d6e092e78
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/Tag.cs
@@ -0,0 +1,133 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ /// A tag for a pet
+ ///
+ [DataContract]
+ public class Tag : IEquatable
+ {
+ ///
+ /// Gets or Sets Id
+ ///
+ [DataMember(Name="id", EmitDefaultValue=true)]
+ 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
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ 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("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Tag)obj);
+ }
+
+ ///
+ /// Returns true if Tag instances are equal
+ ///
+ /// Instance of Tag to be compared
+ /// Boolean
+ public bool Equals(Tag other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Id == other.Id ||
+
+ Id.Equals(other.Id)
+ ) &&
+ (
+ Name == other.Name ||
+ Name != null &&
+ Name.Equals(other.Name)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+
+ hashCode = hashCode * 59 + Id.GetHashCode();
+ if (Name != null)
+ hashCode = hashCode * 59 + Name.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Tag left, Tag right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Tag left, Tag right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/User.cs
new file mode 100644
index 00000000000..7d4aabd8251
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Models/User.cs
@@ -0,0 +1,218 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ /// A User who is purchasing from the pet store
+ ///
+ [DataContract]
+ public class User : IEquatable
+ {
+ ///
+ /// Gets or Sets Id
+ ///
+ [DataMember(Name="id", EmitDefaultValue=true)]
+ 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=true)]
+ public int UserStatus { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ 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("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((User)obj);
+ }
+
+ ///
+ /// Returns true if User instances are equal
+ ///
+ /// Instance of User to be compared
+ /// Boolean
+ public bool Equals(User other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Id == other.Id ||
+
+ Id.Equals(other.Id)
+ ) &&
+ (
+ Username == other.Username ||
+ Username != null &&
+ Username.Equals(other.Username)
+ ) &&
+ (
+ FirstName == other.FirstName ||
+ FirstName != null &&
+ FirstName.Equals(other.FirstName)
+ ) &&
+ (
+ LastName == other.LastName ||
+ LastName != null &&
+ LastName.Equals(other.LastName)
+ ) &&
+ (
+ Email == other.Email ||
+ Email != null &&
+ Email.Equals(other.Email)
+ ) &&
+ (
+ Password == other.Password ||
+ Password != null &&
+ Password.Equals(other.Password)
+ ) &&
+ (
+ Phone == other.Phone ||
+ Phone != null &&
+ Phone.Equals(other.Phone)
+ ) &&
+ (
+ UserStatus == other.UserStatus ||
+
+ UserStatus.Equals(other.UserStatus)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+
+ hashCode = hashCode * 59 + Id.GetHashCode();
+ if (Username != null)
+ hashCode = hashCode * 59 + Username.GetHashCode();
+ if (FirstName != null)
+ hashCode = hashCode * 59 + FirstName.GetHashCode();
+ if (LastName != null)
+ hashCode = hashCode * 59 + LastName.GetHashCode();
+ if (Email != null)
+ hashCode = hashCode * 59 + Email.GetHashCode();
+ if (Password != null)
+ hashCode = hashCode * 59 + Password.GetHashCode();
+ if (Phone != null)
+ hashCode = hashCode * 59 + Phone.GetHashCode();
+
+ hashCode = hashCode * 59 + UserStatus.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(User left, User right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(User left, User right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs
new file mode 100644
index 00000000000..b862226f2c1
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs
@@ -0,0 +1,51 @@
+using System;
+using System.Linq;
+using System.Text;
+
+namespace Org.OpenAPITools.OpenApi
+{
+ ///
+ /// Replacement utilities from Swashbuckle.AspNetCore.SwaggerGen which are not in 5.x
+ ///
+ public static class TypeExtensions
+ {
+ ///
+ /// Produce a friendly name for the type which is unique.
+ ///
+ ///
+ ///
+ public static string FriendlyId(this Type type, bool fullyQualified = false)
+ {
+ var typeName = fullyQualified
+ ? type.FullNameSansTypeParameters().Replace("+", ".")
+ : type.Name;
+
+ if (type.IsGenericType)
+ {
+ var genericArgumentIds = type.GetGenericArguments()
+ .Select(t => t.FriendlyId(fullyQualified))
+ .ToArray();
+
+ return new StringBuilder(typeName)
+ .Replace($"`{genericArgumentIds.Count()}", string.Empty)
+ .Append($"[{string.Join(",", genericArgumentIds).TrimEnd(',')}]")
+ .ToString();
+ }
+
+ return typeName;
+ }
+
+ ///
+ /// Determine the fully qualified type name without type parameters.
+ ///
+ ///
+ public static string FullNameSansTypeParameters(this Type type)
+ {
+ var fullName = type.FullName;
+ if (string.IsNullOrEmpty(fullName))
+ fullName = type.Name;
+ var chopIndex = fullName.IndexOf("[[", StringComparison.Ordinal);
+ return (chopIndex == -1) ? fullName : fullName.Substring(0, chopIndex);
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.csproj
new file mode 100644
index 00000000000..2c3b91dd954
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.csproj
@@ -0,0 +1,26 @@
+
+
+ A library generated from a OpenAPI doc
+ No Copyright
+ OpenAPI
+ net6.0
+ true
+ true
+ 1.0.0
+ Library
+ Org.OpenAPITools
+ Org.OpenAPITools
+ cb87e868-8646-48ef-9bb6-344b537d0d37
+ Linux
+ ..\..
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.nuspec b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.nuspec
new file mode 100644
index 00000000000..b1d83a35961
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0-useSwashBuckle/src/Org.OpenAPITools/Org.OpenAPITools.nuspec
@@ -0,0 +1,20 @@
+
+
+
+ $id$
+ 1.0.0
+ OpenAPI Library
+ OpenAPI
+ OpenAPI
+ https://www.apache.org/licenses/LICENSE-2.0.html
+
+ false
+ A library generated from a OpenAPI doc
+ Summary of changes made in this release of the package.
+ No Copyright
+ Org.OpenAPITools
+
+
diff --git a/samples/server/petstore/aspnetcore-6.0/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-6.0/.openapi-generator/FILES
index 9e47b8916d5..2d78823754e 100644
--- a/samples/server/petstore/aspnetcore-6.0/.openapi-generator/FILES
+++ b/samples/server/petstore/aspnetcore-6.0/.openapi-generator/FILES
@@ -14,8 +14,13 @@ src/Org.OpenAPITools/Dockerfile
src/Org.OpenAPITools/Filters/BasePathFilter.cs
src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs
src/Org.OpenAPITools/Formatters/InputFormatterStream.cs
+src/Org.OpenAPITools/Models/Animal.cs
src/Org.OpenAPITools/Models/ApiResponse.cs
+src/Org.OpenAPITools/Models/Cat.cs
+src/Org.OpenAPITools/Models/CatAllOf.cs
src/Org.OpenAPITools/Models/Category.cs
+src/Org.OpenAPITools/Models/Dog.cs
+src/Org.OpenAPITools/Models/DogAllOf.cs
src/Org.OpenAPITools/Models/Order.cs
src/Org.OpenAPITools/Models/Pet.cs
src/Org.OpenAPITools/Models/Tag.cs
diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Animal.cs
new file mode 100644
index 00000000000..01f525396dc
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Animal.cs
@@ -0,0 +1,142 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using JsonSubTypes;
+using Swashbuckle.AspNetCore.Annotations;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ [JsonConverter(typeof(JsonSubtypes), "ClassName")]
+ [SwaggerDiscriminator("ClassName")]
+ [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")]
+ [SwaggerSubType(typeof(Cat), DiscriminatorValue = "CAT")]
+ [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")]
+ [SwaggerSubType(typeof(Dog), DiscriminatorValue = "DOG")]
+ public partial class Animal : IEquatable
+ {
+ ///
+ /// Gets or Sets ClassName
+ ///
+ [Required]
+ [DataMember(Name="className", EmitDefaultValue=false)]
+ public string ClassName { get; set; }
+
+ ///
+ /// Gets or Sets Color
+ ///
+ [DataMember(Name="color", EmitDefaultValue=false)]
+ public string Color { get; set; } = "red";
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Animal {\n");
+ sb.Append(" ClassName: ").Append(ClassName).Append("\n");
+ sb.Append(" Color: ").Append(Color).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Animal)obj);
+ }
+
+ ///
+ /// Returns true if Animal instances are equal
+ ///
+ /// Instance of Animal to be compared
+ /// Boolean
+ public bool Equals(Animal other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ ClassName == other.ClassName ||
+ ClassName != null &&
+ ClassName.Equals(other.ClassName)
+ ) &&
+ (
+ Color == other.Color ||
+ Color != null &&
+ Color.Equals(other.Color)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+ if (ClassName != null)
+ hashCode = hashCode * 59 + ClassName.GetHashCode();
+ if (Color != null)
+ hashCode = hashCode * 59 + Color.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Animal left, Animal right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Animal left, Animal right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Cat.cs
new file mode 100644
index 00000000000..9bb95fe5a4e
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Cat.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class Cat : Animal, IEquatable
+ {
+ ///
+ /// Gets or Sets Declawed
+ ///
+ [DataMember(Name="declawed", EmitDefaultValue=true)]
+ public bool Declawed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Cat {\n");
+ sb.Append(" Declawed: ").Append(Declawed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public new string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Cat)obj);
+ }
+
+ ///
+ /// Returns true if Cat instances are equal
+ ///
+ /// Instance of Cat to be compared
+ /// Boolean
+ public bool Equals(Cat other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Declawed == other.Declawed ||
+
+ Declawed.Equals(other.Declawed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+
+ hashCode = hashCode * 59 + Declawed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Cat left, Cat right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Cat left, Cat right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/CatAllOf.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/CatAllOf.cs
new file mode 100644
index 00000000000..ca2b213b0cf
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/CatAllOf.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class CatAllOf : IEquatable
+ {
+ ///
+ /// Gets or Sets Declawed
+ ///
+ [DataMember(Name="declawed", EmitDefaultValue=true)]
+ public bool Declawed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class CatAllOf {\n");
+ sb.Append(" Declawed: ").Append(Declawed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((CatAllOf)obj);
+ }
+
+ ///
+ /// Returns true if CatAllOf instances are equal
+ ///
+ /// Instance of CatAllOf to be compared
+ /// Boolean
+ public bool Equals(CatAllOf other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Declawed == other.Declawed ||
+
+ Declawed.Equals(other.Declawed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+
+ hashCode = hashCode * 59 + Declawed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(CatAllOf left, CatAllOf right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(CatAllOf left, CatAllOf right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Dog.cs
new file mode 100644
index 00000000000..ff3a582cc13
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/Dog.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class Dog : Animal, IEquatable
+ {
+ ///
+ /// Gets or Sets Breed
+ ///
+ [DataMember(Name="breed", EmitDefaultValue=false)]
+ public string Breed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Dog {\n");
+ sb.Append(" Breed: ").Append(Breed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public new string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((Dog)obj);
+ }
+
+ ///
+ /// Returns true if Dog instances are equal
+ ///
+ /// Instance of Dog to be compared
+ /// Boolean
+ public bool Equals(Dog other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Breed == other.Breed ||
+ Breed != null &&
+ Breed.Equals(other.Breed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+ if (Breed != null)
+ hashCode = hashCode * 59 + Breed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(Dog left, Dog right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(Dog left, Dog right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/DogAllOf.cs b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/DogAllOf.cs
new file mode 100644
index 00000000000..6be8ff2fe4e
--- /dev/null
+++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/Models/DogAllOf.cs
@@ -0,0 +1,119 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
+ *
+ * The version of the OpenAPI document: 1.0.0
+ *
+ * Generated by: https://openapi-generator.tech
+ */
+
+using System;
+using System.Linq;
+using System.Text;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Org.OpenAPITools.Converters;
+
+namespace Org.OpenAPITools.Models
+{
+ ///
+ ///
+ ///
+ [DataContract]
+ public partial class DogAllOf : IEquatable
+ {
+ ///
+ /// Gets or Sets Breed
+ ///
+ [DataMember(Name="breed", EmitDefaultValue=false)]
+ public string Breed { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class DogAllOf {\n");
+ sb.Append(" Breed: ").Append(Breed).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public string ToJson()
+ {
+ return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
+ }
+
+ ///
+ /// Returns true if objects are equal
+ ///
+ /// Object to be compared
+ /// Boolean
+ public override bool Equals(object obj)
+ {
+ if (obj is null) return false;
+ if (ReferenceEquals(this, obj)) return true;
+ return obj.GetType() == GetType() && Equals((DogAllOf)obj);
+ }
+
+ ///
+ /// Returns true if DogAllOf instances are equal
+ ///
+ /// Instance of DogAllOf to be compared
+ /// Boolean
+ public bool Equals(DogAllOf other)
+ {
+ if (other is null) return false;
+ if (ReferenceEquals(this, other)) return true;
+
+ return
+ (
+ Breed == other.Breed ||
+ Breed != null &&
+ Breed.Equals(other.Breed)
+ );
+ }
+
+ ///
+ /// Gets the hash code
+ ///
+ /// Hash code
+ public override int GetHashCode()
+ {
+ unchecked // Overflow is fine, just wrap
+ {
+ var hashCode = 41;
+ // Suitable nullity checks etc, of course :)
+ if (Breed != null)
+ hashCode = hashCode * 59 + Breed.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ #region Operators
+ #pragma warning disable 1591
+
+ public static bool operator ==(DogAllOf left, DogAllOf right)
+ {
+ return Equals(left, right);
+ }
+
+ public static bool operator !=(DogAllOf left, DogAllOf right)
+ {
+ return !Equals(left, right);
+ }
+
+ #pragma warning restore 1591
+ #endregion Operators
+ }
+}
diff --git a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json
index 0ccbb4c793c..53d1a8e9b10 100644
--- a/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json
+++ b/samples/server/petstore/aspnetcore-6.0/src/Org.OpenAPITools/wwwroot/openapi-original.json
@@ -1048,6 +1048,40 @@
"title" : "An uploaded response",
"type" : "object"
},
+ "Dog" : {
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/Animal"
+ }, {
+ "$ref" : "#/components/schemas/Dog_allOf"
+ } ]
+ },
+ "Cat" : {
+ "allOf" : [ {
+ "$ref" : "#/components/schemas/Animal"
+ }, {
+ "$ref" : "#/components/schemas/Cat_allOf"
+ } ]
+ },
+ "Animal" : {
+ "discriminator" : {
+ "mapping" : {
+ "DOG" : "#/components/schemas/Dog",
+ "CAT" : "#/components/schemas/Cat"
+ },
+ "propertyName" : "className"
+ },
+ "properties" : {
+ "className" : {
+ "type" : "string"
+ },
+ "color" : {
+ "default" : "red",
+ "type" : "string"
+ }
+ },
+ "required" : [ "className" ],
+ "type" : "object"
+ },
"updatePetWithForm_request" : {
"properties" : {
"name" : {
@@ -1074,6 +1108,24 @@
}
},
"type" : "object"
+ },
+ "Dog_allOf" : {
+ "properties" : {
+ "breed" : {
+ "type" : "string"
+ }
+ },
+ "type" : "object",
+ "example" : null
+ },
+ "Cat_allOf" : {
+ "properties" : {
+ "declawed" : {
+ "type" : "boolean"
+ }
+ },
+ "type" : "object",
+ "example" : null
}
},
"securitySchemes" : {