OneOf should handle Inheritance based type (#18892)

This commit is contained in:
Ghufran Zahidi
2024-06-15 21:36:56 +05:30
committed by GitHub
parent 642b1a3a95
commit 3d93862c6d
97 changed files with 241 additions and 241 deletions

View File

@@ -70,11 +70,11 @@ namespace Org.OpenAPITools.Model
}
set
{
if (value.GetType() == typeof(Apple))
if (value.GetType() == typeof(Apple) || value is Apple)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(Banana))
else if (value.GetType() == typeof(Banana) || value is Banana)
{
this._actualInstance = value;
}

View File

@@ -79,11 +79,11 @@ namespace Org.OpenAPITools.Model
}
set
{
if (value.GetType() == typeof(AppleReq))
if (value.GetType() == typeof(AppleReq) || value is AppleReq)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(BananaReq))
else if (value.GetType() == typeof(BananaReq) || value is BananaReq)
{
this._actualInstance = value;
}

View File

@@ -82,15 +82,15 @@ namespace Org.OpenAPITools.Model
}
set
{
if (value.GetType() == typeof(Pig))
if (value.GetType() == typeof(Pig) || value is Pig)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(Whale))
else if (value.GetType() == typeof(Whale) || value is Whale)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(Zebra))
else if (value.GetType() == typeof(Zebra) || value is Zebra)
{
this._actualInstance = value;
}

View File

@@ -106,23 +106,23 @@ namespace Org.OpenAPITools.Model
}
set
{
if (value.GetType() == typeof(MixedSubId))
if (value.GetType() == typeof(MixedSubId) || value is MixedSubId)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(bool))
else if (value.GetType() == typeof(bool) || value is bool)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(decimal))
else if (value.GetType() == typeof(decimal) || value is decimal)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(int))
else if (value.GetType() == typeof(int) || value is int)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(string))
else if (value.GetType() == typeof(string) || value is string)
{
this._actualInstance = value;
}

View File

@@ -79,11 +79,11 @@ namespace Org.OpenAPITools.Model
}
set
{
if (value.GetType() == typeof(Quadrilateral))
if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(Triangle))
else if (value.GetType() == typeof(Triangle) || value is Triangle)
{
this._actualInstance = value;
}

View File

@@ -58,7 +58,7 @@ namespace Org.OpenAPITools.Model
}
set
{
if (value.GetType() == typeof(string))
if (value.GetType() == typeof(string) || value is string)
{
this._actualInstance = value;
}

View File

@@ -70,11 +70,11 @@ namespace Org.OpenAPITools.Model
}
set
{
if (value.GetType() == typeof(BasquePig))
if (value.GetType() == typeof(BasquePig) || value is BasquePig)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(DanishPig))
else if (value.GetType() == typeof(DanishPig) || value is DanishPig)
{
this._actualInstance = value;
}

View File

@@ -94,19 +94,19 @@ namespace Org.OpenAPITools.Model
}
set
{
if (value.GetType() == typeof(List<string>))
if (value.GetType() == typeof(List<string>) || value is List<string>)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(Object))
else if (value.GetType() == typeof(Object) || value is Object)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(bool))
else if (value.GetType() == typeof(bool) || value is bool)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(string))
else if (value.GetType() == typeof(string) || value is string)
{
this._actualInstance = value;
}

View File

@@ -70,11 +70,11 @@ namespace Org.OpenAPITools.Model
}
set
{
if (value.GetType() == typeof(ComplexQuadrilateral))
if (value.GetType() == typeof(ComplexQuadrilateral) || value is ComplexQuadrilateral)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(SimpleQuadrilateral))
else if (value.GetType() == typeof(SimpleQuadrilateral) || value is SimpleQuadrilateral)
{
this._actualInstance = value;
}

View File

@@ -70,11 +70,11 @@ namespace Org.OpenAPITools.Model
}
set
{
if (value.GetType() == typeof(Quadrilateral))
if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(Triangle))
else if (value.GetType() == typeof(Triangle) || value is Triangle)
{
this._actualInstance = value;
}

View File

@@ -79,11 +79,11 @@ namespace Org.OpenAPITools.Model
}
set
{
if (value.GetType() == typeof(Quadrilateral))
if (value.GetType() == typeof(Quadrilateral) || value is Quadrilateral)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(Triangle))
else if (value.GetType() == typeof(Triangle) || value is Triangle)
{
this._actualInstance = value;
}

View File

@@ -82,15 +82,15 @@ namespace Org.OpenAPITools.Model
}
set
{
if (value.GetType() == typeof(EquilateralTriangle))
if (value.GetType() == typeof(EquilateralTriangle) || value is EquilateralTriangle)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(IsoscelesTriangle))
else if (value.GetType() == typeof(IsoscelesTriangle) || value is IsoscelesTriangle)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(ScaleneTriangle))
else if (value.GetType() == typeof(ScaleneTriangle) || value is ScaleneTriangle)
{
this._actualInstance = value;
}