forked from loafle/openapi-generator-original
[csharp-netcore] Upgrade to System.Text.Json (#11741)
* refactor nrt annotation * enable nrt by default in .net6.0+ * use shorter nrt annotation * build samples * removed debugging lines * fixed model and operatoin constructors * reverted a commented line for comparison * upgraded to System.Text.Json * build samples * build samples * deleted samples to remove old files * bug fixes * bug fixes * added tasks to track the bugs
This commit is contained in:
@@ -108,12 +108,11 @@ src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs
|
||||
src/Org.OpenAPITools/Client/HttpSigningToken.cs
|
||||
src/Org.OpenAPITools/Client/IApi.cs
|
||||
src/Org.OpenAPITools/Client/OAuthToken.cs
|
||||
src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs
|
||||
src/Org.OpenAPITools/Client/OpenAPIDateJsonConverter.cs
|
||||
src/Org.OpenAPITools/Client/RateLimitProvider`1.cs
|
||||
src/Org.OpenAPITools/Client/TokenBase.cs
|
||||
src/Org.OpenAPITools/Client/TokenContainer`1.cs
|
||||
src/Org.OpenAPITools/Client/TokenProvider`1.cs
|
||||
src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs
|
||||
src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs
|
||||
src/Org.OpenAPITools/Model/Animal.cs
|
||||
src/Org.OpenAPITools/Model/ApiResponse.cs
|
||||
|
||||
@@ -6,7 +6,6 @@ Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ClassName** | **string** | |
|
||||
**Color** | **string** | | [optional] [default to "red"]
|
||||
**Declawed** | **bool** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**PetType** | **string** | | [default to PetTypeEnum.ChildCat]
|
||||
**Name** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ShapeType** | **string** | |
|
||||
**QuadrilateralType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ClassName** | **string** | |
|
||||
**Color** | **string** | | [optional] [default to "red"]
|
||||
**Breed** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ShapeType** | **string** | |
|
||||
**TriangleType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Color** | **string** | | [optional]
|
||||
**Cultivar** | **string** | | [optional]
|
||||
**Origin** | **string** | | [optional]
|
||||
**LengthCm** | **decimal** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Cultivar** | **string** | |
|
||||
**LengthCm** | **decimal** | |
|
||||
**Mealy** | **bool** | | [optional]
|
||||
**Sweet** | **bool** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**Color** | **string** | | [optional]
|
||||
**Cultivar** | **string** | | [optional]
|
||||
**Origin** | **string** | | [optional]
|
||||
**LengthCm** | **decimal** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ShapeType** | **string** | |
|
||||
**TriangleType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ClassName** | **string** | |
|
||||
**HasBaleen** | **bool** | | [optional]
|
||||
**HasTeeth** | **bool** | | [optional]
|
||||
**Type** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Model for testing model name same as property name
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_Name** | **int** | |
|
||||
**NameProperty** | **int** | |
|
||||
**SnakeCase** | **int** | | [optional] [readonly]
|
||||
**Property** | **string** | | [optional]
|
||||
**_123Number** | **int** | | [optional] [readonly]
|
||||
|
||||
@@ -5,8 +5,6 @@ The value may be a shape or the 'null' value. The 'nullable' attribute was intro
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ShapeType** | **string** | |
|
||||
**QuadrilateralType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ClassName** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ShapeType** | **string** | |
|
||||
**QuadrilateralType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Model for testing reserved words
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_Return** | **int** | | [optional]
|
||||
**ReturnProperty** | **int** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ShapeType** | **string** | |
|
||||
**TriangleType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ShapeType** | **string** | |
|
||||
**QuadrilateralType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
@@ -5,7 +5,6 @@ The value may be a shape or the 'null' value. This is introduced in OAS schema >
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ShapeType** | **string** | |
|
||||
**QuadrilateralType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**ShapeType** | **string** | |
|
||||
**QuadrilateralType** | **string** | |
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**SpecialPropertyName** | **long** | | [optional]
|
||||
**_SpecialModelName** | **string** | | [optional]
|
||||
**SpecialModelNameProperty** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
|
||||
@@ -56,14 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Declawed'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void DeclawedTest()
|
||||
{
|
||||
// TODO unit test for the property 'Declawed'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -56,14 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Id'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void IdTest()
|
||||
{
|
||||
// TODO unit test for the property 'Id'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Name'
|
||||
/// </summary>
|
||||
@@ -72,6 +64,14 @@ namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
// TODO unit test for the property 'Name'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Id'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void IdTest()
|
||||
{
|
||||
// TODO unit test for the property 'Id'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -56,22 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Name'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void NameTest()
|
||||
{
|
||||
// TODO unit test for the property 'Name'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'PetType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void PetTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'PetType'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -56,22 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'QuadrilateralType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void QuadrilateralTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'QuadrilateralType'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -56,14 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Breed'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void BreedTest()
|
||||
{
|
||||
// TODO unit test for the property 'Breed'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -56,14 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'EnumString'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void EnumStringTest()
|
||||
{
|
||||
// TODO unit test for the property 'EnumString'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'EnumStringRequired'
|
||||
/// </summary>
|
||||
@@ -73,6 +65,14 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO unit test for the property 'EnumStringRequired'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'EnumString'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void EnumStringTest()
|
||||
{
|
||||
// TODO unit test for the property 'EnumString'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'EnumInteger'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
|
||||
@@ -56,22 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'TriangleType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TriangleTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'TriangleType'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,38 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Number'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void NumberTest()
|
||||
{
|
||||
// TODO unit test for the property 'Number'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Byte'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ByteTest()
|
||||
{
|
||||
// TODO unit test for the property 'Byte'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Date'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void DateTest()
|
||||
{
|
||||
// TODO unit test for the property 'Date'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Password'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void PasswordTest()
|
||||
{
|
||||
// TODO unit test for the property 'Password'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Integer'
|
||||
/// </summary>
|
||||
@@ -81,14 +113,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO unit test for the property 'Int64'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Number'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void NumberTest()
|
||||
{
|
||||
// TODO unit test for the property 'Number'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Float'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
@@ -121,14 +145,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO unit test for the property 'String'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Byte'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ByteTest()
|
||||
{
|
||||
// TODO unit test for the property 'Byte'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Binary'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
@@ -137,14 +153,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO unit test for the property 'Binary'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Date'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void DateTest()
|
||||
{
|
||||
// TODO unit test for the property 'Date'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'DateTime'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
@@ -161,14 +169,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO unit test for the property 'Uuid'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Password'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void PasswordTest()
|
||||
{
|
||||
// TODO unit test for the property 'Password'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'PatternWithDigits'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
|
||||
@@ -56,38 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Cultivar'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void CultivarTest()
|
||||
{
|
||||
// TODO unit test for the property 'Cultivar'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Mealy'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void MealyTest()
|
||||
{
|
||||
// TODO unit test for the property 'Mealy'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'LengthCm'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void LengthCmTest()
|
||||
{
|
||||
// TODO unit test for the property 'LengthCm'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Sweet'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void SweetTest()
|
||||
{
|
||||
// TODO unit test for the property 'Sweet'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -64,30 +64,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
// TODO unit test for the property 'Color'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Cultivar'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void CultivarTest()
|
||||
{
|
||||
// TODO unit test for the property 'Cultivar'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Origin'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void OriginTest()
|
||||
{
|
||||
// TODO unit test for the property 'Origin'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'LengthCm'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void LengthCmTest()
|
||||
{
|
||||
// TODO unit test for the property 'LengthCm'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -64,30 +64,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
// TODO unit test for the property 'Color'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Cultivar'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void CultivarTest()
|
||||
{
|
||||
// TODO unit test for the property 'Cultivar'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Origin'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void OriginTest()
|
||||
{
|
||||
// TODO unit test for the property 'Origin'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'LengthCm'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void LengthCmTest()
|
||||
{
|
||||
// TODO unit test for the property 'LengthCm'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -56,22 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'TriangleType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TriangleTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'TriangleType'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -56,38 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'HasBaleen'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void HasBaleenTest()
|
||||
{
|
||||
// TODO unit test for the property 'HasBaleen'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'HasTeeth'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void HasTeethTest()
|
||||
{
|
||||
// TODO unit test for the property 'HasTeeth'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'ClassName'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ClassNameTest()
|
||||
{
|
||||
// TODO unit test for the property 'ClassName'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Type'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'Type'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -56,22 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'QuadrilateralType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void QuadrilateralTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'QuadrilateralType'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -56,22 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Id'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void IdTest()
|
||||
{
|
||||
// TODO unit test for the property 'Id'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Category'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void CategoryTest()
|
||||
{
|
||||
// TODO unit test for the property 'Category'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Name'
|
||||
/// </summary>
|
||||
@@ -89,6 +73,22 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO unit test for the property 'PhotoUrls'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Id'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void IdTest()
|
||||
{
|
||||
// TODO unit test for the property 'Id'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Category'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void CategoryTest()
|
||||
{
|
||||
// TODO unit test for the property 'Category'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Tags'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
|
||||
@@ -56,14 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ClassName'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ClassNameTest()
|
||||
{
|
||||
// TODO unit test for the property 'ClassName'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -56,22 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'QuadrilateralType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void QuadrilateralTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'QuadrilateralType'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -56,22 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'TriangleType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TriangleTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'TriangleType'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -56,14 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'QuadrilateralType'
|
||||
/// </summary>
|
||||
|
||||
@@ -56,14 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'QuadrilateralType'
|
||||
/// </summary>
|
||||
|
||||
@@ -56,22 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ShapeType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ShapeTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'ShapeType'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'QuadrilateralType'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void QuadrilateralTypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'QuadrilateralType'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,14 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ClassName'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ClassNameTest()
|
||||
{
|
||||
// TODO unit test for the property 'ClassName'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'HasBaleen'
|
||||
/// </summary>
|
||||
@@ -72,14 +80,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
// TODO unit test for the property 'HasTeeth'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'ClassName'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ClassNameTest()
|
||||
{
|
||||
// TODO unit test for the property 'ClassName'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -56,14 +56,6 @@ namespace Org.OpenAPITools.Test.Model
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Type'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'Type'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'ClassName'
|
||||
/// </summary>
|
||||
@@ -72,6 +64,14 @@ namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
// TODO unit test for the property 'ClassName'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'Type'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TypeTest()
|
||||
{
|
||||
// TODO unit test for the property 'Type'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -197,7 +197,8 @@ namespace Org.OpenAPITools.Api
|
||||
if ((modelClient as object) is System.IO.Stream stream)
|
||||
request.Content = new StreamContent(stream);
|
||||
else
|
||||
request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(modelClient, ClientUtils.JsonSerializerSettings));
|
||||
// request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(modelClient, ClientUtils.JsonSerializerSettings));
|
||||
request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(modelClient, ClientUtils.JsonSerializerOptions));
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
@@ -219,7 +220,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Patch;
|
||||
request.Method = HttpMethod.Patch;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -242,7 +243,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<ModelClient?> apiResponse = new ApiResponse<ModelClient?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<ModelClient>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<ModelClient>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Get;
|
||||
request.Method = HttpMethod.Get;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -215,7 +215,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<InlineResponseDefault?> apiResponse = new ApiResponse<InlineResponseDefault?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<InlineResponseDefault>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<InlineResponseDefault>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@@ -772,7 +772,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Get;
|
||||
request.Method = HttpMethod.Get;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -795,7 +795,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<HealthCheckResult?> apiResponse = new ApiResponse<HealthCheckResult?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<HealthCheckResult>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<HealthCheckResult>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -869,7 +869,8 @@ namespace Org.OpenAPITools.Api
|
||||
if ((body as object) is System.IO.Stream stream)
|
||||
request.Content = new StreamContent(stream);
|
||||
else
|
||||
request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, ClientUtils.JsonSerializerSettings));
|
||||
// request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, ClientUtils.JsonSerializerSettings));
|
||||
request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(body, ClientUtils.JsonSerializerOptions));
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
@@ -891,7 +892,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Post;
|
||||
request.Method = HttpMethod.Post;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -914,7 +915,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<bool?> apiResponse = new ApiResponse<bool?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<bool>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<bool>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -988,7 +989,8 @@ namespace Org.OpenAPITools.Api
|
||||
if ((outerComposite as object) is System.IO.Stream stream)
|
||||
request.Content = new StreamContent(stream);
|
||||
else
|
||||
request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(outerComposite, ClientUtils.JsonSerializerSettings));
|
||||
// request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(outerComposite, ClientUtils.JsonSerializerSettings));
|
||||
request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(outerComposite, ClientUtils.JsonSerializerOptions));
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
@@ -1010,7 +1012,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Post;
|
||||
request.Method = HttpMethod.Post;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -1033,7 +1035,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<OuterComposite?> apiResponse = new ApiResponse<OuterComposite?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<OuterComposite>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<OuterComposite>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -1107,7 +1109,8 @@ namespace Org.OpenAPITools.Api
|
||||
if ((body as object) is System.IO.Stream stream)
|
||||
request.Content = new StreamContent(stream);
|
||||
else
|
||||
request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, ClientUtils.JsonSerializerSettings));
|
||||
// request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, ClientUtils.JsonSerializerSettings));
|
||||
request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(body, ClientUtils.JsonSerializerOptions));
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
@@ -1129,7 +1132,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Post;
|
||||
request.Method = HttpMethod.Post;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -1152,7 +1155,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<decimal?> apiResponse = new ApiResponse<decimal?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<decimal>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<decimal>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -1226,7 +1229,8 @@ namespace Org.OpenAPITools.Api
|
||||
if ((body as object) is System.IO.Stream stream)
|
||||
request.Content = new StreamContent(stream);
|
||||
else
|
||||
request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, ClientUtils.JsonSerializerSettings));
|
||||
// request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, ClientUtils.JsonSerializerSettings));
|
||||
request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(body, ClientUtils.JsonSerializerOptions));
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
@@ -1248,7 +1252,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Post;
|
||||
request.Method = HttpMethod.Post;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -1271,7 +1275,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<string?> apiResponse = new ApiResponse<string?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<string>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<string>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -1350,7 +1354,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Get;
|
||||
request.Method = HttpMethod.Get;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -1373,7 +1377,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<List<OuterEnum>?> apiResponse = new ApiResponse<List<OuterEnum>?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<List<OuterEnum>>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<List<OuterEnum>>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -1454,7 +1458,8 @@ namespace Org.OpenAPITools.Api
|
||||
if ((fileSchemaTestClass as object) is System.IO.Stream stream)
|
||||
request.Content = new StreamContent(stream);
|
||||
else
|
||||
request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(fileSchemaTestClass, ClientUtils.JsonSerializerSettings));
|
||||
// request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(fileSchemaTestClass, ClientUtils.JsonSerializerSettings));
|
||||
request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(fileSchemaTestClass, ClientUtils.JsonSerializerOptions));
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
@@ -1467,7 +1472,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (contentType != null)
|
||||
request.Content.Headers.Add("ContentType", contentType);
|
||||
|
||||
request.Method = HttpMethod.Put;
|
||||
request.Method = HttpMethod.Put;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -1490,7 +1495,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -1583,7 +1588,8 @@ namespace Org.OpenAPITools.Api
|
||||
if ((user as object) is System.IO.Stream stream)
|
||||
request.Content = new StreamContent(stream);
|
||||
else
|
||||
request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings));
|
||||
// request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings));
|
||||
request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(user, ClientUtils.JsonSerializerOptions));
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
@@ -1596,7 +1602,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (contentType != null)
|
||||
request.Content.Headers.Add("ContentType", contentType);
|
||||
|
||||
request.Method = HttpMethod.Put;
|
||||
request.Method = HttpMethod.Put;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -1619,7 +1625,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -1700,7 +1706,8 @@ namespace Org.OpenAPITools.Api
|
||||
if ((modelClient as object) is System.IO.Stream stream)
|
||||
request.Content = new StreamContent(stream);
|
||||
else
|
||||
request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(modelClient, ClientUtils.JsonSerializerSettings));
|
||||
// request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(modelClient, ClientUtils.JsonSerializerSettings));
|
||||
request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(modelClient, ClientUtils.JsonSerializerOptions));
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
@@ -1722,7 +1729,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Patch;
|
||||
request.Method = HttpMethod.Patch;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -1745,7 +1752,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<ModelClient?> apiResponse = new ApiResponse<ModelClient?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<ModelClient>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<ModelClient>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -1936,7 +1943,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (contentType != null)
|
||||
request.Content.Headers.Add("ContentType", contentType);
|
||||
|
||||
request.Method = HttpMethod.Post;
|
||||
request.Method = HttpMethod.Post;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -1959,7 +1966,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
else if (apiResponse.StatusCode == (HttpStatusCode) 429)
|
||||
foreach(TokenBase token in tokens)
|
||||
token.BeginRateLimit();
|
||||
@@ -2100,7 +2107,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (contentType != null)
|
||||
request.Content.Headers.Add("ContentType", contentType);
|
||||
|
||||
request.Method = HttpMethod.Get;
|
||||
request.Method = HttpMethod.Get;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -2123,7 +2130,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -2250,7 +2257,7 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
bearerToken.UseInHeader(request, "");
|
||||
|
||||
request.Method = HttpMethod.Delete;
|
||||
request.Method = HttpMethod.Delete;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -2273,7 +2280,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
else if (apiResponse.StatusCode == (HttpStatusCode) 429)
|
||||
foreach(TokenBase token in tokens)
|
||||
token.BeginRateLimit();
|
||||
@@ -2357,7 +2364,8 @@ namespace Org.OpenAPITools.Api
|
||||
if ((requestBody as object) is System.IO.Stream stream)
|
||||
request.Content = new StreamContent(stream);
|
||||
else
|
||||
request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(requestBody, ClientUtils.JsonSerializerSettings));
|
||||
// request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(requestBody, ClientUtils.JsonSerializerSettings));
|
||||
request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(requestBody, ClientUtils.JsonSerializerOptions));
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
@@ -2370,7 +2378,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (contentType != null)
|
||||
request.Content.Headers.Add("ContentType", contentType);
|
||||
|
||||
request.Method = HttpMethod.Post;
|
||||
request.Method = HttpMethod.Post;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -2393,7 +2401,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -2500,7 +2508,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (contentType != null)
|
||||
request.Content.Headers.Add("ContentType", contentType);
|
||||
|
||||
request.Method = HttpMethod.Get;
|
||||
request.Method = HttpMethod.Get;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -2523,7 +2531,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -2637,7 +2645,7 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
request.Method = HttpMethod.Put;
|
||||
request.Method = HttpMethod.Put;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -2660,7 +2668,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@@ -199,7 +199,8 @@ namespace Org.OpenAPITools.Api
|
||||
if ((modelClient as object) is System.IO.Stream stream)
|
||||
request.Content = new StreamContent(stream);
|
||||
else
|
||||
request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(modelClient, ClientUtils.JsonSerializerSettings));
|
||||
// request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(modelClient, ClientUtils.JsonSerializerSettings));
|
||||
request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(modelClient, ClientUtils.JsonSerializerOptions));
|
||||
|
||||
List<TokenBase> tokens = new List<TokenBase>();
|
||||
|
||||
@@ -231,7 +232,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Patch;
|
||||
request.Method = HttpMethod.Patch;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -254,7 +255,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<ModelClient?> apiResponse = new ApiResponse<ModelClient?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<ModelClient>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<ModelClient>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
else if (apiResponse.StatusCode == (HttpStatusCode) 429)
|
||||
foreach(TokenBase token in tokens)
|
||||
token.BeginRateLimit();
|
||||
|
||||
@@ -498,7 +498,8 @@ namespace Org.OpenAPITools.Api
|
||||
if ((pet as object) is System.IO.Stream stream)
|
||||
request.Content = new StreamContent(stream);
|
||||
else
|
||||
request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(pet, ClientUtils.JsonSerializerSettings));
|
||||
// request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(pet, ClientUtils.JsonSerializerSettings));
|
||||
request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(pet, ClientUtils.JsonSerializerOptions));
|
||||
|
||||
List<TokenBase> tokens = new List<TokenBase>();
|
||||
|
||||
@@ -528,7 +529,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (contentType != null)
|
||||
request.Content.Headers.Add("ContentType", contentType);
|
||||
|
||||
request.Method = HttpMethod.Post;
|
||||
request.Method = HttpMethod.Post;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -551,7 +552,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
else if (apiResponse.StatusCode == (HttpStatusCode) 429)
|
||||
foreach(TokenBase token in tokens)
|
||||
token.BeginRateLimit();
|
||||
@@ -652,7 +653,7 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
oauthToken.UseInHeader(request, "");
|
||||
|
||||
request.Method = HttpMethod.Delete;
|
||||
request.Method = HttpMethod.Delete;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -675,7 +676,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
else if (apiResponse.StatusCode == (HttpStatusCode) 429)
|
||||
foreach(TokenBase token in tokens)
|
||||
token.BeginRateLimit();
|
||||
@@ -790,7 +791,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Get;
|
||||
request.Method = HttpMethod.Get;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -813,7 +814,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<List<Pet>?> apiResponse = new ApiResponse<List<Pet>?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Pet>>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<List<Pet>>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
else if (apiResponse.StatusCode == (HttpStatusCode) 429)
|
||||
foreach(TokenBase token in tokens)
|
||||
token.BeginRateLimit();
|
||||
@@ -931,7 +932,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Get;
|
||||
request.Method = HttpMethod.Get;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -954,7 +955,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<List<Pet>?> apiResponse = new ApiResponse<List<Pet>?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Pet>>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<List<Pet>>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
else if (apiResponse.StatusCode == (HttpStatusCode) 429)
|
||||
foreach(TokenBase token in tokens)
|
||||
token.BeginRateLimit();
|
||||
@@ -1059,7 +1060,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Get;
|
||||
request.Method = HttpMethod.Get;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -1082,7 +1083,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<Pet?> apiResponse = new ApiResponse<Pet?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<Pet>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<Pet>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
else if (apiResponse.StatusCode == (HttpStatusCode) 429)
|
||||
foreach(TokenBase token in tokens)
|
||||
token.BeginRateLimit();
|
||||
@@ -1166,7 +1167,8 @@ namespace Org.OpenAPITools.Api
|
||||
if ((pet as object) is System.IO.Stream stream)
|
||||
request.Content = new StreamContent(stream);
|
||||
else
|
||||
request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(pet, ClientUtils.JsonSerializerSettings));
|
||||
// request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(pet, ClientUtils.JsonSerializerSettings));
|
||||
request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(pet, ClientUtils.JsonSerializerOptions));
|
||||
|
||||
List<TokenBase> tokens = new List<TokenBase>();
|
||||
|
||||
@@ -1196,7 +1198,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (contentType != null)
|
||||
request.Content.Headers.Add("ContentType", contentType);
|
||||
|
||||
request.Method = HttpMethod.Put;
|
||||
request.Method = HttpMethod.Put;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -1219,7 +1221,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
else if (apiResponse.StatusCode == (HttpStatusCode) 429)
|
||||
foreach(TokenBase token in tokens)
|
||||
token.BeginRateLimit();
|
||||
@@ -1343,7 +1345,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (contentType != null)
|
||||
request.Content.Headers.Add("ContentType", contentType);
|
||||
|
||||
request.Method = HttpMethod.Post;
|
||||
request.Method = HttpMethod.Post;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -1366,7 +1368,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
else if (apiResponse.StatusCode == (HttpStatusCode) 429)
|
||||
foreach(TokenBase token in tokens)
|
||||
token.BeginRateLimit();
|
||||
@@ -1496,7 +1498,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Post;
|
||||
request.Method = HttpMethod.Post;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -1519,7 +1521,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<ApiResponse?> apiResponse = new ApiResponse<ApiResponse?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<ApiResponse>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<ApiResponse>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
else if (apiResponse.StatusCode == (HttpStatusCode) 429)
|
||||
foreach(TokenBase token in tokens)
|
||||
token.BeginRateLimit();
|
||||
@@ -1651,7 +1653,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Post;
|
||||
request.Method = HttpMethod.Post;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -1674,7 +1676,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<ApiResponse?> apiResponse = new ApiResponse<ApiResponse?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<ApiResponse>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<ApiResponse>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
else if (apiResponse.StatusCode == (HttpStatusCode) 429)
|
||||
foreach(TokenBase token in tokens)
|
||||
token.BeginRateLimit();
|
||||
|
||||
@@ -299,7 +299,7 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
request.Method = HttpMethod.Delete;
|
||||
request.Method = HttpMethod.Delete;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -322,7 +322,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -409,7 +409,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Get;
|
||||
request.Method = HttpMethod.Get;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -432,7 +432,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<Dictionary<string, int>?> apiResponse = new ApiResponse<Dictionary<string, int>?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, int>>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<Dictionary<string, int>>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
else if (apiResponse.StatusCode == (HttpStatusCode) 429)
|
||||
foreach(TokenBase token in tokens)
|
||||
token.BeginRateLimit();
|
||||
@@ -526,7 +526,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Get;
|
||||
request.Method = HttpMethod.Get;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -549,7 +549,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<Order?> apiResponse = new ApiResponse<Order?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<Order>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<Order>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -630,7 +630,8 @@ namespace Org.OpenAPITools.Api
|
||||
if ((order as object) is System.IO.Stream stream)
|
||||
request.Content = new StreamContent(stream);
|
||||
else
|
||||
request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(order, ClientUtils.JsonSerializerSettings));
|
||||
// request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(order, ClientUtils.JsonSerializerSettings));
|
||||
request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(order, ClientUtils.JsonSerializerOptions));
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
@@ -653,7 +654,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Post;
|
||||
request.Method = HttpMethod.Post;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -676,7 +677,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<Order?> apiResponse = new ApiResponse<Order?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<Order>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<Order>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@@ -445,7 +445,8 @@ namespace Org.OpenAPITools.Api
|
||||
if ((user as object) is System.IO.Stream stream)
|
||||
request.Content = new StreamContent(stream);
|
||||
else
|
||||
request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings));
|
||||
// request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings));
|
||||
request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(user, ClientUtils.JsonSerializerOptions));
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
@@ -458,7 +459,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (contentType != null)
|
||||
request.Content.Headers.Add("ContentType", contentType);
|
||||
|
||||
request.Method = HttpMethod.Post;
|
||||
request.Method = HttpMethod.Post;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -481,7 +482,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -562,7 +563,8 @@ namespace Org.OpenAPITools.Api
|
||||
if ((user as object) is System.IO.Stream stream)
|
||||
request.Content = new StreamContent(stream);
|
||||
else
|
||||
request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings));
|
||||
// request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings));
|
||||
request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(user, ClientUtils.JsonSerializerOptions));
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
@@ -575,7 +577,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (contentType != null)
|
||||
request.Content.Headers.Add("ContentType", contentType);
|
||||
|
||||
request.Method = HttpMethod.Post;
|
||||
request.Method = HttpMethod.Post;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -598,7 +600,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -679,7 +681,8 @@ namespace Org.OpenAPITools.Api
|
||||
if ((user as object) is System.IO.Stream stream)
|
||||
request.Content = new StreamContent(stream);
|
||||
else
|
||||
request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings));
|
||||
// request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings));
|
||||
request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(user, ClientUtils.JsonSerializerOptions));
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
@@ -692,7 +695,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (contentType != null)
|
||||
request.Content.Headers.Add("ContentType", contentType);
|
||||
|
||||
request.Method = HttpMethod.Post;
|
||||
request.Method = HttpMethod.Post;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -715,7 +718,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -796,7 +799,7 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
request.Method = HttpMethod.Delete;
|
||||
request.Method = HttpMethod.Delete;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -819,7 +822,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -910,7 +913,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Get;
|
||||
request.Method = HttpMethod.Get;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -933,7 +936,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<User?> apiResponse = new ApiResponse<User?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<User>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<User>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -1036,7 +1039,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (accept != null)
|
||||
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(accept));
|
||||
|
||||
request.Method = HttpMethod.Get;
|
||||
request.Method = HttpMethod.Get;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -1059,7 +1062,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<string?> apiResponse = new ApiResponse<string?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<string>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<string>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -1129,7 +1132,7 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
request.Method = HttpMethod.Get;
|
||||
request.Method = HttpMethod.Get;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -1152,7 +1155,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
@@ -1240,7 +1243,8 @@ namespace Org.OpenAPITools.Api
|
||||
if ((user as object) is System.IO.Stream stream)
|
||||
request.Content = new StreamContent(stream);
|
||||
else
|
||||
request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings));
|
||||
// request.Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user, ClientUtils.JsonSerializerSettings));
|
||||
request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(user, ClientUtils.JsonSerializerOptions));
|
||||
|
||||
request.RequestUri = uriBuilder.Uri;
|
||||
|
||||
@@ -1253,7 +1257,7 @@ namespace Org.OpenAPITools.Api
|
||||
if (contentType != null)
|
||||
request.Content.Headers.Add("ContentType", contentType);
|
||||
|
||||
request.Method = HttpMethod.Put;
|
||||
request.Method = HttpMethod.Put;
|
||||
|
||||
using (HttpResponseMessage responseMessage = await HttpClient.SendAsync(request, cancellationToken.GetValueOrDefault()).ConfigureAwait(false))
|
||||
{
|
||||
@@ -1276,7 +1280,7 @@ namespace Org.OpenAPITools.Api
|
||||
ApiResponse<object?> apiResponse = new ApiResponse<object?>(responseMessage, responseContent);
|
||||
|
||||
if (apiResponse.IsSuccessStatusCode)
|
||||
apiResponse.Content = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(apiResponse.RawContent, ClientUtils.JsonSerializerSettings);
|
||||
apiResponse.Content = System.Text.Json.JsonSerializer.Deserialize<object>(apiResponse.RawContent, ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
|
||||
@@ -52,21 +52,53 @@ namespace Org.OpenAPITools.Client
|
||||
public delegate void EventHandler<T>(object sender, T e) where T : EventArgs;
|
||||
|
||||
/// <summary>
|
||||
/// Custom JSON serializer
|
||||
/// Returns true when deserialization succeeds.
|
||||
/// </summary>
|
||||
public static Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get; set; } = new Newtonsoft.Json.JsonSerializerSettings
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="json"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <param name="result"></param>
|
||||
/// <returns></returns>
|
||||
public static bool TryDeserialize<T>(string json, System.Text.Json.JsonSerializerOptions options, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out T? result)
|
||||
{
|
||||
// OpenAPI generated types generally hide default constructors.
|
||||
ConstructorHandling = Newtonsoft.Json.ConstructorHandling.AllowNonPublicDefaultConstructor,
|
||||
MissingMemberHandling = Newtonsoft.Json.MissingMemberHandling.Ignore,
|
||||
ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver
|
||||
try
|
||||
{
|
||||
NamingStrategy = new Newtonsoft.Json.Serialization.CamelCaseNamingStrategy
|
||||
{
|
||||
OverrideSpecifiedNames = false
|
||||
}
|
||||
result = System.Text.Json.JsonSerializer.Deserialize<T>(json, options);
|
||||
return result != null;
|
||||
}
|
||||
};
|
||||
catch (Exception)
|
||||
{
|
||||
result = default;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true when deserialization succeeds.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="reader"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <param name="result"></param>
|
||||
/// <returns></returns>
|
||||
public static bool TryDeserialize<T>(ref System.Text.Json.Utf8JsonReader reader, System.Text.Json.JsonSerializerOptions options, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out T? result)
|
||||
{
|
||||
try
|
||||
{
|
||||
result = System.Text.Json.JsonSerializer.Deserialize<T>(ref reader, options);
|
||||
return result != null;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result = default;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Json serializer options
|
||||
/// </summary>
|
||||
public static System.Text.Json.JsonSerializerOptions JsonSerializerOptions { get; set; } = new System.Text.Json.JsonSerializerOptions();
|
||||
|
||||
/// <summary>
|
||||
/// Sanitize filename by removing the path
|
||||
@@ -175,7 +207,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// </summary>
|
||||
/// <param name="contentTypes">The Content-Type array to select from.</param>
|
||||
/// <returns>The Content-Type header to use.</returns>
|
||||
public static string SelectHeaderContentType(string[] contentTypes)
|
||||
public static string? SelectHeaderContentType(string[] contentTypes)
|
||||
{
|
||||
if (contentTypes.Length == 0)
|
||||
return null;
|
||||
@@ -196,7 +228,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// </summary>
|
||||
/// <param name="accepts">The accepts array to select from.</param>
|
||||
/// <returns>The Accept header to use.</returns>
|
||||
public static string SelectHeaderAccept(string[] accepts)
|
||||
public static string? SelectHeaderAccept(string[] accepts)
|
||||
{
|
||||
if (accepts.Length == 0)
|
||||
return null;
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Linq;
|
||||
using System.Net.Http;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Model;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
@@ -89,6 +90,26 @@ namespace Org.OpenAPITools.Client
|
||||
public HostConfiguration AddApiHttpClients(
|
||||
Action<HttpClient>? client = null, Action<IHttpClientBuilder>? builder = null)
|
||||
{
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new OpenAPIDateJsonConverter());
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new CatJsonConverter());
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new ChildCatJsonConverter());
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new ComplexQuadrilateralJsonConverter());
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new DogJsonConverter());
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new EquilateralTriangleJsonConverter());
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new FruitJsonConverter());
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new FruitReqJsonConverter());
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new GmFruitJsonConverter());
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new IsoscelesTriangleJsonConverter());
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new MammalJsonConverter());
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new NullableShapeJsonConverter());
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new PigJsonConverter());
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new QuadrilateralJsonConverter());
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new ScaleneTriangleJsonConverter());
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new ShapeJsonConverter());
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new ShapeOrNullJsonConverter());
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new SimpleQuadrilateralJsonConverter());
|
||||
ClientUtils.JsonSerializerOptions.Converters.Add(new TriangleJsonConverter());
|
||||
|
||||
AddApiHttpClients<AnotherFakeApi, DefaultApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi>(client, builder);
|
||||
|
||||
return this;
|
||||
@@ -99,9 +120,9 @@ namespace Org.OpenAPITools.Client
|
||||
/// </summary>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
public HostConfiguration ConfigureJsonOptions(Action<Newtonsoft.Json.JsonSerializerSettings> options)
|
||||
public HostConfiguration ConfigureJsonOptions(Action<System.Text.Json.JsonSerializerOptions> options)
|
||||
{
|
||||
options(Client.ClientUtils.JsonSerializerSettings);
|
||||
options(Client.ClientUtils.JsonSerializerOptions);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Formatter for 'date' openapi formats ss defined by full-date - RFC3339
|
||||
/// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types
|
||||
/// </summary>
|
||||
public class OpenAPIDateConverter : IsoDateTimeConverter
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OpenAPIDateConverter" /> class.
|
||||
/// </summary>
|
||||
public OpenAPIDateConverter()
|
||||
{
|
||||
// full-date = date-fullyear "-" date-month "-" date-mday
|
||||
DateTimeFormat = "yyyy-MM-dd";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Formatter for 'date' openapi formats ss defined by full-date - RFC3339
|
||||
/// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types
|
||||
/// </summary>
|
||||
public class OpenAPIDateJsonConverter : JsonConverter<DateTime>
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a DateTime from the Json object
|
||||
/// </summary>
|
||||
/// <param name="reader"></param>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) =>
|
||||
DateTime.ParseExact(reader.GetString()!, "yyyy-MM-dd", CultureInfo.InvariantCulture);
|
||||
|
||||
/// <summary>
|
||||
/// Writes the DateTime to the json writer
|
||||
/// </summary>
|
||||
/// <param name="writer"></param>
|
||||
/// <param name="dateTimeValue"></param>
|
||||
/// <param name="options"></param>
|
||||
public override void Write(Utf8JsonWriter writer, DateTime dateTimeValue, JsonSerializerOptions options) =>
|
||||
writer.WriteStringValue(dateTimeValue.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification
|
||||
/// </summary>
|
||||
public abstract partial class AbstractOpenAPISchema
|
||||
{
|
||||
/// <summary>
|
||||
/// Custom JSON serializer
|
||||
/// </summary>
|
||||
static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings
|
||||
{
|
||||
// OpenAPI generated types generally hide default constructors.
|
||||
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
|
||||
MissingMemberHandling = MissingMemberHandling.Error,
|
||||
ContractResolver = new DefaultContractResolver
|
||||
{
|
||||
NamingStrategy = new CamelCaseNamingStrategy
|
||||
{
|
||||
OverrideSpecifiedNames = false
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Custom JSON serializer for objects with additional properties
|
||||
/// </summary>
|
||||
static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings
|
||||
{
|
||||
// OpenAPI generated types generally hide default constructors.
|
||||
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
|
||||
MissingMemberHandling = MissingMemberHandling.Ignore,
|
||||
ContractResolver = new DefaultContractResolver
|
||||
{
|
||||
NamingStrategy = new CamelCaseNamingStrategy
|
||||
{
|
||||
OverrideSpecifiedNames = false
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets the actual instance
|
||||
/// </summary>
|
||||
public abstract Object ActualInstance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets IsNullable to indicate whether the instance is nullable
|
||||
/// </summary>
|
||||
public bool IsNullable { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets the schema type, which can be either `oneOf` or `anyOf`
|
||||
/// </summary>
|
||||
public string SchemaType { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Converts the instance into JSON string.
|
||||
/// </summary>
|
||||
public abstract string ToJson();
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,87 +29,85 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// AdditionalPropertiesClass
|
||||
/// </summary>
|
||||
[DataContract(Name = "AdditionalPropertiesClass")]
|
||||
public partial class AdditionalPropertiesClass : IEquatable<AdditionalPropertiesClass>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AdditionalPropertiesClass" /> class.
|
||||
/// </summary>
|
||||
/// <param name="mapProperty">mapProperty.</param>
|
||||
/// <param name="mapOfMapProperty">mapOfMapProperty.</param>
|
||||
/// <param name="anytype1">anytype1.</param>
|
||||
/// <param name="mapWithUndeclaredPropertiesAnytype1">mapWithUndeclaredPropertiesAnytype1.</param>
|
||||
/// <param name="mapWithUndeclaredPropertiesAnytype2">mapWithUndeclaredPropertiesAnytype2.</param>
|
||||
/// <param name="mapWithUndeclaredPropertiesAnytype3">mapWithUndeclaredPropertiesAnytype3.</param>
|
||||
/// <param name="emptyMap">an object with no declared properties and no undeclared properties, hence it's an empty map..</param>
|
||||
/// <param name="mapWithUndeclaredPropertiesString">mapWithUndeclaredPropertiesString.</param>
|
||||
/// <param name="mapProperty">mapProperty</param>
|
||||
/// <param name="mapOfMapProperty">mapOfMapProperty</param>
|
||||
/// <param name="anytype1">anytype1</param>
|
||||
/// <param name="mapWithUndeclaredPropertiesAnytype1">mapWithUndeclaredPropertiesAnytype1</param>
|
||||
/// <param name="mapWithUndeclaredPropertiesAnytype2">mapWithUndeclaredPropertiesAnytype2</param>
|
||||
/// <param name="mapWithUndeclaredPropertiesAnytype3">mapWithUndeclaredPropertiesAnytype3</param>
|
||||
/// <param name="emptyMap">an object with no declared properties and no undeclared properties, hence it's an empty map.</param>
|
||||
/// <param name="mapWithUndeclaredPropertiesString">mapWithUndeclaredPropertiesString</param>
|
||||
public AdditionalPropertiesClass(Dictionary<string, string>? mapProperty = default, Dictionary<string, Dictionary<string, string>>? mapOfMapProperty = default, Object? anytype1 = default, Object? mapWithUndeclaredPropertiesAnytype1 = default, Object? mapWithUndeclaredPropertiesAnytype2 = default, Dictionary<string, Object>? mapWithUndeclaredPropertiesAnytype3 = default, Object? emptyMap = default, Dictionary<string, string>? mapWithUndeclaredPropertiesString = default)
|
||||
{
|
||||
this.MapProperty = mapProperty;
|
||||
this.MapOfMapProperty = mapOfMapProperty;
|
||||
this.Anytype1 = anytype1;
|
||||
this.MapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1;
|
||||
this.MapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2;
|
||||
this.MapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3;
|
||||
this.EmptyMap = emptyMap;
|
||||
this.MapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
MapProperty = mapProperty;
|
||||
MapOfMapProperty = mapOfMapProperty;
|
||||
Anytype1 = anytype1;
|
||||
MapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1;
|
||||
MapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2;
|
||||
MapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3;
|
||||
EmptyMap = emptyMap;
|
||||
MapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets MapProperty
|
||||
/// </summary>
|
||||
[DataMember(Name = "map_property", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("map_property")]
|
||||
public Dictionary<string, string>? MapProperty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets MapOfMapProperty
|
||||
/// </summary>
|
||||
[DataMember(Name = "map_of_map_property", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("map_of_map_property")]
|
||||
public Dictionary<string, Dictionary<string, string>>? MapOfMapProperty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Anytype1
|
||||
/// </summary>
|
||||
[DataMember(Name = "anytype_1", EmitDefaultValue = true)]
|
||||
[JsonPropertyName("anytype_1")]
|
||||
public Object? Anytype1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets MapWithUndeclaredPropertiesAnytype1
|
||||
/// </summary>
|
||||
[DataMember(Name = "map_with_undeclared_properties_anytype_1", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("map_with_undeclared_properties_anytype_1")]
|
||||
public Object? MapWithUndeclaredPropertiesAnytype1 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets MapWithUndeclaredPropertiesAnytype2
|
||||
/// </summary>
|
||||
[DataMember(Name = "map_with_undeclared_properties_anytype_2", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("map_with_undeclared_properties_anytype_2")]
|
||||
public Object? MapWithUndeclaredPropertiesAnytype2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets MapWithUndeclaredPropertiesAnytype3
|
||||
/// </summary>
|
||||
[DataMember(Name = "map_with_undeclared_properties_anytype_3", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("map_with_undeclared_properties_anytype_3")]
|
||||
public Dictionary<string, Object>? MapWithUndeclaredPropertiesAnytype3 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// an object with no declared properties and no undeclared properties, hence it's an empty map.
|
||||
/// </summary>
|
||||
/// <value>an object with no declared properties and no undeclared properties, hence it's an empty map.</value>
|
||||
[DataMember(Name = "empty_map", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("empty_map")]
|
||||
public Object? EmptyMap { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets MapWithUndeclaredPropertiesString
|
||||
/// </summary>
|
||||
[DataMember(Name = "map_with_undeclared_properties_string", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("map_with_undeclared_properties_string")]
|
||||
public Dictionary<string, string>? MapWithUndeclaredPropertiesString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -132,21 +130,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as AdditionalPropertiesClass).AreEqual;
|
||||
}
|
||||
@@ -156,7 +145,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of AdditionalPropertiesClass to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(AdditionalPropertiesClass input)
|
||||
public bool Equals(AdditionalPropertiesClass? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,12 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using JsonSubTypes;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -30,54 +29,38 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Animal
|
||||
/// </summary>
|
||||
[DataContract(Name = "Animal")]
|
||||
[JsonConverter(typeof(JsonSubtypes), "ClassName")]
|
||||
[JsonSubtypes.KnownSubType(typeof(Cat), "Cat")]
|
||||
[JsonSubtypes.KnownSubType(typeof(Dog), "Dog")]
|
||||
public partial class Animal : IEquatable<Animal>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Animal" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
protected Animal()
|
||||
{
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Animal" /> class.
|
||||
/// </summary>
|
||||
/// <param name="className">className (required).</param>
|
||||
/// <param name="color">color (default to "red").</param>
|
||||
/// <param name="className">className (required)</param>
|
||||
/// <param name="color">color (default to "red")</param>
|
||||
public Animal(string className, string? color = "red")
|
||||
{
|
||||
// to ensure "className" is required (not null)
|
||||
if (className == null) {
|
||||
throw new ArgumentNullException("className is a required property for Animal and cannot be null");
|
||||
}
|
||||
this.ClassName = className;
|
||||
// use default value if no "color" provided
|
||||
this.Color = color ?? "red";
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
if (className == null)
|
||||
throw new ArgumentNullException("className is a required property for Animal and cannot be null.");
|
||||
ClassName = className;
|
||||
Color = color;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ClassName
|
||||
/// </summary>
|
||||
[DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)]
|
||||
[JsonPropertyName("className")]
|
||||
public string ClassName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Color
|
||||
/// </summary>
|
||||
[DataMember(Name = "color", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("color")]
|
||||
public string? Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -94,21 +77,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as Animal).AreEqual;
|
||||
}
|
||||
@@ -118,7 +92,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of Animal to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Animal input)
|
||||
public bool Equals(Animal? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,46 +29,44 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// ApiResponse
|
||||
/// </summary>
|
||||
[DataContract(Name = "ApiResponse")]
|
||||
public partial class ApiResponse : IEquatable<ApiResponse>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiResponse" /> class.
|
||||
/// </summary>
|
||||
/// <param name="code">code.</param>
|
||||
/// <param name="type">type.</param>
|
||||
/// <param name="message">message.</param>
|
||||
/// <param name="code">code</param>
|
||||
/// <param name="type">type</param>
|
||||
/// <param name="message">message</param>
|
||||
public ApiResponse(int? code = default, string? type = default, string? message = default)
|
||||
{
|
||||
this.Code = code;
|
||||
this.Type = type;
|
||||
this.Message = message;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
Code = code;
|
||||
Type = type;
|
||||
Message = message;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Code
|
||||
/// </summary>
|
||||
[DataMember(Name = "code", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("code")]
|
||||
public int? Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Type
|
||||
/// </summary>
|
||||
[DataMember(Name = "type", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("type")]
|
||||
public string? Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Message
|
||||
/// </summary>
|
||||
[DataMember(Name = "message", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -86,21 +84,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as ApiResponse).AreEqual;
|
||||
}
|
||||
@@ -110,7 +99,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of ApiResponse to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ApiResponse input)
|
||||
public bool Equals(ApiResponse? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,38 +29,36 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Apple
|
||||
/// </summary>
|
||||
[DataContract(Name = "apple")]
|
||||
public partial class Apple : IEquatable<Apple>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Apple" /> class.
|
||||
/// </summary>
|
||||
/// <param name="cultivar">cultivar.</param>
|
||||
/// <param name="origin">origin.</param>
|
||||
/// <param name="cultivar">cultivar</param>
|
||||
/// <param name="origin">origin</param>
|
||||
public Apple(string? cultivar = default, string? origin = default)
|
||||
{
|
||||
this.Cultivar = cultivar;
|
||||
this.Origin = origin;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
Cultivar = cultivar;
|
||||
Origin = origin;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Cultivar
|
||||
/// </summary>
|
||||
[DataMember(Name = "cultivar", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("cultivar")]
|
||||
public string? Cultivar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Origin
|
||||
/// </summary>
|
||||
[DataMember(Name = "origin", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("origin")]
|
||||
public string? Origin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -77,21 +75,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as Apple).AreEqual;
|
||||
}
|
||||
@@ -101,7 +90,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of Apple to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Apple input)
|
||||
public bool Equals(Apple? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,39 +29,31 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// AppleReq
|
||||
/// </summary>
|
||||
[DataContract(Name = "appleReq")]
|
||||
public partial class AppleReq : IEquatable<AppleReq>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AppleReq" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
protected AppleReq() { }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AppleReq" /> class.
|
||||
/// </summary>
|
||||
/// <param name="cultivar">cultivar (required).</param>
|
||||
/// <param name="mealy">mealy.</param>
|
||||
/// <param name="cultivar">cultivar (required)</param>
|
||||
/// <param name="mealy">mealy</param>
|
||||
public AppleReq(string cultivar, bool? mealy = default)
|
||||
{
|
||||
// to ensure "cultivar" is required (not null)
|
||||
if (cultivar == null) {
|
||||
throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null");
|
||||
}
|
||||
this.Cultivar = cultivar;
|
||||
this.Mealy = mealy;
|
||||
if (cultivar == null)
|
||||
throw new ArgumentNullException("cultivar is a required property for AppleReq and cannot be null.");
|
||||
Cultivar = cultivar;
|
||||
Mealy = mealy;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Cultivar
|
||||
/// </summary>
|
||||
[DataMember(Name = "cultivar", IsRequired = true, EmitDefaultValue = false)]
|
||||
[JsonPropertyName("cultivar")]
|
||||
public string Cultivar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Mealy
|
||||
/// </summary>
|
||||
[DataMember(Name = "mealy", EmitDefaultValue = true)]
|
||||
[JsonPropertyName("mealy")]
|
||||
public bool? Mealy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -78,21 +70,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as AppleReq).AreEqual;
|
||||
}
|
||||
@@ -102,7 +85,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of AppleReq to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(AppleReq input)
|
||||
public bool Equals(AppleReq? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,30 +29,28 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// ArrayOfArrayOfNumberOnly
|
||||
/// </summary>
|
||||
[DataContract(Name = "ArrayOfArrayOfNumberOnly")]
|
||||
public partial class ArrayOfArrayOfNumberOnly : IEquatable<ArrayOfArrayOfNumberOnly>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ArrayOfArrayOfNumberOnly" /> class.
|
||||
/// </summary>
|
||||
/// <param name="arrayArrayNumber">arrayArrayNumber.</param>
|
||||
/// <param name="arrayArrayNumber">arrayArrayNumber</param>
|
||||
public ArrayOfArrayOfNumberOnly(List<List<decimal>>? arrayArrayNumber = default)
|
||||
{
|
||||
this.ArrayArrayNumber = arrayArrayNumber;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
ArrayArrayNumber = arrayArrayNumber;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayArrayNumber
|
||||
/// </summary>
|
||||
[DataMember(Name = "ArrayArrayNumber", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("ArrayArrayNumber")]
|
||||
public List<List<decimal>>? ArrayArrayNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -68,21 +66,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as ArrayOfArrayOfNumberOnly).AreEqual;
|
||||
}
|
||||
@@ -92,7 +81,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of ArrayOfArrayOfNumberOnly to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ArrayOfArrayOfNumberOnly input)
|
||||
public bool Equals(ArrayOfArrayOfNumberOnly? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,30 +29,28 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// ArrayOfNumberOnly
|
||||
/// </summary>
|
||||
[DataContract(Name = "ArrayOfNumberOnly")]
|
||||
public partial class ArrayOfNumberOnly : IEquatable<ArrayOfNumberOnly>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ArrayOfNumberOnly" /> class.
|
||||
/// </summary>
|
||||
/// <param name="arrayNumber">arrayNumber.</param>
|
||||
/// <param name="arrayNumber">arrayNumber</param>
|
||||
public ArrayOfNumberOnly(List<decimal>? arrayNumber = default)
|
||||
{
|
||||
this.ArrayNumber = arrayNumber;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
ArrayNumber = arrayNumber;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayNumber
|
||||
/// </summary>
|
||||
[DataMember(Name = "ArrayNumber", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("ArrayNumber")]
|
||||
public List<decimal>? ArrayNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -68,21 +66,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as ArrayOfNumberOnly).AreEqual;
|
||||
}
|
||||
@@ -92,7 +81,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of ArrayOfNumberOnly to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ArrayOfNumberOnly input)
|
||||
public bool Equals(ArrayOfNumberOnly? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,46 +29,44 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// ArrayTest
|
||||
/// </summary>
|
||||
[DataContract(Name = "ArrayTest")]
|
||||
public partial class ArrayTest : IEquatable<ArrayTest>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ArrayTest" /> class.
|
||||
/// </summary>
|
||||
/// <param name="arrayOfString">arrayOfString.</param>
|
||||
/// <param name="arrayArrayOfInteger">arrayArrayOfInteger.</param>
|
||||
/// <param name="arrayArrayOfModel">arrayArrayOfModel.</param>
|
||||
/// <param name="arrayOfString">arrayOfString</param>
|
||||
/// <param name="arrayArrayOfInteger">arrayArrayOfInteger</param>
|
||||
/// <param name="arrayArrayOfModel">arrayArrayOfModel</param>
|
||||
public ArrayTest(List<string>? arrayOfString = default, List<List<long>>? arrayArrayOfInteger = default, List<List<ReadOnlyFirst>>? arrayArrayOfModel = default)
|
||||
{
|
||||
this.ArrayOfString = arrayOfString;
|
||||
this.ArrayArrayOfInteger = arrayArrayOfInteger;
|
||||
this.ArrayArrayOfModel = arrayArrayOfModel;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
ArrayOfString = arrayOfString;
|
||||
ArrayArrayOfInteger = arrayArrayOfInteger;
|
||||
ArrayArrayOfModel = arrayArrayOfModel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayOfString
|
||||
/// </summary>
|
||||
[DataMember(Name = "array_of_string", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("array_of_string")]
|
||||
public List<string>? ArrayOfString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayArrayOfInteger
|
||||
/// </summary>
|
||||
[DataMember(Name = "array_array_of_integer", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("array_array_of_integer")]
|
||||
public List<List<long>>? ArrayArrayOfInteger { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayArrayOfModel
|
||||
/// </summary>
|
||||
[DataMember(Name = "array_array_of_model", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("array_array_of_model")]
|
||||
public List<List<ReadOnlyFirst>>? ArrayArrayOfModel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -86,21 +84,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as ArrayTest).AreEqual;
|
||||
}
|
||||
@@ -110,7 +99,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of ArrayTest to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ArrayTest input)
|
||||
public bool Equals(ArrayTest? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,30 +29,28 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Banana
|
||||
/// </summary>
|
||||
[DataContract(Name = "banana")]
|
||||
public partial class Banana : IEquatable<Banana>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Banana" /> class.
|
||||
/// </summary>
|
||||
/// <param name="lengthCm">lengthCm.</param>
|
||||
/// <param name="lengthCm">lengthCm</param>
|
||||
public Banana(decimal? lengthCm = default)
|
||||
{
|
||||
this.LengthCm = lengthCm;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
LengthCm = lengthCm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets LengthCm
|
||||
/// </summary>
|
||||
[DataMember(Name = "lengthCm", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("lengthCm")]
|
||||
public decimal? LengthCm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -68,21 +66,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as Banana).AreEqual;
|
||||
}
|
||||
@@ -92,7 +81,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of Banana to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Banana input)
|
||||
public bool Equals(Banana? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,35 +29,31 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// BananaReq
|
||||
/// </summary>
|
||||
[DataContract(Name = "bananaReq")]
|
||||
public partial class BananaReq : IEquatable<BananaReq>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BananaReq" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
protected BananaReq() { }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BananaReq" /> class.
|
||||
/// </summary>
|
||||
/// <param name="lengthCm">lengthCm (required).</param>
|
||||
/// <param name="sweet">sweet.</param>
|
||||
/// <param name="lengthCm">lengthCm (required)</param>
|
||||
/// <param name="sweet">sweet</param>
|
||||
public BananaReq(decimal lengthCm, bool? sweet = default)
|
||||
{
|
||||
this.LengthCm = lengthCm;
|
||||
this.Sweet = sweet;
|
||||
if (lengthCm == null)
|
||||
throw new ArgumentNullException("lengthCm is a required property for BananaReq and cannot be null.");
|
||||
LengthCm = lengthCm;
|
||||
Sweet = sweet;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets LengthCm
|
||||
/// </summary>
|
||||
[DataMember(Name = "lengthCm", IsRequired = true, EmitDefaultValue = false)]
|
||||
[JsonPropertyName("lengthCm")]
|
||||
public decimal LengthCm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Sweet
|
||||
/// </summary>
|
||||
[DataMember(Name = "sweet", EmitDefaultValue = true)]
|
||||
[JsonPropertyName("sweet")]
|
||||
public bool? Sweet { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -74,21 +70,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as BananaReq).AreEqual;
|
||||
}
|
||||
@@ -98,7 +85,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of BananaReq to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(BananaReq input)
|
||||
public bool Equals(BananaReq? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,42 +29,30 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// BasquePig
|
||||
/// </summary>
|
||||
[DataContract(Name = "BasquePig")]
|
||||
public partial class BasquePig : IEquatable<BasquePig>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BasquePig" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
protected BasquePig()
|
||||
{
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BasquePig" /> class.
|
||||
/// </summary>
|
||||
/// <param name="className">className (required).</param>
|
||||
/// <param name="className">className (required)</param>
|
||||
public BasquePig(string className)
|
||||
{
|
||||
// to ensure "className" is required (not null)
|
||||
if (className == null) {
|
||||
throw new ArgumentNullException("className is a required property for BasquePig and cannot be null");
|
||||
}
|
||||
this.ClassName = className;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
if (className == null)
|
||||
throw new ArgumentNullException("className is a required property for BasquePig and cannot be null.");
|
||||
ClassName = className;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ClassName
|
||||
/// </summary>
|
||||
[DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)]
|
||||
[JsonPropertyName("className")]
|
||||
public string ClassName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -80,21 +68,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as BasquePig).AreEqual;
|
||||
}
|
||||
@@ -104,7 +83,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of BasquePig to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(BasquePig input)
|
||||
public bool Equals(BasquePig? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,71 +29,69 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Capitalization
|
||||
/// </summary>
|
||||
[DataContract(Name = "Capitalization")]
|
||||
public partial class Capitalization : IEquatable<Capitalization>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Capitalization" /> class.
|
||||
/// </summary>
|
||||
/// <param name="smallCamel">smallCamel.</param>
|
||||
/// <param name="capitalCamel">capitalCamel.</param>
|
||||
/// <param name="smallSnake">smallSnake.</param>
|
||||
/// <param name="capitalSnake">capitalSnake.</param>
|
||||
/// <param name="sCAETHFlowPoints">sCAETHFlowPoints.</param>
|
||||
/// <param name="aTTNAME">Name of the pet .</param>
|
||||
/// <param name="smallCamel">smallCamel</param>
|
||||
/// <param name="capitalCamel">capitalCamel</param>
|
||||
/// <param name="smallSnake">smallSnake</param>
|
||||
/// <param name="capitalSnake">capitalSnake</param>
|
||||
/// <param name="sCAETHFlowPoints">sCAETHFlowPoints</param>
|
||||
/// <param name="aTTNAME">Name of the pet </param>
|
||||
public Capitalization(string? smallCamel = default, string? capitalCamel = default, string? smallSnake = default, string? capitalSnake = default, string? sCAETHFlowPoints = default, string? aTTNAME = default)
|
||||
{
|
||||
this.SmallCamel = smallCamel;
|
||||
this.CapitalCamel = capitalCamel;
|
||||
this.SmallSnake = smallSnake;
|
||||
this.CapitalSnake = capitalSnake;
|
||||
this.SCAETHFlowPoints = sCAETHFlowPoints;
|
||||
this.ATT_NAME = aTTNAME;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
SmallCamel = smallCamel;
|
||||
CapitalCamel = capitalCamel;
|
||||
SmallSnake = smallSnake;
|
||||
CapitalSnake = capitalSnake;
|
||||
SCAETHFlowPoints = sCAETHFlowPoints;
|
||||
ATT_NAME = aTTNAME;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets SmallCamel
|
||||
/// </summary>
|
||||
[DataMember(Name = "smallCamel", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("smallCamel")]
|
||||
public string? SmallCamel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets CapitalCamel
|
||||
/// </summary>
|
||||
[DataMember(Name = "CapitalCamel", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("CapitalCamel")]
|
||||
public string? CapitalCamel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets SmallSnake
|
||||
/// </summary>
|
||||
[DataMember(Name = "small_Snake", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("small_Snake")]
|
||||
public string? SmallSnake { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets CapitalSnake
|
||||
/// </summary>
|
||||
[DataMember(Name = "Capital_Snake", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("Capital_Snake")]
|
||||
public string? CapitalSnake { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets SCAETHFlowPoints
|
||||
/// </summary>
|
||||
[DataMember(Name = "SCA_ETH_Flow_Points", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("SCA_ETH_Flow_Points")]
|
||||
public string? SCAETHFlowPoints { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Name of the pet
|
||||
/// </summary>
|
||||
/// <value>Name of the pet </value>
|
||||
[DataMember(Name = "ATT_NAME", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("ATT_NAME")]
|
||||
public string? ATT_NAME { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -114,21 +112,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as Capitalization).AreEqual;
|
||||
}
|
||||
@@ -138,7 +127,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of Capitalization to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Capitalization input)
|
||||
public bool Equals(Capitalization? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,12 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using JsonSubTypes;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -30,41 +29,23 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Cat
|
||||
/// </summary>
|
||||
[DataContract(Name = "Cat")]
|
||||
[JsonConverter(typeof(JsonSubtypes), "ClassName")]
|
||||
public partial class Cat : Animal, IEquatable<Cat>, IValidatableObject
|
||||
public partial class Cat : Animal, IEquatable<Cat>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Cat" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
protected Cat()
|
||||
/// <param name="catAllOf">catAllOf</param>
|
||||
/// <param name="className">className (required)</param>
|
||||
/// <param name="color">color (default to "red")</param>
|
||||
public Cat(CatAllOf catAllOf, string className, string? color = "red") : base(className, color)
|
||||
{
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Cat" /> class.
|
||||
/// </summary>
|
||||
/// <param name="className">className (required) (default to "Cat").</param>
|
||||
/// <param name="declawed">declawed.</param>
|
||||
/// <param name="color">color (default to "red").</param>
|
||||
public Cat(string className = "Cat", bool? declawed = default, string? color = "red") : base(className, color)
|
||||
{
|
||||
this.Declawed = declawed;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
CatAllOf = catAllOf;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Declawed
|
||||
/// Gets or Sets Cat
|
||||
/// </summary>
|
||||
[DataMember(Name = "declawed", EmitDefaultValue = true)]
|
||||
public bool? Declawed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public CatAllOf? CatAllOf { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -75,27 +56,16 @@ namespace Org.OpenAPITools.Model
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class Cat {\n");
|
||||
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n");
|
||||
sb.Append(" Declawed: ").Append(Declawed).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public override string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as Cat).AreEqual;
|
||||
}
|
||||
@@ -105,7 +75,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of Cat to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Cat input)
|
||||
public bool Equals(Cat? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
@@ -119,38 +89,76 @@ namespace Org.OpenAPITools.Model
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = base.GetHashCode();
|
||||
hashCode = (hashCode * 59) + this.Declawed.GetHashCode();
|
||||
if (this.AdditionalProperties != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
return this.BaseValidate(validationContext);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
protected IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> BaseValidate(ValidationContext validationContext)
|
||||
{
|
||||
foreach (var x in BaseValidate(validationContext))
|
||||
{
|
||||
yield return x;
|
||||
}
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Json converter for type Cat
|
||||
/// </summary>
|
||||
public class CatJsonConverter : JsonConverter<Cat>
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a boolean if the type is compatible with this converter.
|
||||
/// </summary>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <returns></returns>
|
||||
public override bool CanConvert(Type typeToConvert) => typeof(Cat).IsAssignableFrom(typeToConvert);
|
||||
|
||||
/// <summary>
|
||||
/// A Json reader.
|
||||
/// </summary>
|
||||
/// <param name="reader"></param>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="JsonException"></exception>
|
||||
public override Cat Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
int currentDepth = reader.CurrentDepth;
|
||||
|
||||
if (reader.TokenType != JsonTokenType.StartObject)
|
||||
throw new JsonException();
|
||||
|
||||
Utf8JsonReader catAllOfReader = reader;
|
||||
Client.ClientUtils.TryDeserialize<CatAllOf>(ref catAllOfReader, options, out CatAllOf? catAllOf);
|
||||
string? className = default;
|
||||
string? color = default;
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
if (reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
||||
break;
|
||||
|
||||
if (reader.TokenType == JsonTokenType.PropertyName)
|
||||
{
|
||||
string? propertyName = reader.GetString();
|
||||
reader.Read();
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "className":
|
||||
className = reader.GetString();
|
||||
break;
|
||||
case "color":
|
||||
color = reader.GetString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new Cat(catAllOf, className, color);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Json writer
|
||||
/// </summary>
|
||||
/// <param name="writer"></param>
|
||||
/// <param name="cat"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions options) => throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,30 +29,28 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// CatAllOf
|
||||
/// </summary>
|
||||
[DataContract(Name = "Cat_allOf")]
|
||||
public partial class CatAllOf : IEquatable<CatAllOf>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CatAllOf" /> class.
|
||||
/// </summary>
|
||||
/// <param name="declawed">declawed.</param>
|
||||
/// <param name="declawed">declawed</param>
|
||||
public CatAllOf(bool? declawed = default)
|
||||
{
|
||||
this.Declawed = declawed;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
Declawed = declawed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Declawed
|
||||
/// </summary>
|
||||
[DataMember(Name = "declawed", EmitDefaultValue = true)]
|
||||
[JsonPropertyName("declawed")]
|
||||
public bool? Declawed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -68,21 +66,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as CatAllOf).AreEqual;
|
||||
}
|
||||
@@ -92,7 +81,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of CatAllOf to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(CatAllOf input)
|
||||
public bool Equals(CatAllOf? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,50 +29,38 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Category
|
||||
/// </summary>
|
||||
[DataContract(Name = "Category")]
|
||||
public partial class Category : IEquatable<Category>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Category" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
protected Category()
|
||||
{
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Category" /> class.
|
||||
/// </summary>
|
||||
/// <param name="name">name (required) (default to "default-name").</param>
|
||||
/// <param name="id">id.</param>
|
||||
/// <param name="name">name (required) (default to "default-name")</param>
|
||||
/// <param name="id">id</param>
|
||||
public Category(string name = "default-name", long? id = default)
|
||||
{
|
||||
// to ensure "name" is required (not null)
|
||||
if (name == null) {
|
||||
throw new ArgumentNullException("name is a required property for Category and cannot be null");
|
||||
}
|
||||
this.Name = name;
|
||||
this.Id = id;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
if (name == null)
|
||||
throw new ArgumentNullException("name is a required property for Category and cannot be null.");
|
||||
Name = name;
|
||||
Id = id;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Name
|
||||
/// </summary>
|
||||
[DataMember(Name = "name", IsRequired = true, EmitDefaultValue = false)]
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Id
|
||||
/// </summary>
|
||||
[DataMember(Name = "id", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("id")]
|
||||
public long? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -89,21 +77,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as Category).AreEqual;
|
||||
}
|
||||
@@ -113,7 +92,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of Category to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Category input)
|
||||
public bool Equals(Category? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,12 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using JsonSubTypes;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -30,61 +29,22 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// ChildCat
|
||||
/// </summary>
|
||||
[DataContract(Name = "ChildCat")]
|
||||
[JsonConverter(typeof(JsonSubtypes), "PetType")]
|
||||
public partial class ChildCat : ParentPet, IEquatable<ChildCat>, IValidatableObject
|
||||
public partial class ChildCat : ParentPet, IEquatable<ChildCat>
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines PetType
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum PetTypeEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum ChildCat for value: ChildCat
|
||||
/// </summary>
|
||||
[EnumMember(Value = "ChildCat")]
|
||||
ChildCat = 1
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets PetType
|
||||
/// </summary>
|
||||
[DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = false)]
|
||||
public PetTypeEnum PetType { get; set; }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ChildCat" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
protected ChildCat()
|
||||
/// <param name="childCatAllOf">childCatAllOf</param>
|
||||
/// <param name="petType">petType (required)</param>
|
||||
public ChildCat(ChildCatAllOf childCatAllOf, string petType) : base(petType)
|
||||
{
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ChildCat" /> class.
|
||||
/// </summary>
|
||||
/// <param name="petType">petType (required) (default to PetTypeEnum.ChildCat).</param>
|
||||
/// <param name="name">name.</param>
|
||||
public ChildCat(PetTypeEnum petType = PetTypeEnum.ChildCat, string? name = default) : base()
|
||||
{
|
||||
this.PetType = petType;
|
||||
this.Name = name;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
ChildCatAllOf = childCatAllOf;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Name
|
||||
/// Gets or Sets ChildCat
|
||||
/// </summary>
|
||||
[DataMember(Name = "name", EmitDefaultValue = false)]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public ChildCatAllOf? ChildCatAllOf { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -95,28 +55,16 @@ namespace Org.OpenAPITools.Model
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class ChildCat {\n");
|
||||
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n");
|
||||
sb.Append(" PetType: ").Append(PetType).Append("\n");
|
||||
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public override string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as ChildCat).AreEqual;
|
||||
}
|
||||
@@ -126,7 +74,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of ChildCat to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ChildCat input)
|
||||
public bool Equals(ChildCat? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
@@ -140,42 +88,72 @@ namespace Org.OpenAPITools.Model
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = base.GetHashCode();
|
||||
hashCode = (hashCode * 59) + this.PetType.GetHashCode();
|
||||
if (this.Name != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Name.GetHashCode();
|
||||
}
|
||||
if (this.AdditionalProperties != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
return this.BaseValidate(validationContext);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
protected IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> BaseValidate(ValidationContext validationContext)
|
||||
{
|
||||
foreach (var x in BaseValidate(validationContext))
|
||||
{
|
||||
yield return x;
|
||||
}
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Json converter for type ChildCat
|
||||
/// </summary>
|
||||
public class ChildCatJsonConverter : JsonConverter<ChildCat>
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a boolean if the type is compatible with this converter.
|
||||
/// </summary>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <returns></returns>
|
||||
public override bool CanConvert(Type typeToConvert) => typeof(ChildCat).IsAssignableFrom(typeToConvert);
|
||||
|
||||
/// <summary>
|
||||
/// A Json reader.
|
||||
/// </summary>
|
||||
/// <param name="reader"></param>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="JsonException"></exception>
|
||||
public override ChildCat Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
int currentDepth = reader.CurrentDepth;
|
||||
|
||||
if (reader.TokenType != JsonTokenType.StartObject)
|
||||
throw new JsonException();
|
||||
|
||||
Utf8JsonReader childCatAllOfReader = reader;
|
||||
Client.ClientUtils.TryDeserialize<ChildCatAllOf>(ref childCatAllOfReader, options, out ChildCatAllOf? childCatAllOf);
|
||||
string? petType = default;
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
if (reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
||||
break;
|
||||
|
||||
if (reader.TokenType == JsonTokenType.PropertyName)
|
||||
{
|
||||
string? propertyName = reader.GetString();
|
||||
reader.Read();
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "pet_type":
|
||||
petType = reader.GetString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new ChildCat(childCatAllOf, petType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Json writer
|
||||
/// </summary>
|
||||
/// <param name="writer"></param>
|
||||
/// <param name="childCat"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions options) => throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,13 +29,22 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// ChildCatAllOf
|
||||
/// </summary>
|
||||
[DataContract(Name = "ChildCat_allOf")]
|
||||
public partial class ChildCatAllOf : IEquatable<ChildCatAllOf>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ChildCatAllOf" /> class.
|
||||
/// </summary>
|
||||
/// <param name="name">name</param>
|
||||
/// <param name="petType">petType (default to PetTypeEnum.ChildCat)</param>
|
||||
public ChildCatAllOf(string? name = default, PetTypeEnum? petType = PetTypeEnum.ChildCat)
|
||||
{
|
||||
Name = name;
|
||||
PetType = petType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines PetType
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum PetTypeEnum
|
||||
{
|
||||
/// <summary>
|
||||
@@ -46,35 +55,23 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets PetType
|
||||
/// </summary>
|
||||
[DataMember(Name = "pet_type", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("pet_type")]
|
||||
public PetTypeEnum? PetType { get; set; }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ChildCatAllOf" /> class.
|
||||
/// </summary>
|
||||
/// <param name="name">name.</param>
|
||||
/// <param name="petType">petType (default to PetTypeEnum.ChildCat).</param>
|
||||
public ChildCatAllOf(string? name = default, PetTypeEnum? petType = PetTypeEnum.ChildCat)
|
||||
{
|
||||
this.Name = name;
|
||||
this.PetType = petType;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Name
|
||||
/// </summary>
|
||||
[DataMember(Name = "name", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -91,21 +88,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as ChildCatAllOf).AreEqual;
|
||||
}
|
||||
@@ -115,7 +103,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of ChildCatAllOf to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ChildCatAllOf input)
|
||||
public bool Equals(ChildCatAllOf? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,30 +29,28 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Model for testing model with \"_class\" property
|
||||
/// </summary>
|
||||
[DataContract(Name = "ClassModel")]
|
||||
public partial class ClassModel : IEquatable<ClassModel>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ClassModel" /> class.
|
||||
/// </summary>
|
||||
/// <param name="_class">_class.</param>
|
||||
/// <param name="_class">_class</param>
|
||||
public ClassModel(string? _class = default)
|
||||
{
|
||||
this.Class = _class;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
Class = _class;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Class
|
||||
/// </summary>
|
||||
[DataMember(Name = "_class", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("_class")]
|
||||
public string? Class { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -68,21 +66,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as ClassModel).AreEqual;
|
||||
}
|
||||
@@ -92,7 +81,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of ClassModel to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ClassModel input)
|
||||
public bool Equals(ClassModel? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,54 +29,34 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// ComplexQuadrilateral
|
||||
/// </summary>
|
||||
[DataContract(Name = "ComplexQuadrilateral")]
|
||||
public partial class ComplexQuadrilateral : IEquatable<ComplexQuadrilateral>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ComplexQuadrilateral" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
protected ComplexQuadrilateral()
|
||||
/// <param name="quadrilateralInterface">quadrilateralInterface</param>
|
||||
/// <param name="shapeInterface">shapeInterface</param>
|
||||
public ComplexQuadrilateral(QuadrilateralInterface quadrilateralInterface, ShapeInterface shapeInterface)
|
||||
{
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ComplexQuadrilateral" /> class.
|
||||
/// </summary>
|
||||
/// <param name="shapeType">shapeType (required).</param>
|
||||
/// <param name="quadrilateralType">quadrilateralType (required).</param>
|
||||
public ComplexQuadrilateral(string shapeType, string quadrilateralType)
|
||||
{
|
||||
// to ensure "shapeType" is required (not null)
|
||||
if (shapeType == null) {
|
||||
throw new ArgumentNullException("shapeType is a required property for ComplexQuadrilateral and cannot be null");
|
||||
}
|
||||
this.ShapeType = shapeType;
|
||||
// to ensure "quadrilateralType" is required (not null)
|
||||
if (quadrilateralType == null) {
|
||||
throw new ArgumentNullException("quadrilateralType is a required property for ComplexQuadrilateral and cannot be null");
|
||||
}
|
||||
this.QuadrilateralType = quadrilateralType;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
QuadrilateralInterface = quadrilateralInterface;
|
||||
ShapeInterface = shapeInterface;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ShapeType
|
||||
/// Gets or Sets ComplexQuadrilateral
|
||||
/// </summary>
|
||||
[DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)]
|
||||
public string ShapeType { get; set; }
|
||||
public QuadrilateralInterface? QuadrilateralInterface { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets QuadrilateralType
|
||||
/// Gets or Sets ComplexQuadrilateral
|
||||
/// </summary>
|
||||
[DataMember(Name = "quadrilateralType", IsRequired = true, EmitDefaultValue = false)]
|
||||
public string QuadrilateralType { get; set; }
|
||||
public ShapeInterface? ShapeInterface { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -86,28 +66,17 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class ComplexQuadrilateral {\n");
|
||||
sb.Append(" ShapeType: ").Append(ShapeType).Append("\n");
|
||||
sb.Append(" QuadrilateralType: ").Append(QuadrilateralType).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as ComplexQuadrilateral).AreEqual;
|
||||
}
|
||||
@@ -117,7 +86,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of ComplexQuadrilateral to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(ComplexQuadrilateral input)
|
||||
public bool Equals(ComplexQuadrilateral? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
@@ -131,14 +100,6 @@ namespace Org.OpenAPITools.Model
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = 41;
|
||||
if (this.ShapeType != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.ShapeType.GetHashCode();
|
||||
}
|
||||
if (this.QuadrilateralType != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.QuadrilateralType.GetHashCode();
|
||||
}
|
||||
if (this.AdditionalProperties != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||
@@ -158,4 +119,64 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Json converter for type ComplexQuadrilateral
|
||||
/// </summary>
|
||||
public class ComplexQuadrilateralJsonConverter : JsonConverter<ComplexQuadrilateral>
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a boolean if the type is compatible with this converter.
|
||||
/// </summary>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <returns></returns>
|
||||
public override bool CanConvert(Type typeToConvert) => typeof(ComplexQuadrilateral).IsAssignableFrom(typeToConvert);
|
||||
|
||||
/// <summary>
|
||||
/// A Json reader.
|
||||
/// </summary>
|
||||
/// <param name="reader"></param>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="JsonException"></exception>
|
||||
public override ComplexQuadrilateral Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
int currentDepth = reader.CurrentDepth;
|
||||
|
||||
if (reader.TokenType != JsonTokenType.StartObject)
|
||||
throw new JsonException();
|
||||
|
||||
Utf8JsonReader quadrilateralInterfaceReader = reader;
|
||||
Client.ClientUtils.TryDeserialize<QuadrilateralInterface>(ref quadrilateralInterfaceReader, options, out QuadrilateralInterface? quadrilateralInterface);
|
||||
Utf8JsonReader shapeInterfaceReader = reader;
|
||||
Client.ClientUtils.TryDeserialize<ShapeInterface>(ref shapeInterfaceReader, options, out ShapeInterface? shapeInterface);
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
if (reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
||||
break;
|
||||
|
||||
if (reader.TokenType == JsonTokenType.PropertyName)
|
||||
{
|
||||
string? propertyName = reader.GetString();
|
||||
reader.Read();
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new ComplexQuadrilateral(quadrilateralInterface, shapeInterface);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Json writer
|
||||
/// </summary>
|
||||
/// <param name="writer"></param>
|
||||
/// <param name="complexQuadrilateral"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions options) => throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,42 +29,30 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// DanishPig
|
||||
/// </summary>
|
||||
[DataContract(Name = "DanishPig")]
|
||||
public partial class DanishPig : IEquatable<DanishPig>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DanishPig" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
protected DanishPig()
|
||||
{
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DanishPig" /> class.
|
||||
/// </summary>
|
||||
/// <param name="className">className (required).</param>
|
||||
/// <param name="className">className (required)</param>
|
||||
public DanishPig(string className)
|
||||
{
|
||||
// to ensure "className" is required (not null)
|
||||
if (className == null) {
|
||||
throw new ArgumentNullException("className is a required property for DanishPig and cannot be null");
|
||||
}
|
||||
this.ClassName = className;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
if (className == null)
|
||||
throw new ArgumentNullException("className is a required property for DanishPig and cannot be null.");
|
||||
ClassName = className;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ClassName
|
||||
/// </summary>
|
||||
[DataMember(Name = "className", IsRequired = true, EmitDefaultValue = false)]
|
||||
[JsonPropertyName("className")]
|
||||
public string ClassName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -80,21 +68,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as DanishPig).AreEqual;
|
||||
}
|
||||
@@ -104,7 +83,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of DanishPig to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(DanishPig input)
|
||||
public bool Equals(DanishPig? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,30 +29,28 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// DeprecatedObject
|
||||
/// </summary>
|
||||
[DataContract(Name = "DeprecatedObject")]
|
||||
public partial class DeprecatedObject : IEquatable<DeprecatedObject>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DeprecatedObject" /> class.
|
||||
/// </summary>
|
||||
/// <param name="name">name.</param>
|
||||
/// <param name="name">name</param>
|
||||
public DeprecatedObject(string? name = default)
|
||||
{
|
||||
this.Name = name;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
Name = name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Name
|
||||
/// </summary>
|
||||
[DataMember(Name = "name", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -68,21 +66,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as DeprecatedObject).AreEqual;
|
||||
}
|
||||
@@ -92,7 +81,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of DeprecatedObject to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(DeprecatedObject input)
|
||||
public bool Equals(DeprecatedObject? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,12 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using JsonSubTypes;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -30,41 +29,23 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Dog
|
||||
/// </summary>
|
||||
[DataContract(Name = "Dog")]
|
||||
[JsonConverter(typeof(JsonSubtypes), "ClassName")]
|
||||
public partial class Dog : Animal, IEquatable<Dog>, IValidatableObject
|
||||
public partial class Dog : Animal, IEquatable<Dog>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Dog" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
protected Dog()
|
||||
/// <param name="dogAllOf">dogAllOf</param>
|
||||
/// <param name="className">className (required)</param>
|
||||
/// <param name="color">color (default to "red")</param>
|
||||
public Dog(DogAllOf dogAllOf, string className, string? color = "red") : base(className, color)
|
||||
{
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Dog" /> class.
|
||||
/// </summary>
|
||||
/// <param name="className">className (required) (default to "Dog").</param>
|
||||
/// <param name="breed">breed.</param>
|
||||
/// <param name="color">color (default to "red").</param>
|
||||
public Dog(string className = "Dog", string? breed = default, string? color = "red") : base(className, color)
|
||||
{
|
||||
this.Breed = breed;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
DogAllOf = dogAllOf;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Breed
|
||||
/// Gets or Sets Dog
|
||||
/// </summary>
|
||||
[DataMember(Name = "breed", EmitDefaultValue = false)]
|
||||
public string? Breed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public DogAllOf? DogAllOf { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -75,27 +56,16 @@ namespace Org.OpenAPITools.Model
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class Dog {\n");
|
||||
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n");
|
||||
sb.Append(" Breed: ").Append(Breed).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public override string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as Dog).AreEqual;
|
||||
}
|
||||
@@ -105,7 +75,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of Dog to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Dog input)
|
||||
public bool Equals(Dog? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
@@ -119,41 +89,76 @@ namespace Org.OpenAPITools.Model
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = base.GetHashCode();
|
||||
if (this.Breed != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Breed.GetHashCode();
|
||||
}
|
||||
if (this.AdditionalProperties != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
return this.BaseValidate(validationContext);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
protected IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> BaseValidate(ValidationContext validationContext)
|
||||
{
|
||||
foreach (var x in BaseValidate(validationContext))
|
||||
{
|
||||
yield return x;
|
||||
}
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Json converter for type Dog
|
||||
/// </summary>
|
||||
public class DogJsonConverter : JsonConverter<Dog>
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a boolean if the type is compatible with this converter.
|
||||
/// </summary>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <returns></returns>
|
||||
public override bool CanConvert(Type typeToConvert) => typeof(Dog).IsAssignableFrom(typeToConvert);
|
||||
|
||||
/// <summary>
|
||||
/// A Json reader.
|
||||
/// </summary>
|
||||
/// <param name="reader"></param>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="JsonException"></exception>
|
||||
public override Dog Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
int currentDepth = reader.CurrentDepth;
|
||||
|
||||
if (reader.TokenType != JsonTokenType.StartObject)
|
||||
throw new JsonException();
|
||||
|
||||
Utf8JsonReader dogAllOfReader = reader;
|
||||
Client.ClientUtils.TryDeserialize<DogAllOf>(ref dogAllOfReader, options, out DogAllOf? dogAllOf);
|
||||
string? className = default;
|
||||
string? color = default;
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
if (reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
||||
break;
|
||||
|
||||
if (reader.TokenType == JsonTokenType.PropertyName)
|
||||
{
|
||||
string? propertyName = reader.GetString();
|
||||
reader.Read();
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "className":
|
||||
className = reader.GetString();
|
||||
break;
|
||||
case "color":
|
||||
color = reader.GetString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new Dog(dogAllOf, className, color);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Json writer
|
||||
/// </summary>
|
||||
/// <param name="writer"></param>
|
||||
/// <param name="dog"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions options) => throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,30 +29,28 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// DogAllOf
|
||||
/// </summary>
|
||||
[DataContract(Name = "Dog_allOf")]
|
||||
public partial class DogAllOf : IEquatable<DogAllOf>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DogAllOf" /> class.
|
||||
/// </summary>
|
||||
/// <param name="breed">breed.</param>
|
||||
/// <param name="breed">breed</param>
|
||||
public DogAllOf(string? breed = default)
|
||||
{
|
||||
this.Breed = breed;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
Breed = breed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Breed
|
||||
/// </summary>
|
||||
[DataMember(Name = "breed", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("breed")]
|
||||
public string? Breed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -68,21 +66,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as DogAllOf).AreEqual;
|
||||
}
|
||||
@@ -92,7 +81,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of DogAllOf to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(DogAllOf input)
|
||||
public bool Equals(DogAllOf? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,46 +29,45 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Drawing
|
||||
/// </summary>
|
||||
[DataContract(Name = "Drawing")]
|
||||
public partial class Drawing : Dictionary<String, Fruit>, IEquatable<Drawing>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Drawing" /> class.
|
||||
/// </summary>
|
||||
/// <param name="mainShape">mainShape.</param>
|
||||
/// <param name="shapeOrNull">shapeOrNull.</param>
|
||||
/// <param name="nullableShape">nullableShape.</param>
|
||||
/// <param name="shapes">shapes.</param>
|
||||
public Drawing(Shape? mainShape = default, ShapeOrNull? shapeOrNull = default, NullableShape? nullableShape = default, List<Shape>? shapes = default) : base()
|
||||
/// <param name="mainShape">mainShape</param>
|
||||
/// <param name="shapeOrNull">shapeOrNull</param>
|
||||
/// <param name="nullableShape">nullableShape</param>
|
||||
/// <param name="shapes">shapes</param>
|
||||
public Drawing(Shape? mainShape = default, ShapeOrNull? shapeOrNull = default, NullableShape? nullableShape = default, List<Shape>? shapes = default)
|
||||
{
|
||||
this.MainShape = mainShape;
|
||||
this.ShapeOrNull = shapeOrNull;
|
||||
this.NullableShape = nullableShape;
|
||||
this.Shapes = shapes;
|
||||
MainShape = mainShape;
|
||||
ShapeOrNull = shapeOrNull;
|
||||
NullableShape = nullableShape;
|
||||
Shapes = shapes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets MainShape
|
||||
/// </summary>
|
||||
[DataMember(Name = "mainShape", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("mainShape")]
|
||||
public Shape? MainShape { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ShapeOrNull
|
||||
/// </summary>
|
||||
[DataMember(Name = "shapeOrNull", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("shapeOrNull")]
|
||||
public ShapeOrNull? ShapeOrNull { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets NullableShape
|
||||
/// </summary>
|
||||
[DataMember(Name = "nullableShape", EmitDefaultValue = true)]
|
||||
[JsonPropertyName("nullableShape")]
|
||||
public NullableShape? NullableShape { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Shapes
|
||||
/// </summary>
|
||||
[DataMember(Name = "shapes", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("shapes")]
|
||||
public List<Shape>? Shapes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@@ -88,21 +87,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as Drawing).AreEqual;
|
||||
}
|
||||
@@ -112,7 +102,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of Drawing to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Drawing input)
|
||||
public bool Equals(Drawing? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,13 +29,22 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// EnumArrays
|
||||
/// </summary>
|
||||
[DataContract(Name = "EnumArrays")]
|
||||
public partial class EnumArrays : IEquatable<EnumArrays>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EnumArrays" /> class.
|
||||
/// </summary>
|
||||
/// <param name="justSymbol">justSymbol</param>
|
||||
/// <param name="arrayEnum">arrayEnum</param>
|
||||
public EnumArrays(JustSymbolEnum? justSymbol = default, List<ArrayEnumEnum>? arrayEnum = default)
|
||||
{
|
||||
JustSymbol = justSymbol;
|
||||
ArrayEnum = arrayEnum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines JustSymbol
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum JustSymbolEnum
|
||||
{
|
||||
/// <summary>
|
||||
@@ -52,16 +61,15 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets JustSymbol
|
||||
/// </summary>
|
||||
[DataMember(Name = "just_symbol", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("just_symbol")]
|
||||
public JustSymbolEnum? JustSymbol { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Defines ArrayEnum
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum ArrayEnumEnum
|
||||
{
|
||||
/// <summary>
|
||||
@@ -79,29 +87,17 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayEnum
|
||||
/// </summary>
|
||||
[DataMember(Name = "array_enum", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("array_enum")]
|
||||
public List<ArrayEnumEnum>? ArrayEnum { get; set; }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EnumArrays" /> class.
|
||||
/// </summary>
|
||||
/// <param name="justSymbol">justSymbol.</param>
|
||||
/// <param name="arrayEnum">arrayEnum.</param>
|
||||
public EnumArrays(JustSymbolEnum? justSymbol = default, List<ArrayEnumEnum>? arrayEnum = default)
|
||||
{
|
||||
this.JustSymbol = justSymbol;
|
||||
this.ArrayEnum = arrayEnum;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -118,21 +114,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as EnumArrays).AreEqual;
|
||||
}
|
||||
@@ -142,7 +129,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of EnumArrays to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(EnumArrays input)
|
||||
public bool Equals(EnumArrays? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,7 +29,6 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Defines EnumClass
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum EnumClass
|
||||
{
|
||||
/// <summary>
|
||||
@@ -51,5 +50,4 @@ namespace Org.OpenAPITools.Model
|
||||
Xyz = 3
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,13 +29,38 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// EnumTest
|
||||
/// </summary>
|
||||
[DataContract(Name = "Enum_Test")]
|
||||
public partial class EnumTest : IEquatable<EnumTest>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EnumTest" /> class.
|
||||
/// </summary>
|
||||
/// <param name="enumStringRequired">enumStringRequired (required)</param>
|
||||
/// <param name="enumString">enumString</param>
|
||||
/// <param name="enumInteger">enumInteger</param>
|
||||
/// <param name="enumIntegerOnly">enumIntegerOnly</param>
|
||||
/// <param name="enumNumber">enumNumber</param>
|
||||
/// <param name="outerEnum">outerEnum</param>
|
||||
/// <param name="outerEnumInteger">outerEnumInteger</param>
|
||||
/// <param name="outerEnumDefaultValue">outerEnumDefaultValue</param>
|
||||
/// <param name="outerEnumIntegerDefaultValue">outerEnumIntegerDefaultValue</param>
|
||||
public EnumTest(EnumStringRequiredEnum enumStringRequired, EnumStringEnum? enumString = default, EnumIntegerEnum? enumInteger = default, EnumIntegerOnlyEnum? enumIntegerOnly = default, EnumNumberEnum? enumNumber = default, OuterEnum? outerEnum = default, OuterEnumInteger? outerEnumInteger = default, OuterEnumDefaultValue? outerEnumDefaultValue = default, OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue = default)
|
||||
{
|
||||
if (enumStringRequired == null)
|
||||
throw new ArgumentNullException("enumStringRequired is a required property for EnumTest and cannot be null.");
|
||||
EnumStringRequired = enumStringRequired;
|
||||
EnumString = enumString;
|
||||
EnumInteger = enumInteger;
|
||||
EnumIntegerOnly = enumIntegerOnly;
|
||||
EnumNumber = enumNumber;
|
||||
OuterEnum = outerEnum;
|
||||
OuterEnumInteger = outerEnumInteger;
|
||||
OuterEnumDefaultValue = outerEnumDefaultValue;
|
||||
OuterEnumIntegerDefaultValue = outerEnumIntegerDefaultValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines EnumStringRequired
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum EnumStringRequiredEnum
|
||||
{
|
||||
/// <summary>
|
||||
@@ -58,16 +83,15 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets EnumStringRequired
|
||||
/// </summary>
|
||||
[DataMember(Name = "enum_string_required", IsRequired = true, EmitDefaultValue = false)]
|
||||
[JsonPropertyName("enum_string_required")]
|
||||
public EnumStringRequiredEnum EnumStringRequired { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Defines EnumString
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum EnumStringEnum
|
||||
{
|
||||
/// <summary>
|
||||
@@ -90,12 +114,12 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets EnumString
|
||||
/// </summary>
|
||||
[DataMember(Name = "enum_string", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("enum_string")]
|
||||
public EnumStringEnum? EnumString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Defines EnumInteger
|
||||
/// </summary>
|
||||
@@ -113,12 +137,12 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets EnumInteger
|
||||
/// </summary>
|
||||
[DataMember(Name = "enum_integer", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("enum_integer")]
|
||||
public EnumIntegerEnum? EnumInteger { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Defines EnumIntegerOnly
|
||||
/// </summary>
|
||||
@@ -136,16 +160,15 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets EnumIntegerOnly
|
||||
/// </summary>
|
||||
[DataMember(Name = "enum_integer_only", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("enum_integer_only")]
|
||||
public EnumIntegerOnlyEnum? EnumIntegerOnly { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Defines EnumNumber
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum EnumNumberEnum
|
||||
{
|
||||
/// <summary>
|
||||
@@ -162,75 +185,41 @@ namespace Org.OpenAPITools.Model
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets EnumNumber
|
||||
/// </summary>
|
||||
[DataMember(Name = "enum_number", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("enum_number")]
|
||||
public EnumNumberEnum? EnumNumber { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets OuterEnum
|
||||
/// </summary>
|
||||
[DataMember(Name = "outerEnum", EmitDefaultValue = true)]
|
||||
[JsonPropertyName("outerEnum")]
|
||||
public OuterEnum? OuterEnum { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets OuterEnumInteger
|
||||
/// </summary>
|
||||
[DataMember(Name = "outerEnumInteger", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("outerEnumInteger")]
|
||||
public OuterEnumInteger? OuterEnumInteger { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets OuterEnumDefaultValue
|
||||
/// </summary>
|
||||
[DataMember(Name = "outerEnumDefaultValue", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("outerEnumDefaultValue")]
|
||||
public OuterEnumDefaultValue? OuterEnumDefaultValue { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets OuterEnumIntegerDefaultValue
|
||||
/// </summary>
|
||||
[DataMember(Name = "outerEnumIntegerDefaultValue", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("outerEnumIntegerDefaultValue")]
|
||||
public OuterEnumIntegerDefaultValue? OuterEnumIntegerDefaultValue { get; set; }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EnumTest" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
protected EnumTest()
|
||||
{
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EnumTest" /> class.
|
||||
/// </summary>
|
||||
/// <param name="enumStringRequired">enumStringRequired (required).</param>
|
||||
/// <param name="enumString">enumString.</param>
|
||||
/// <param name="enumInteger">enumInteger.</param>
|
||||
/// <param name="enumIntegerOnly">enumIntegerOnly.</param>
|
||||
/// <param name="enumNumber">enumNumber.</param>
|
||||
/// <param name="outerEnum">outerEnum.</param>
|
||||
/// <param name="outerEnumInteger">outerEnumInteger.</param>
|
||||
/// <param name="outerEnumDefaultValue">outerEnumDefaultValue.</param>
|
||||
/// <param name="outerEnumIntegerDefaultValue">outerEnumIntegerDefaultValue.</param>
|
||||
public EnumTest(EnumStringRequiredEnum enumStringRequired, EnumStringEnum? enumString = default, EnumIntegerEnum? enumInteger = default, EnumIntegerOnlyEnum? enumIntegerOnly = default, EnumNumberEnum? enumNumber = default, OuterEnum? outerEnum = default, OuterEnumInteger? outerEnumInteger = default, OuterEnumDefaultValue? outerEnumDefaultValue = default, OuterEnumIntegerDefaultValue? outerEnumIntegerDefaultValue = default)
|
||||
{
|
||||
this.EnumStringRequired = enumStringRequired;
|
||||
this.EnumString = enumString;
|
||||
this.EnumInteger = enumInteger;
|
||||
this.EnumIntegerOnly = enumIntegerOnly;
|
||||
this.EnumNumber = enumNumber;
|
||||
this.OuterEnum = outerEnum;
|
||||
this.OuterEnumInteger = outerEnumInteger;
|
||||
this.OuterEnumDefaultValue = outerEnumDefaultValue;
|
||||
this.OuterEnumIntegerDefaultValue = outerEnumIntegerDefaultValue;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -254,21 +243,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as EnumTest).AreEqual;
|
||||
}
|
||||
@@ -278,7 +258,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of EnumTest to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(EnumTest input)
|
||||
public bool Equals(EnumTest? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,54 +29,34 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// EquilateralTriangle
|
||||
/// </summary>
|
||||
[DataContract(Name = "EquilateralTriangle")]
|
||||
public partial class EquilateralTriangle : IEquatable<EquilateralTriangle>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EquilateralTriangle" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
protected EquilateralTriangle()
|
||||
/// <param name="shapeInterface">shapeInterface</param>
|
||||
/// <param name="triangleInterface">triangleInterface</param>
|
||||
public EquilateralTriangle(ShapeInterface shapeInterface, TriangleInterface triangleInterface)
|
||||
{
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EquilateralTriangle" /> class.
|
||||
/// </summary>
|
||||
/// <param name="shapeType">shapeType (required).</param>
|
||||
/// <param name="triangleType">triangleType (required).</param>
|
||||
public EquilateralTriangle(string shapeType, string triangleType)
|
||||
{
|
||||
// to ensure "shapeType" is required (not null)
|
||||
if (shapeType == null) {
|
||||
throw new ArgumentNullException("shapeType is a required property for EquilateralTriangle and cannot be null");
|
||||
}
|
||||
this.ShapeType = shapeType;
|
||||
// to ensure "triangleType" is required (not null)
|
||||
if (triangleType == null) {
|
||||
throw new ArgumentNullException("triangleType is a required property for EquilateralTriangle and cannot be null");
|
||||
}
|
||||
this.TriangleType = triangleType;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
ShapeInterface = shapeInterface;
|
||||
TriangleInterface = triangleInterface;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ShapeType
|
||||
/// Gets or Sets EquilateralTriangle
|
||||
/// </summary>
|
||||
[DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)]
|
||||
public string ShapeType { get; set; }
|
||||
public ShapeInterface? ShapeInterface { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets TriangleType
|
||||
/// Gets or Sets EquilateralTriangle
|
||||
/// </summary>
|
||||
[DataMember(Name = "triangleType", IsRequired = true, EmitDefaultValue = false)]
|
||||
public string TriangleType { get; set; }
|
||||
public TriangleInterface? TriangleInterface { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -86,28 +66,17 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class EquilateralTriangle {\n");
|
||||
sb.Append(" ShapeType: ").Append(ShapeType).Append("\n");
|
||||
sb.Append(" TriangleType: ").Append(TriangleType).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as EquilateralTriangle).AreEqual;
|
||||
}
|
||||
@@ -117,7 +86,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of EquilateralTriangle to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(EquilateralTriangle input)
|
||||
public bool Equals(EquilateralTriangle? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
@@ -131,14 +100,6 @@ namespace Org.OpenAPITools.Model
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = 41;
|
||||
if (this.ShapeType != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.ShapeType.GetHashCode();
|
||||
}
|
||||
if (this.TriangleType != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.TriangleType.GetHashCode();
|
||||
}
|
||||
if (this.AdditionalProperties != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||
@@ -158,4 +119,64 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Json converter for type EquilateralTriangle
|
||||
/// </summary>
|
||||
public class EquilateralTriangleJsonConverter : JsonConverter<EquilateralTriangle>
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a boolean if the type is compatible with this converter.
|
||||
/// </summary>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <returns></returns>
|
||||
public override bool CanConvert(Type typeToConvert) => typeof(EquilateralTriangle).IsAssignableFrom(typeToConvert);
|
||||
|
||||
/// <summary>
|
||||
/// A Json reader.
|
||||
/// </summary>
|
||||
/// <param name="reader"></param>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="JsonException"></exception>
|
||||
public override EquilateralTriangle Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
int currentDepth = reader.CurrentDepth;
|
||||
|
||||
if (reader.TokenType != JsonTokenType.StartObject)
|
||||
throw new JsonException();
|
||||
|
||||
Utf8JsonReader shapeInterfaceReader = reader;
|
||||
Client.ClientUtils.TryDeserialize<ShapeInterface>(ref shapeInterfaceReader, options, out ShapeInterface? shapeInterface);
|
||||
Utf8JsonReader triangleInterfaceReader = reader;
|
||||
Client.ClientUtils.TryDeserialize<TriangleInterface>(ref triangleInterfaceReader, options, out TriangleInterface? triangleInterface);
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
if (reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
||||
break;
|
||||
|
||||
if (reader.TokenType == JsonTokenType.PropertyName)
|
||||
{
|
||||
string? propertyName = reader.GetString();
|
||||
reader.Read();
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new EquilateralTriangle(shapeInterface, triangleInterface);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Json writer
|
||||
/// </summary>
|
||||
/// <param name="writer"></param>
|
||||
/// <param name="equilateralTriangle"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions options) => throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,31 +29,29 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Must be named `File` for test.
|
||||
/// </summary>
|
||||
[DataContract(Name = "File")]
|
||||
public partial class File : IEquatable<File>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="File" /> class.
|
||||
/// </summary>
|
||||
/// <param name="sourceURI">Test capitalization.</param>
|
||||
/// <param name="sourceURI">Test capitalization</param>
|
||||
public File(string? sourceURI = default)
|
||||
{
|
||||
this.SourceURI = sourceURI;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
SourceURI = sourceURI;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test capitalization
|
||||
/// </summary>
|
||||
/// <value>Test capitalization</value>
|
||||
[DataMember(Name = "sourceURI", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("sourceURI")]
|
||||
public string? SourceURI { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -69,21 +67,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as File).AreEqual;
|
||||
}
|
||||
@@ -93,7 +82,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of File to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(File input)
|
||||
public bool Equals(File? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,38 +29,36 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// FileSchemaTestClass
|
||||
/// </summary>
|
||||
[DataContract(Name = "FileSchemaTestClass")]
|
||||
public partial class FileSchemaTestClass : IEquatable<FileSchemaTestClass>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FileSchemaTestClass" /> class.
|
||||
/// </summary>
|
||||
/// <param name="file">file.</param>
|
||||
/// <param name="files">files.</param>
|
||||
/// <param name="file">file</param>
|
||||
/// <param name="files">files</param>
|
||||
public FileSchemaTestClass(File? file = default, List<File>? files = default)
|
||||
{
|
||||
this.File = file;
|
||||
this.Files = files;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
File = file;
|
||||
Files = files;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets File
|
||||
/// </summary>
|
||||
[DataMember(Name = "file", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("file")]
|
||||
public File? File { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Files
|
||||
/// </summary>
|
||||
[DataMember(Name = "files", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("files")]
|
||||
public List<File>? Files { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -77,21 +75,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as FileSchemaTestClass).AreEqual;
|
||||
}
|
||||
@@ -101,7 +90,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of FileSchemaTestClass to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(FileSchemaTestClass input)
|
||||
public bool Equals(FileSchemaTestClass? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,31 +29,28 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Foo
|
||||
/// </summary>
|
||||
[DataContract(Name = "Foo")]
|
||||
public partial class Foo : IEquatable<Foo>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Foo" /> class.
|
||||
/// </summary>
|
||||
/// <param name="bar">bar (default to "bar").</param>
|
||||
/// <param name="bar">bar (default to "bar")</param>
|
||||
public Foo(string? bar = "bar")
|
||||
{
|
||||
// use default value if no "bar" provided
|
||||
this.Bar = bar ?? "bar";
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
Bar = bar;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Bar
|
||||
/// </summary>
|
||||
[DataMember(Name = "bar", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("bar")]
|
||||
public string? Bar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -69,21 +66,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as Foo).AreEqual;
|
||||
}
|
||||
@@ -93,7 +81,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of Foo to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Foo input)
|
||||
public bool Equals(Foo? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,169 +29,158 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// FormatTest
|
||||
/// </summary>
|
||||
[DataContract(Name = "format_test")]
|
||||
public partial class FormatTest : IEquatable<FormatTest>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FormatTest" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
protected FormatTest()
|
||||
{
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FormatTest" /> class.
|
||||
/// </summary>
|
||||
/// <param name="number">number (required).</param>
|
||||
/// <param name="_byte">_byte (required).</param>
|
||||
/// <param name="date">date (required).</param>
|
||||
/// <param name="password">password (required).</param>
|
||||
/// <param name="integer">integer.</param>
|
||||
/// <param name="int32">int32.</param>
|
||||
/// <param name="int64">int64.</param>
|
||||
/// <param name="_float">_float.</param>
|
||||
/// <param name="_double">_double.</param>
|
||||
/// <param name="_decimal">_decimal.</param>
|
||||
/// <param name="_string">_string.</param>
|
||||
/// <param name="binary">binary.</param>
|
||||
/// <param name="dateTime">dateTime.</param>
|
||||
/// <param name="uuid">uuid.</param>
|
||||
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros..</param>
|
||||
/// <param name="patternWithDigitsAndDelimiter">A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01..</param>
|
||||
/// <param name="number">number (required)</param>
|
||||
/// <param name="_byte">_byte (required)</param>
|
||||
/// <param name="date">date (required)</param>
|
||||
/// <param name="password">password (required)</param>
|
||||
/// <param name="integer">integer</param>
|
||||
/// <param name="int32">int32</param>
|
||||
/// <param name="int64">int64</param>
|
||||
/// <param name="_float">_float</param>
|
||||
/// <param name="_double">_double</param>
|
||||
/// <param name="_decimal">_decimal</param>
|
||||
/// <param name="_string">_string</param>
|
||||
/// <param name="binary">binary</param>
|
||||
/// <param name="dateTime">dateTime</param>
|
||||
/// <param name="uuid">uuid</param>
|
||||
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros.</param>
|
||||
/// <param name="patternWithDigitsAndDelimiter">A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.</param>
|
||||
public FormatTest(decimal number, byte[] _byte, DateTime date, string password, int? integer = default, int? int32 = default, long? int64 = default, float? _float = default, double? _double = default, decimal? _decimal = default, string? _string = default, System.IO.Stream? binary = default, DateTime? dateTime = default, Guid? uuid = default, string? patternWithDigits = default, string? patternWithDigitsAndDelimiter = default)
|
||||
{
|
||||
this.Number = number;
|
||||
// to ensure "_byte" is required (not null)
|
||||
if (_byte == null) {
|
||||
throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null");
|
||||
}
|
||||
this.Byte = _byte;
|
||||
this.Date = date;
|
||||
// to ensure "password" is required (not null)
|
||||
if (password == null) {
|
||||
throw new ArgumentNullException("password is a required property for FormatTest and cannot be null");
|
||||
}
|
||||
this.Password = password;
|
||||
this.Integer = integer;
|
||||
this.Int32 = int32;
|
||||
this.Int64 = int64;
|
||||
this.Float = _float;
|
||||
this.Double = _double;
|
||||
this.Decimal = _decimal;
|
||||
this.String = _string;
|
||||
this.Binary = binary;
|
||||
this.DateTime = dateTime;
|
||||
this.Uuid = uuid;
|
||||
this.PatternWithDigits = patternWithDigits;
|
||||
this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
if (number == null)
|
||||
throw new ArgumentNullException("number is a required property for FormatTest and cannot be null.");
|
||||
if (_byte == null)
|
||||
throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null.");
|
||||
if (date == null)
|
||||
throw new ArgumentNullException("date is a required property for FormatTest and cannot be null.");
|
||||
if (password == null)
|
||||
throw new ArgumentNullException("password is a required property for FormatTest and cannot be null.");
|
||||
Number = number;
|
||||
Byte = _byte;
|
||||
Date = date;
|
||||
Password = password;
|
||||
Integer = integer;
|
||||
Int32 = int32;
|
||||
Int64 = int64;
|
||||
Float = _float;
|
||||
Double = _double;
|
||||
Decimal = _decimal;
|
||||
String = _string;
|
||||
Binary = binary;
|
||||
DateTime = dateTime;
|
||||
Uuid = uuid;
|
||||
PatternWithDigits = patternWithDigits;
|
||||
PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Number
|
||||
/// </summary>
|
||||
[DataMember(Name = "number", IsRequired = true, EmitDefaultValue = false)]
|
||||
[JsonPropertyName("number")]
|
||||
public decimal Number { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Byte
|
||||
/// </summary>
|
||||
[DataMember(Name = "byte", IsRequired = true, EmitDefaultValue = false)]
|
||||
[JsonPropertyName("byte")]
|
||||
public byte[] Byte { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Date
|
||||
/// </summary>
|
||||
[DataMember(Name = "date", IsRequired = true, EmitDefaultValue = false)]
|
||||
[JsonConverter(typeof(OpenAPIDateConverter))]
|
||||
[JsonPropertyName("date")]
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Password
|
||||
/// </summary>
|
||||
[DataMember(Name = "password", IsRequired = true, EmitDefaultValue = false)]
|
||||
[JsonPropertyName("password")]
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Integer
|
||||
/// </summary>
|
||||
[DataMember(Name = "integer", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("integer")]
|
||||
public int? Integer { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Int32
|
||||
/// </summary>
|
||||
[DataMember(Name = "int32", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("int32")]
|
||||
public int? Int32 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Int64
|
||||
/// </summary>
|
||||
[DataMember(Name = "int64", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("int64")]
|
||||
public long? Int64 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Float
|
||||
/// </summary>
|
||||
[DataMember(Name = "float", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("float")]
|
||||
public float? Float { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Double
|
||||
/// </summary>
|
||||
[DataMember(Name = "double", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("double")]
|
||||
public double? Double { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Decimal
|
||||
/// </summary>
|
||||
[DataMember(Name = "decimal", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("decimal")]
|
||||
public decimal? Decimal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets String
|
||||
/// </summary>
|
||||
[DataMember(Name = "string", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("string")]
|
||||
public string? String { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Binary
|
||||
/// </summary>
|
||||
[DataMember(Name = "binary", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("binary")]
|
||||
public System.IO.Stream? Binary { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets DateTime
|
||||
/// </summary>
|
||||
[DataMember(Name = "dateTime", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("dateTime")]
|
||||
public DateTime? DateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Uuid
|
||||
/// </summary>
|
||||
[DataMember(Name = "uuid", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("uuid")]
|
||||
public Guid? Uuid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A string that is a 10 digit number. Can have leading zeros.
|
||||
/// </summary>
|
||||
/// <value>A string that is a 10 digit number. Can have leading zeros.</value>
|
||||
[DataMember(Name = "pattern_with_digits", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("pattern_with_digits")]
|
||||
public string? PatternWithDigits { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
|
||||
/// </summary>
|
||||
/// <value>A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.</value>
|
||||
[DataMember(Name = "pattern_with_digits_and_delimiter", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("pattern_with_digits_and_delimiter")]
|
||||
public string? PatternWithDigitsAndDelimiter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -222,21 +211,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as FormatTest).AreEqual;
|
||||
}
|
||||
@@ -246,7 +226,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of FormatTest to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(FormatTest input)
|
||||
public bool Equals(FormatTest? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,95 +19,55 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Fruit
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(FruitJsonConverter))]
|
||||
[DataContract(Name = "fruit")]
|
||||
public partial class Fruit : AbstractOpenAPISchema, IEquatable<Fruit>, IValidatableObject
|
||||
public partial class Fruit : IEquatable<Fruit>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Fruit" /> class
|
||||
/// with the <see cref="Apple" /> class
|
||||
/// Initializes a new instance of the <see cref="Fruit" /> class.
|
||||
/// </summary>
|
||||
/// <param name="actualInstance">An instance of Apple.</param>
|
||||
public Fruit(Apple actualInstance)
|
||||
/// <param name="apple">apple</param>
|
||||
/// <param name="color">color</param>
|
||||
public Fruit(Apple? apple, string? color = default)
|
||||
{
|
||||
this.IsNullable = false;
|
||||
this.SchemaType= "oneOf";
|
||||
this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
|
||||
Apple = apple;
|
||||
Color = color;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Fruit" /> class
|
||||
/// with the <see cref="Banana" /> class
|
||||
/// Initializes a new instance of the <see cref="Fruit" /> class.
|
||||
/// </summary>
|
||||
/// <param name="actualInstance">An instance of Banana.</param>
|
||||
public Fruit(Banana actualInstance)
|
||||
/// <param name="banana">banana</param>
|
||||
/// <param name="color">color</param>
|
||||
public Fruit(Banana? banana, string? color = default)
|
||||
{
|
||||
this.IsNullable = false;
|
||||
this.SchemaType= "oneOf";
|
||||
this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
|
||||
}
|
||||
|
||||
|
||||
private Object _actualInstance;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ActualInstance
|
||||
/// </summary>
|
||||
public override Object ActualInstance
|
||||
{
|
||||
get
|
||||
{
|
||||
return _actualInstance;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value.GetType() == typeof(Apple))
|
||||
{
|
||||
this._actualInstance = value;
|
||||
}
|
||||
else if (value.GetType() == typeof(Banana))
|
||||
{
|
||||
this._actualInstance = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Invalid instance found. Must be the following types: Apple, Banana");
|
||||
}
|
||||
}
|
||||
Banana = banana;
|
||||
Color = color;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the actual instance of `Apple`. If the actual instance is not `Apple`,
|
||||
/// the InvalidClassException will be thrown
|
||||
/// Gets or Sets fruit
|
||||
/// </summary>
|
||||
/// <returns>An instance of Apple</returns>
|
||||
public Apple GetApple()
|
||||
{
|
||||
return (Apple)this.ActualInstance;
|
||||
}
|
||||
public Apple? Apple { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get the actual instance of `Banana`. If the actual instance is not `Banana`,
|
||||
/// the InvalidClassException will be thrown
|
||||
/// Gets or Sets fruit
|
||||
/// </summary>
|
||||
/// <returns>An instance of Banana</returns>
|
||||
public Banana GetBanana()
|
||||
{
|
||||
return (Banana)this.ActualInstance;
|
||||
}
|
||||
public Banana? Banana { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Color
|
||||
/// </summary>
|
||||
[JsonPropertyName("color")]
|
||||
public string? Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -113,97 +75,19 @@ namespace Org.OpenAPITools.Model
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class Fruit {\n");
|
||||
sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n");
|
||||
sb.Append(" Color: ").Append(Color).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public override string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this.ActualInstance, Fruit.SerializerSettings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the JSON string into an instance of Fruit
|
||||
/// </summary>
|
||||
/// <param name="jsonString">JSON string</param>
|
||||
/// <returns>An instance of Fruit</returns>
|
||||
public static Fruit FromJson(string jsonString)
|
||||
{
|
||||
Fruit newFruit = null;
|
||||
|
||||
if (string.IsNullOrEmpty(jsonString))
|
||||
{
|
||||
return newFruit;
|
||||
}
|
||||
int match = 0;
|
||||
List<string> matchedTypes = new List<string>();
|
||||
|
||||
try
|
||||
{
|
||||
// if it does not contains "AdditionalProperties", use SerializerSettings to deserialize
|
||||
if (typeof(Apple).GetProperty("AdditionalProperties") == null)
|
||||
{
|
||||
newFruit = new Fruit(JsonConvert.DeserializeObject<Apple>(jsonString, Fruit.SerializerSettings));
|
||||
}
|
||||
else
|
||||
{
|
||||
newFruit = new Fruit(JsonConvert.DeserializeObject<Apple>(jsonString, Fruit.AdditionalPropertiesSerializerSettings));
|
||||
}
|
||||
matchedTypes.Add("Apple");
|
||||
match++;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
// deserialization failed, try the next one
|
||||
System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Apple: {1}", jsonString, exception.ToString()));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// if it does not contains "AdditionalProperties", use SerializerSettings to deserialize
|
||||
if (typeof(Banana).GetProperty("AdditionalProperties") == null)
|
||||
{
|
||||
newFruit = new Fruit(JsonConvert.DeserializeObject<Banana>(jsonString, Fruit.SerializerSettings));
|
||||
}
|
||||
else
|
||||
{
|
||||
newFruit = new Fruit(JsonConvert.DeserializeObject<Banana>(jsonString, Fruit.AdditionalPropertiesSerializerSettings));
|
||||
}
|
||||
matchedTypes.Add("Banana");
|
||||
match++;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
// deserialization failed, try the next one
|
||||
System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Banana: {1}", jsonString, exception.ToString()));
|
||||
}
|
||||
|
||||
if (match == 0)
|
||||
{
|
||||
throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined.");
|
||||
}
|
||||
else if (match > 1)
|
||||
{
|
||||
throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes);
|
||||
}
|
||||
|
||||
// deserialization is considered successful at this point if no exception has been thrown.
|
||||
return newFruit;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as Fruit).AreEqual;
|
||||
}
|
||||
@@ -213,7 +97,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of Fruit to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Fruit input)
|
||||
public bool Equals(Fruit? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
@@ -227,8 +111,10 @@ namespace Org.OpenAPITools.Model
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = 41;
|
||||
if (this.ActualInstance != null)
|
||||
hashCode = hashCode * 59 + this.ActualInstance.GetHashCode();
|
||||
if (this.Color != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Color.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
@@ -238,54 +124,82 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Custom JSON converter for Fruit
|
||||
/// A Json converter for type Fruit
|
||||
/// </summary>
|
||||
public class FruitJsonConverter : JsonConverter
|
||||
public class FruitJsonConverter : JsonConverter<Fruit>
|
||||
{
|
||||
/// <summary>
|
||||
/// To write the JSON string
|
||||
/// Returns a boolean if the type is compatible with this converter.
|
||||
/// </summary>
|
||||
/// <param name="writer">JSON writer</param>
|
||||
/// <param name="value">Object to be converted into a JSON string</param>
|
||||
/// <param name="serializer">JSON Serializer</param>
|
||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
{
|
||||
writer.WriteRawValue((string)(typeof(Fruit).GetMethod("ToJson").Invoke(value, null)));
|
||||
}
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <returns></returns>
|
||||
public override bool CanConvert(Type typeToConvert) => typeof(Fruit).IsAssignableFrom(typeToConvert);
|
||||
|
||||
/// <summary>
|
||||
/// To convert a JSON string into an object
|
||||
/// A Json reader.
|
||||
/// </summary>
|
||||
/// <param name="reader">JSON reader</param>
|
||||
/// <param name="objectType">Object type</param>
|
||||
/// <param name="existingValue">Existing value</param>
|
||||
/// <param name="serializer">JSON Serializer</param>
|
||||
/// <returns>The object converted from the JSON string</returns>
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||
/// <param name="reader"></param>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="JsonException"></exception>
|
||||
public override Fruit Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
if(reader.TokenType != JsonToken.Null)
|
||||
int currentDepth = reader.CurrentDepth;
|
||||
|
||||
if (reader.TokenType != JsonTokenType.StartObject)
|
||||
throw new JsonException();
|
||||
|
||||
Utf8JsonReader appleReader = reader;
|
||||
Client.ClientUtils.TryDeserialize<Apple>(ref appleReader, options, out Apple? apple);
|
||||
|
||||
Utf8JsonReader bananaReader = reader;
|
||||
Client.ClientUtils.TryDeserialize<Banana>(ref bananaReader, options, out Banana? banana);
|
||||
|
||||
string? color = default;
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
return Fruit.FromJson(JObject.Load(reader).ToString(Formatting.None));
|
||||
if (reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
||||
break;
|
||||
|
||||
if (reader.TokenType == JsonTokenType.PropertyName)
|
||||
{
|
||||
string? propertyName = reader.GetString();
|
||||
reader.Read();
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "color":
|
||||
color = reader.GetString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
if (apple != null)
|
||||
return new Fruit(apple, color);
|
||||
|
||||
if (banana != null)
|
||||
return new Fruit(banana, color);
|
||||
|
||||
throw new JsonException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if the object can be converted
|
||||
/// A Json writer
|
||||
/// </summary>
|
||||
/// <param name="objectType">Object type</param>
|
||||
/// <returns>True if the object can be converted</returns>
|
||||
public override bool CanConvert(Type objectType)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
/// <param name="writer"></param>
|
||||
/// <param name="fruit"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions options) => throw new NotImplementedException();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,104 +19,45 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// FruitReq
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(FruitReqJsonConverter))]
|
||||
[DataContract(Name = "fruitReq")]
|
||||
public partial class FruitReq : AbstractOpenAPISchema, IEquatable<FruitReq>, IValidatableObject
|
||||
public partial class FruitReq : IEquatable<FruitReq>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FruitReq" /> class.
|
||||
/// </summary>
|
||||
public FruitReq()
|
||||
/// <param name="appleReq">appleReq</param>
|
||||
public FruitReq(AppleReq? appleReq)
|
||||
{
|
||||
this.IsNullable = true;
|
||||
this.SchemaType= "oneOf";
|
||||
AppleReq = appleReq;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FruitReq" /> class
|
||||
/// with the <see cref="AppleReq" /> class
|
||||
/// Initializes a new instance of the <see cref="FruitReq" /> class.
|
||||
/// </summary>
|
||||
/// <param name="actualInstance">An instance of AppleReq.</param>
|
||||
public FruitReq(AppleReq actualInstance)
|
||||
/// <param name="bananaReq">bananaReq</param>
|
||||
public FruitReq(BananaReq? bananaReq)
|
||||
{
|
||||
this.IsNullable = true;
|
||||
this.SchemaType= "oneOf";
|
||||
this.ActualInstance = actualInstance;
|
||||
BananaReq = bananaReq;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FruitReq" /> class
|
||||
/// with the <see cref="BananaReq" /> class
|
||||
/// Gets or Sets fruitReq
|
||||
/// </summary>
|
||||
/// <param name="actualInstance">An instance of BananaReq.</param>
|
||||
public FruitReq(BananaReq actualInstance)
|
||||
{
|
||||
this.IsNullable = true;
|
||||
this.SchemaType= "oneOf";
|
||||
this.ActualInstance = actualInstance;
|
||||
}
|
||||
|
||||
|
||||
private Object _actualInstance;
|
||||
public AppleReq? AppleReq { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ActualInstance
|
||||
/// Gets or Sets fruitReq
|
||||
/// </summary>
|
||||
public override Object ActualInstance
|
||||
{
|
||||
get
|
||||
{
|
||||
return _actualInstance;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value.GetType() == typeof(AppleReq))
|
||||
{
|
||||
this._actualInstance = value;
|
||||
}
|
||||
else if (value.GetType() == typeof(BananaReq))
|
||||
{
|
||||
this._actualInstance = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Invalid instance found. Must be the following types: AppleReq, BananaReq");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the actual instance of `AppleReq`. If the actual instance is not `AppleReq`,
|
||||
/// the InvalidClassException will be thrown
|
||||
/// </summary>
|
||||
/// <returns>An instance of AppleReq</returns>
|
||||
public AppleReq GetAppleReq()
|
||||
{
|
||||
return (AppleReq)this.ActualInstance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the actual instance of `BananaReq`. If the actual instance is not `BananaReq`,
|
||||
/// the InvalidClassException will be thrown
|
||||
/// </summary>
|
||||
/// <returns>An instance of BananaReq</returns>
|
||||
public BananaReq GetBananaReq()
|
||||
{
|
||||
return (BananaReq)this.ActualInstance;
|
||||
}
|
||||
public BananaReq? BananaReq { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -122,97 +65,18 @@ namespace Org.OpenAPITools.Model
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class FruitReq {\n");
|
||||
sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public override string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this.ActualInstance, FruitReq.SerializerSettings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the JSON string into an instance of FruitReq
|
||||
/// </summary>
|
||||
/// <param name="jsonString">JSON string</param>
|
||||
/// <returns>An instance of FruitReq</returns>
|
||||
public static FruitReq FromJson(string jsonString)
|
||||
{
|
||||
FruitReq newFruitReq = null;
|
||||
|
||||
if (string.IsNullOrEmpty(jsonString))
|
||||
{
|
||||
return newFruitReq;
|
||||
}
|
||||
int match = 0;
|
||||
List<string> matchedTypes = new List<string>();
|
||||
|
||||
try
|
||||
{
|
||||
// if it does not contains "AdditionalProperties", use SerializerSettings to deserialize
|
||||
if (typeof(AppleReq).GetProperty("AdditionalProperties") == null)
|
||||
{
|
||||
newFruitReq = new FruitReq(JsonConvert.DeserializeObject<AppleReq>(jsonString, FruitReq.SerializerSettings));
|
||||
}
|
||||
else
|
||||
{
|
||||
newFruitReq = new FruitReq(JsonConvert.DeserializeObject<AppleReq>(jsonString, FruitReq.AdditionalPropertiesSerializerSettings));
|
||||
}
|
||||
matchedTypes.Add("AppleReq");
|
||||
match++;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
// deserialization failed, try the next one
|
||||
System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into AppleReq: {1}", jsonString, exception.ToString()));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// if it does not contains "AdditionalProperties", use SerializerSettings to deserialize
|
||||
if (typeof(BananaReq).GetProperty("AdditionalProperties") == null)
|
||||
{
|
||||
newFruitReq = new FruitReq(JsonConvert.DeserializeObject<BananaReq>(jsonString, FruitReq.SerializerSettings));
|
||||
}
|
||||
else
|
||||
{
|
||||
newFruitReq = new FruitReq(JsonConvert.DeserializeObject<BananaReq>(jsonString, FruitReq.AdditionalPropertiesSerializerSettings));
|
||||
}
|
||||
matchedTypes.Add("BananaReq");
|
||||
match++;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
// deserialization failed, try the next one
|
||||
System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into BananaReq: {1}", jsonString, exception.ToString()));
|
||||
}
|
||||
|
||||
if (match == 0)
|
||||
{
|
||||
throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined.");
|
||||
}
|
||||
else if (match > 1)
|
||||
{
|
||||
throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes);
|
||||
}
|
||||
|
||||
// deserialization is considered successful at this point if no exception has been thrown.
|
||||
return newFruitReq;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as FruitReq).AreEqual;
|
||||
}
|
||||
@@ -222,7 +86,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of FruitReq to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(FruitReq input)
|
||||
public bool Equals(FruitReq? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
@@ -236,8 +100,6 @@ namespace Org.OpenAPITools.Model
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = 41;
|
||||
if (this.ActualInstance != null)
|
||||
hashCode = hashCode * 59 + this.ActualInstance.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
@@ -247,54 +109,78 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Custom JSON converter for FruitReq
|
||||
/// A Json converter for type FruitReq
|
||||
/// </summary>
|
||||
public class FruitReqJsonConverter : JsonConverter
|
||||
public class FruitReqJsonConverter : JsonConverter<FruitReq>
|
||||
{
|
||||
/// <summary>
|
||||
/// To write the JSON string
|
||||
/// Returns a boolean if the type is compatible with this converter.
|
||||
/// </summary>
|
||||
/// <param name="writer">JSON writer</param>
|
||||
/// <param name="value">Object to be converted into a JSON string</param>
|
||||
/// <param name="serializer">JSON Serializer</param>
|
||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
{
|
||||
writer.WriteRawValue((string)(typeof(FruitReq).GetMethod("ToJson").Invoke(value, null)));
|
||||
}
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <returns></returns>
|
||||
public override bool CanConvert(Type typeToConvert) => typeof(FruitReq).IsAssignableFrom(typeToConvert);
|
||||
|
||||
/// <summary>
|
||||
/// To convert a JSON string into an object
|
||||
/// A Json reader.
|
||||
/// </summary>
|
||||
/// <param name="reader">JSON reader</param>
|
||||
/// <param name="objectType">Object type</param>
|
||||
/// <param name="existingValue">Existing value</param>
|
||||
/// <param name="serializer">JSON Serializer</param>
|
||||
/// <returns>The object converted from the JSON string</returns>
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||
/// <param name="reader"></param>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="JsonException"></exception>
|
||||
public override FruitReq Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
if(reader.TokenType != JsonToken.Null)
|
||||
int currentDepth = reader.CurrentDepth;
|
||||
|
||||
if (reader.TokenType != JsonTokenType.StartObject)
|
||||
throw new JsonException();
|
||||
|
||||
Utf8JsonReader appleReqReader = reader;
|
||||
Client.ClientUtils.TryDeserialize<AppleReq>(ref appleReqReader, options, out AppleReq? appleReq);
|
||||
|
||||
Utf8JsonReader bananaReqReader = reader;
|
||||
Client.ClientUtils.TryDeserialize<BananaReq>(ref bananaReqReader, options, out BananaReq? bananaReq);
|
||||
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
return FruitReq.FromJson(JObject.Load(reader).ToString(Formatting.None));
|
||||
if (reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
||||
break;
|
||||
|
||||
if (reader.TokenType == JsonTokenType.PropertyName)
|
||||
{
|
||||
string? propertyName = reader.GetString();
|
||||
reader.Read();
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
if (appleReq != null)
|
||||
return new FruitReq(appleReq);
|
||||
|
||||
if (bananaReq != null)
|
||||
return new FruitReq(bananaReq);
|
||||
|
||||
throw new JsonException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if the object can be converted
|
||||
/// A Json writer
|
||||
/// </summary>
|
||||
/// <param name="objectType">Object type</param>
|
||||
/// <returns>True if the object can be converted</returns>
|
||||
public override bool CanConvert(Type objectType)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
/// <param name="writer"></param>
|
||||
/// <param name="fruitReq"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions options) => throw new NotImplementedException();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,82 +29,36 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// GmFruit
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(GmFruitJsonConverter))]
|
||||
[DataContract(Name = "gmFruit")]
|
||||
public partial class GmFruit : AbstractOpenAPISchema, IEquatable<GmFruit>, IValidatableObject
|
||||
public partial class GmFruit : IEquatable<GmFruit>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GmFruit" /> class
|
||||
/// with the <see cref="Apple" /> class
|
||||
/// Initializes a new instance of the <see cref="GmFruit" /> class.
|
||||
/// </summary>
|
||||
/// <param name="actualInstance">An instance of Apple.</param>
|
||||
public GmFruit(Apple actualInstance)
|
||||
/// <param name="apple">apple</param>
|
||||
/// <param name="banana">banana</param>
|
||||
/// <param name="color">color</param>
|
||||
public GmFruit(Apple? apple, Banana? banana, string? color = default)
|
||||
{
|
||||
this.IsNullable = false;
|
||||
this.SchemaType= "anyOf";
|
||||
this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
|
||||
Apple = apple;
|
||||
Banana = banana;
|
||||
Color = color;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GmFruit" /> class
|
||||
/// with the <see cref="Banana" /> class
|
||||
/// Gets or Sets gmFruit
|
||||
/// </summary>
|
||||
/// <param name="actualInstance">An instance of Banana.</param>
|
||||
public GmFruit(Banana actualInstance)
|
||||
{
|
||||
this.IsNullable = false;
|
||||
this.SchemaType= "anyOf";
|
||||
this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
|
||||
}
|
||||
|
||||
|
||||
private Object _actualInstance;
|
||||
public Apple? Apple { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ActualInstance
|
||||
/// Gets or Sets gmFruit
|
||||
/// </summary>
|
||||
public override Object ActualInstance
|
||||
{
|
||||
get
|
||||
{
|
||||
return _actualInstance;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value.GetType() == typeof(Apple))
|
||||
{
|
||||
this._actualInstance = value;
|
||||
}
|
||||
else if (value.GetType() == typeof(Banana))
|
||||
{
|
||||
this._actualInstance = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Invalid instance found. Must be the following types: Apple, Banana");
|
||||
}
|
||||
}
|
||||
}
|
||||
public Banana? Banana { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get the actual instance of `Apple`. If the actual instance is not `Apple`,
|
||||
/// the InvalidClassException will be thrown
|
||||
/// Gets or Sets Color
|
||||
/// </summary>
|
||||
/// <returns>An instance of Apple</returns>
|
||||
public Apple GetApple()
|
||||
{
|
||||
return (Apple)this.ActualInstance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the actual instance of `Banana`. If the actual instance is not `Banana`,
|
||||
/// the InvalidClassException will be thrown
|
||||
/// </summary>
|
||||
/// <returns>An instance of Banana</returns>
|
||||
public Banana GetBanana()
|
||||
{
|
||||
return (Banana)this.ActualInstance;
|
||||
}
|
||||
[JsonPropertyName("color")]
|
||||
public string? Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -112,70 +66,19 @@ namespace Org.OpenAPITools.Model
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class GmFruit {\n");
|
||||
sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n");
|
||||
sb.Append(" Color: ").Append(Color).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public override string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this.ActualInstance, GmFruit.SerializerSettings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the JSON string into an instance of GmFruit
|
||||
/// </summary>
|
||||
/// <param name="jsonString">JSON string</param>
|
||||
/// <returns>An instance of GmFruit</returns>
|
||||
public static GmFruit FromJson(string jsonString)
|
||||
{
|
||||
GmFruit newGmFruit = null;
|
||||
|
||||
if (string.IsNullOrEmpty(jsonString))
|
||||
{
|
||||
return newGmFruit;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
newGmFruit = new GmFruit(JsonConvert.DeserializeObject<Apple>(jsonString, GmFruit.SerializerSettings));
|
||||
// deserialization is considered successful at this point if no exception has been thrown.
|
||||
return newGmFruit;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
// deserialization failed, try the next one
|
||||
System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Apple: {1}", jsonString, exception.ToString()));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
newGmFruit = new GmFruit(JsonConvert.DeserializeObject<Banana>(jsonString, GmFruit.SerializerSettings));
|
||||
// deserialization is considered successful at this point if no exception has been thrown.
|
||||
return newGmFruit;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
// deserialization failed, try the next one
|
||||
System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Banana: {1}", jsonString, exception.ToString()));
|
||||
}
|
||||
|
||||
// no match found, throw an exception
|
||||
throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as GmFruit).AreEqual;
|
||||
}
|
||||
@@ -185,7 +88,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of GmFruit to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(GmFruit input)
|
||||
public bool Equals(GmFruit? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
@@ -199,8 +102,10 @@ namespace Org.OpenAPITools.Model
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = 41;
|
||||
if (this.ActualInstance != null)
|
||||
hashCode = hashCode * 59 + this.ActualInstance.GetHashCode();
|
||||
if (this.Color != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Color.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
@@ -210,54 +115,76 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Custom JSON converter for GmFruit
|
||||
/// A Json converter for type GmFruit
|
||||
/// </summary>
|
||||
public class GmFruitJsonConverter : JsonConverter
|
||||
public class GmFruitJsonConverter : JsonConverter<GmFruit>
|
||||
{
|
||||
/// <summary>
|
||||
/// To write the JSON string
|
||||
/// Returns a boolean if the type is compatible with this converter.
|
||||
/// </summary>
|
||||
/// <param name="writer">JSON writer</param>
|
||||
/// <param name="value">Object to be converted into a JSON string</param>
|
||||
/// <param name="serializer">JSON Serializer</param>
|
||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
{
|
||||
writer.WriteRawValue((string)(typeof(GmFruit).GetMethod("ToJson").Invoke(value, null)));
|
||||
}
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <returns></returns>
|
||||
public override bool CanConvert(Type typeToConvert) => typeof(GmFruit).IsAssignableFrom(typeToConvert);
|
||||
|
||||
/// <summary>
|
||||
/// To convert a JSON string into an object
|
||||
/// A Json reader.
|
||||
/// </summary>
|
||||
/// <param name="reader">JSON reader</param>
|
||||
/// <param name="objectType">Object type</param>
|
||||
/// <param name="existingValue">Existing value</param>
|
||||
/// <param name="serializer">JSON Serializer</param>
|
||||
/// <returns>The object converted from the JSON string</returns>
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||
/// <param name="reader"></param>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="JsonException"></exception>
|
||||
public override GmFruit Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
if(reader.TokenType != JsonToken.Null)
|
||||
int currentDepth = reader.CurrentDepth;
|
||||
|
||||
if (reader.TokenType != JsonTokenType.StartObject)
|
||||
throw new JsonException();
|
||||
|
||||
Utf8JsonReader appleReader = reader;
|
||||
Client.ClientUtils.TryDeserialize<Apple>(ref appleReader, options, out Apple? apple);
|
||||
|
||||
Utf8JsonReader bananaReader = reader;
|
||||
Client.ClientUtils.TryDeserialize<Banana>(ref bananaReader, options, out Banana? banana);
|
||||
|
||||
string? color = default;
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
return GmFruit.FromJson(JObject.Load(reader).ToString(Formatting.None));
|
||||
if (reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
||||
break;
|
||||
|
||||
if (reader.TokenType == JsonTokenType.PropertyName)
|
||||
{
|
||||
string? propertyName = reader.GetString();
|
||||
reader.Read();
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
case "color":
|
||||
color = reader.GetString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
return new GmFruit(apple, banana, color);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if the object can be converted
|
||||
/// A Json writer
|
||||
/// </summary>
|
||||
/// <param name="objectType">Object type</param>
|
||||
/// <returns>True if the object can be converted</returns>
|
||||
public override bool CanConvert(Type objectType)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
/// <param name="writer"></param>
|
||||
/// <param name="gmFruit"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, GmFruit gmFruit, JsonSerializerOptions options) => throw new NotImplementedException();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,12 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using JsonSubTypes;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -30,45 +29,30 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// GrandparentAnimal
|
||||
/// </summary>
|
||||
[DataContract(Name = "GrandparentAnimal")]
|
||||
[JsonConverter(typeof(JsonSubtypes), "PetType")]
|
||||
[JsonSubtypes.KnownSubType(typeof(ChildCat), "ChildCat")]
|
||||
[JsonSubtypes.KnownSubType(typeof(ParentPet), "ParentPet")]
|
||||
public partial class GrandparentAnimal : IEquatable<GrandparentAnimal>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GrandparentAnimal" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
protected GrandparentAnimal()
|
||||
{
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GrandparentAnimal" /> class.
|
||||
/// </summary>
|
||||
/// <param name="petType">petType (required).</param>
|
||||
/// <param name="petType">petType (required)</param>
|
||||
public GrandparentAnimal(string petType)
|
||||
{
|
||||
// to ensure "petType" is required (not null)
|
||||
if (petType == null) {
|
||||
throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null");
|
||||
}
|
||||
this.PetType = petType;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
if (petType == null)
|
||||
throw new ArgumentNullException("petType is a required property for GrandparentAnimal and cannot be null.");
|
||||
PetType = petType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets PetType
|
||||
/// </summary>
|
||||
[DataMember(Name = "pet_type", IsRequired = true, EmitDefaultValue = false)]
|
||||
[JsonPropertyName("pet_type")]
|
||||
public string PetType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -84,21 +68,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as GrandparentAnimal).AreEqual;
|
||||
}
|
||||
@@ -108,7 +83,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of GrandparentAnimal to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(GrandparentAnimal input)
|
||||
public bool Equals(GrandparentAnimal? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,51 +29,36 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// HasOnlyReadOnly
|
||||
/// </summary>
|
||||
[DataContract(Name = "hasOnlyReadOnly")]
|
||||
public partial class HasOnlyReadOnly : IEquatable<HasOnlyReadOnly>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HasOnlyReadOnly" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
public HasOnlyReadOnly()
|
||||
/// <param name="bar">bar</param>
|
||||
/// <param name="foo">foo</param>
|
||||
public HasOnlyReadOnly(string? bar = default, string? foo = default)
|
||||
{
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
Bar = bar;
|
||||
Foo = foo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Bar
|
||||
/// </summary>
|
||||
[DataMember(Name = "bar", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("bar")]
|
||||
public string? Bar { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns false as Bar should not be serialized given that it's read-only.
|
||||
/// </summary>
|
||||
/// <returns>false (boolean)</returns>
|
||||
public bool ShouldSerializeBar()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or Sets Foo
|
||||
/// </summary>
|
||||
[DataMember(Name = "foo", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("foo")]
|
||||
public string? Foo { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns false as Foo should not be serialized given that it's read-only.
|
||||
/// </summary>
|
||||
/// <returns>false (boolean)</returns>
|
||||
public bool ShouldSerializeFoo()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -90,21 +75,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as HasOnlyReadOnly).AreEqual;
|
||||
}
|
||||
@@ -114,7 +90,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of HasOnlyReadOnly to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(HasOnlyReadOnly input)
|
||||
public bool Equals(HasOnlyReadOnly? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,30 +29,28 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
|
||||
/// </summary>
|
||||
[DataContract(Name = "HealthCheckResult")]
|
||||
public partial class HealthCheckResult : IEquatable<HealthCheckResult>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HealthCheckResult" /> class.
|
||||
/// </summary>
|
||||
/// <param name="nullableMessage">nullableMessage.</param>
|
||||
/// <param name="nullableMessage">nullableMessage</param>
|
||||
public HealthCheckResult(string? nullableMessage = default)
|
||||
{
|
||||
this.NullableMessage = nullableMessage;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
NullableMessage = nullableMessage;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets NullableMessage
|
||||
/// </summary>
|
||||
[DataMember(Name = "NullableMessage", EmitDefaultValue = true)]
|
||||
[JsonPropertyName("NullableMessage")]
|
||||
public string? NullableMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -68,21 +66,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as HealthCheckResult).AreEqual;
|
||||
}
|
||||
@@ -92,7 +81,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of HealthCheckResult to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(HealthCheckResult input)
|
||||
public bool Equals(HealthCheckResult? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,30 +29,28 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// InlineResponseDefault
|
||||
/// </summary>
|
||||
[DataContract(Name = "inline_response_default")]
|
||||
public partial class InlineResponseDefault : IEquatable<InlineResponseDefault>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InlineResponseDefault" /> class.
|
||||
/// </summary>
|
||||
/// <param name="_string">_string.</param>
|
||||
/// <param name="_string">_string</param>
|
||||
public InlineResponseDefault(Foo? _string = default)
|
||||
{
|
||||
this.String = _string;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
String = _string;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets String
|
||||
/// </summary>
|
||||
[DataMember(Name = "string", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("string")]
|
||||
public Foo? String { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -68,21 +66,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as InlineResponseDefault).AreEqual;
|
||||
}
|
||||
@@ -92,7 +81,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of InlineResponseDefault to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(InlineResponseDefault input)
|
||||
public bool Equals(InlineResponseDefault? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,44 +29,28 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// IsoscelesTriangle
|
||||
/// </summary>
|
||||
[DataContract(Name = "IsoscelesTriangle")]
|
||||
public partial class IsoscelesTriangle : IEquatable<IsoscelesTriangle>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="IsoscelesTriangle" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
protected IsoscelesTriangle() { }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="IsoscelesTriangle" /> class.
|
||||
/// </summary>
|
||||
/// <param name="shapeType">shapeType (required).</param>
|
||||
/// <param name="triangleType">triangleType (required).</param>
|
||||
public IsoscelesTriangle(string shapeType, string triangleType)
|
||||
/// <param name="shapeInterface">shapeInterface</param>
|
||||
/// <param name="triangleInterface">triangleInterface</param>
|
||||
public IsoscelesTriangle(ShapeInterface shapeInterface, TriangleInterface triangleInterface)
|
||||
{
|
||||
// to ensure "shapeType" is required (not null)
|
||||
if (shapeType == null) {
|
||||
throw new ArgumentNullException("shapeType is a required property for IsoscelesTriangle and cannot be null");
|
||||
}
|
||||
this.ShapeType = shapeType;
|
||||
// to ensure "triangleType" is required (not null)
|
||||
if (triangleType == null) {
|
||||
throw new ArgumentNullException("triangleType is a required property for IsoscelesTriangle and cannot be null");
|
||||
}
|
||||
this.TriangleType = triangleType;
|
||||
ShapeInterface = shapeInterface;
|
||||
TriangleInterface = triangleInterface;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ShapeType
|
||||
/// Gets or Sets IsoscelesTriangle
|
||||
/// </summary>
|
||||
[DataMember(Name = "shapeType", IsRequired = true, EmitDefaultValue = false)]
|
||||
public string ShapeType { get; set; }
|
||||
public ShapeInterface? ShapeInterface { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets TriangleType
|
||||
/// Gets or Sets IsoscelesTriangle
|
||||
/// </summary>
|
||||
[DataMember(Name = "triangleType", IsRequired = true, EmitDefaultValue = false)]
|
||||
public string TriangleType { get; set; }
|
||||
public TriangleInterface? TriangleInterface { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -76,27 +60,16 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class IsoscelesTriangle {\n");
|
||||
sb.Append(" ShapeType: ").Append(ShapeType).Append("\n");
|
||||
sb.Append(" TriangleType: ").Append(TriangleType).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as IsoscelesTriangle).AreEqual;
|
||||
}
|
||||
@@ -106,7 +79,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of IsoscelesTriangle to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(IsoscelesTriangle input)
|
||||
public bool Equals(IsoscelesTriangle? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
@@ -120,14 +93,6 @@ namespace Org.OpenAPITools.Model
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = 41;
|
||||
if (this.ShapeType != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.ShapeType.GetHashCode();
|
||||
}
|
||||
if (this.TriangleType != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.TriangleType.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
@@ -143,4 +108,64 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Json converter for type IsoscelesTriangle
|
||||
/// </summary>
|
||||
public class IsoscelesTriangleJsonConverter : JsonConverter<IsoscelesTriangle>
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a boolean if the type is compatible with this converter.
|
||||
/// </summary>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <returns></returns>
|
||||
public override bool CanConvert(Type typeToConvert) => typeof(IsoscelesTriangle).IsAssignableFrom(typeToConvert);
|
||||
|
||||
/// <summary>
|
||||
/// A Json reader.
|
||||
/// </summary>
|
||||
/// <param name="reader"></param>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="JsonException"></exception>
|
||||
public override IsoscelesTriangle Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
int currentDepth = reader.CurrentDepth;
|
||||
|
||||
if (reader.TokenType != JsonTokenType.StartObject)
|
||||
throw new JsonException();
|
||||
|
||||
Utf8JsonReader shapeInterfaceReader = reader;
|
||||
Client.ClientUtils.TryDeserialize<ShapeInterface>(ref shapeInterfaceReader, options, out ShapeInterface? shapeInterface);
|
||||
Utf8JsonReader triangleInterfaceReader = reader;
|
||||
Client.ClientUtils.TryDeserialize<TriangleInterface>(ref triangleInterfaceReader, options, out TriangleInterface? triangleInterface);
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
if (reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
||||
break;
|
||||
|
||||
if (reader.TokenType == JsonTokenType.PropertyName)
|
||||
{
|
||||
string? propertyName = reader.GetString();
|
||||
reader.Read();
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new IsoscelesTriangle(shapeInterface, triangleInterface);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A Json writer
|
||||
/// </summary>
|
||||
/// <param name="writer"></param>
|
||||
/// <param name="isoscelesTriangle"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions options) => throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,30 +29,28 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// List
|
||||
/// </summary>
|
||||
[DataContract(Name = "List")]
|
||||
public partial class List : IEquatable<List>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="List" /> class.
|
||||
/// </summary>
|
||||
/// <param name="_123list">_123list.</param>
|
||||
/// <param name="_123list">_123list</param>
|
||||
public List(string? _123list = default)
|
||||
{
|
||||
this._123List = _123list;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
_123List = _123list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets _123List
|
||||
/// </summary>
|
||||
[DataMember(Name = "123-list", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("123-list")]
|
||||
public string? _123List { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -68,21 +66,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as List).AreEqual;
|
||||
}
|
||||
@@ -92,7 +81,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of List to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(List input)
|
||||
public bool Equals(List? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,122 +19,65 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using JsonSubTypes;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Mammal
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(MammalJsonConverter))]
|
||||
[DataContract(Name = "mammal")]
|
||||
public partial class Mammal : AbstractOpenAPISchema, IEquatable<Mammal>, IValidatableObject
|
||||
public partial class Mammal : IEquatable<Mammal>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Mammal" /> class
|
||||
/// with the <see cref="Pig" /> class
|
||||
/// Initializes a new instance of the <see cref="Mammal" /> class.
|
||||
/// </summary>
|
||||
/// <param name="actualInstance">An instance of Pig.</param>
|
||||
public Mammal(Pig actualInstance)
|
||||
/// <param name="pig">pig</param>
|
||||
public Mammal(Pig? pig)
|
||||
{
|
||||
this.IsNullable = false;
|
||||
this.SchemaType= "oneOf";
|
||||
this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
|
||||
Pig = pig;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Mammal" /> class
|
||||
/// with the <see cref="Whale" /> class
|
||||
/// Initializes a new instance of the <see cref="Mammal" /> class.
|
||||
/// </summary>
|
||||
/// <param name="actualInstance">An instance of Whale.</param>
|
||||
public Mammal(Whale actualInstance)
|
||||
/// <param name="whale">whale</param>
|
||||
public Mammal(Whale? whale)
|
||||
{
|
||||
this.IsNullable = false;
|
||||
this.SchemaType= "oneOf";
|
||||
this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
|
||||
Whale = whale;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Mammal" /> class
|
||||
/// with the <see cref="Zebra" /> class
|
||||
/// Initializes a new instance of the <see cref="Mammal" /> class.
|
||||
/// </summary>
|
||||
/// <param name="actualInstance">An instance of Zebra.</param>
|
||||
public Mammal(Zebra actualInstance)
|
||||
/// <param name="zebra">zebra</param>
|
||||
public Mammal(Zebra? zebra)
|
||||
{
|
||||
this.IsNullable = false;
|
||||
this.SchemaType= "oneOf";
|
||||
this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
|
||||
}
|
||||
|
||||
|
||||
private Object _actualInstance;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ActualInstance
|
||||
/// </summary>
|
||||
public override Object ActualInstance
|
||||
{
|
||||
get
|
||||
{
|
||||
return _actualInstance;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value.GetType() == typeof(Pig))
|
||||
{
|
||||
this._actualInstance = value;
|
||||
}
|
||||
else if (value.GetType() == typeof(Whale))
|
||||
{
|
||||
this._actualInstance = value;
|
||||
}
|
||||
else if (value.GetType() == typeof(Zebra))
|
||||
{
|
||||
this._actualInstance = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Invalid instance found. Must be the following types: Pig, Whale, Zebra");
|
||||
}
|
||||
}
|
||||
Zebra = zebra;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the actual instance of `Pig`. If the actual instance is not `Pig`,
|
||||
/// the InvalidClassException will be thrown
|
||||
/// Gets or Sets mammal
|
||||
/// </summary>
|
||||
/// <returns>An instance of Pig</returns>
|
||||
public Pig GetPig()
|
||||
{
|
||||
return (Pig)this.ActualInstance;
|
||||
}
|
||||
public Pig? Pig { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get the actual instance of `Whale`. If the actual instance is not `Whale`,
|
||||
/// the InvalidClassException will be thrown
|
||||
/// Gets or Sets mammal
|
||||
/// </summary>
|
||||
/// <returns>An instance of Whale</returns>
|
||||
public Whale GetWhale()
|
||||
{
|
||||
return (Whale)this.ActualInstance;
|
||||
}
|
||||
public Whale? Whale { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Get the actual instance of `Zebra`. If the actual instance is not `Zebra`,
|
||||
/// the InvalidClassException will be thrown
|
||||
/// Gets or Sets mammal
|
||||
/// </summary>
|
||||
/// <returns>An instance of Zebra</returns>
|
||||
public Zebra GetZebra()
|
||||
{
|
||||
return (Zebra)this.ActualInstance;
|
||||
}
|
||||
public Zebra? Zebra { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -140,117 +85,19 @@ namespace Org.OpenAPITools.Model
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class Mammal {\n");
|
||||
sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public override string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this.ActualInstance, Mammal.SerializerSettings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the JSON string into an instance of Mammal
|
||||
/// </summary>
|
||||
/// <param name="jsonString">JSON string</param>
|
||||
/// <returns>An instance of Mammal</returns>
|
||||
public static Mammal FromJson(string jsonString)
|
||||
{
|
||||
Mammal newMammal = null;
|
||||
|
||||
if (string.IsNullOrEmpty(jsonString))
|
||||
{
|
||||
return newMammal;
|
||||
}
|
||||
int match = 0;
|
||||
List<string> matchedTypes = new List<string>();
|
||||
|
||||
try
|
||||
{
|
||||
// if it does not contains "AdditionalProperties", use SerializerSettings to deserialize
|
||||
if (typeof(Pig).GetProperty("AdditionalProperties") == null)
|
||||
{
|
||||
newMammal = new Mammal(JsonConvert.DeserializeObject<Pig>(jsonString, Mammal.SerializerSettings));
|
||||
}
|
||||
else
|
||||
{
|
||||
newMammal = new Mammal(JsonConvert.DeserializeObject<Pig>(jsonString, Mammal.AdditionalPropertiesSerializerSettings));
|
||||
}
|
||||
matchedTypes.Add("Pig");
|
||||
match++;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
// deserialization failed, try the next one
|
||||
System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Pig: {1}", jsonString, exception.ToString()));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// if it does not contains "AdditionalProperties", use SerializerSettings to deserialize
|
||||
if (typeof(Whale).GetProperty("AdditionalProperties") == null)
|
||||
{
|
||||
newMammal = new Mammal(JsonConvert.DeserializeObject<Whale>(jsonString, Mammal.SerializerSettings));
|
||||
}
|
||||
else
|
||||
{
|
||||
newMammal = new Mammal(JsonConvert.DeserializeObject<Whale>(jsonString, Mammal.AdditionalPropertiesSerializerSettings));
|
||||
}
|
||||
matchedTypes.Add("Whale");
|
||||
match++;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
// deserialization failed, try the next one
|
||||
System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Whale: {1}", jsonString, exception.ToString()));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// if it does not contains "AdditionalProperties", use SerializerSettings to deserialize
|
||||
if (typeof(Zebra).GetProperty("AdditionalProperties") == null)
|
||||
{
|
||||
newMammal = new Mammal(JsonConvert.DeserializeObject<Zebra>(jsonString, Mammal.SerializerSettings));
|
||||
}
|
||||
else
|
||||
{
|
||||
newMammal = new Mammal(JsonConvert.DeserializeObject<Zebra>(jsonString, Mammal.AdditionalPropertiesSerializerSettings));
|
||||
}
|
||||
matchedTypes.Add("Zebra");
|
||||
match++;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
// deserialization failed, try the next one
|
||||
System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into Zebra: {1}", jsonString, exception.ToString()));
|
||||
}
|
||||
|
||||
if (match == 0)
|
||||
{
|
||||
throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined.");
|
||||
}
|
||||
else if (match > 1)
|
||||
{
|
||||
throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes);
|
||||
}
|
||||
|
||||
// deserialization is considered successful at this point if no exception has been thrown.
|
||||
return newMammal;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as Mammal).AreEqual;
|
||||
}
|
||||
@@ -260,7 +107,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of Mammal to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Mammal input)
|
||||
public bool Equals(Mammal? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
@@ -274,8 +121,10 @@ namespace Org.OpenAPITools.Model
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = 41;
|
||||
if (this.ActualInstance != null)
|
||||
hashCode = hashCode * 59 + this.ActualInstance.GetHashCode();
|
||||
if (this.AdditionalProperties != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
@@ -285,54 +134,94 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
return this.BaseValidate(validationContext);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
protected IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> BaseValidate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Custom JSON converter for Mammal
|
||||
/// A Json converter for type Mammal
|
||||
/// </summary>
|
||||
public class MammalJsonConverter : JsonConverter
|
||||
public class MammalJsonConverter : JsonConverter<Mammal>
|
||||
{
|
||||
/// <summary>
|
||||
/// To write the JSON string
|
||||
/// Returns a boolean if the type is compatible with this converter.
|
||||
/// </summary>
|
||||
/// <param name="writer">JSON writer</param>
|
||||
/// <param name="value">Object to be converted into a JSON string</param>
|
||||
/// <param name="serializer">JSON Serializer</param>
|
||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
{
|
||||
writer.WriteRawValue((string)(typeof(Mammal).GetMethod("ToJson").Invoke(value, null)));
|
||||
}
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <returns></returns>
|
||||
public override bool CanConvert(Type typeToConvert) => typeof(Mammal).IsAssignableFrom(typeToConvert);
|
||||
|
||||
/// <summary>
|
||||
/// To convert a JSON string into an object
|
||||
/// A Json reader.
|
||||
/// </summary>
|
||||
/// <param name="reader">JSON reader</param>
|
||||
/// <param name="objectType">Object type</param>
|
||||
/// <param name="existingValue">Existing value</param>
|
||||
/// <param name="serializer">JSON Serializer</param>
|
||||
/// <returns>The object converted from the JSON string</returns>
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||
/// <param name="reader"></param>
|
||||
/// <param name="typeToConvert"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="JsonException"></exception>
|
||||
public override Mammal Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
if(reader.TokenType != JsonToken.Null)
|
||||
int currentDepth = reader.CurrentDepth;
|
||||
|
||||
if (reader.TokenType != JsonTokenType.StartObject)
|
||||
throw new JsonException();
|
||||
|
||||
Utf8JsonReader pigReader = reader;
|
||||
Client.ClientUtils.TryDeserialize<Pig>(ref pigReader, options, out Pig? pig);
|
||||
|
||||
Utf8JsonReader whaleReader = reader;
|
||||
Client.ClientUtils.TryDeserialize<Whale>(ref whaleReader, options, out Whale? whale);
|
||||
|
||||
Utf8JsonReader zebraReader = reader;
|
||||
Client.ClientUtils.TryDeserialize<Zebra>(ref zebraReader, options, out Zebra? zebra);
|
||||
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
return Mammal.FromJson(JObject.Load(reader).ToString(Formatting.None));
|
||||
if (reader.TokenType == JsonTokenType.EndObject && currentDepth == reader.CurrentDepth)
|
||||
break;
|
||||
|
||||
if (reader.TokenType == JsonTokenType.PropertyName)
|
||||
{
|
||||
string? propertyName = reader.GetString();
|
||||
reader.Read();
|
||||
|
||||
switch (propertyName)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
if (pig != null)
|
||||
return new Mammal(pig);
|
||||
|
||||
if (whale != null)
|
||||
return new Mammal(whale);
|
||||
|
||||
if (zebra != null)
|
||||
return new Mammal(zebra);
|
||||
|
||||
throw new JsonException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if the object can be converted
|
||||
/// A Json writer
|
||||
/// </summary>
|
||||
/// <param name="objectType">Object type</param>
|
||||
/// <returns>True if the object can be converted</returns>
|
||||
public override bool CanConvert(Type objectType)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
/// <param name="writer"></param>
|
||||
/// <param name="mammal"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions options) => throw new NotImplementedException();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// <auto-generated>
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
@@ -7,6 +8,7 @@
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -17,11 +19,9 @@ using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
@@ -29,13 +29,26 @@ namespace Org.OpenAPITools.Model
|
||||
/// <summary>
|
||||
/// MapTest
|
||||
/// </summary>
|
||||
[DataContract(Name = "MapTest")]
|
||||
public partial class MapTest : IEquatable<MapTest>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MapTest" /> class.
|
||||
/// </summary>
|
||||
/// <param name="mapMapOfString">mapMapOfString</param>
|
||||
/// <param name="mapOfEnumString">mapOfEnumString</param>
|
||||
/// <param name="directMap">directMap</param>
|
||||
/// <param name="indirectMap">indirectMap</param>
|
||||
public MapTest(Dictionary<string, Dictionary<string, string>>? mapMapOfString = default, Dictionary<string, InnerEnum>? mapOfEnumString = default, Dictionary<string, bool>? directMap = default, Dictionary<string, bool>? indirectMap = default)
|
||||
{
|
||||
MapMapOfString = mapMapOfString;
|
||||
MapOfEnumString = mapOfEnumString;
|
||||
DirectMap = directMap;
|
||||
IndirectMap = indirectMap;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines Inner
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum InnerEnum
|
||||
{
|
||||
/// <summary>
|
||||
@@ -53,51 +66,35 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets MapOfEnumString
|
||||
/// </summary>
|
||||
[DataMember(Name = "map_of_enum_string", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("map_of_enum_string")]
|
||||
public Dictionary<string, InnerEnum>? MapOfEnumString { get; set; }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MapTest" /> class.
|
||||
/// </summary>
|
||||
/// <param name="mapMapOfString">mapMapOfString.</param>
|
||||
/// <param name="mapOfEnumString">mapOfEnumString.</param>
|
||||
/// <param name="directMap">directMap.</param>
|
||||
/// <param name="indirectMap">indirectMap.</param>
|
||||
public MapTest(Dictionary<string, Dictionary<string, string>>? mapMapOfString = default, Dictionary<string, InnerEnum>? mapOfEnumString = default, Dictionary<string, bool>? directMap = default, Dictionary<string, bool>? indirectMap = default)
|
||||
{
|
||||
this.MapMapOfString = mapMapOfString;
|
||||
this.MapOfEnumString = mapOfEnumString;
|
||||
this.DirectMap = directMap;
|
||||
this.IndirectMap = indirectMap;
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets MapMapOfString
|
||||
/// </summary>
|
||||
[DataMember(Name = "map_map_of_string", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("map_map_of_string")]
|
||||
public Dictionary<string, Dictionary<string, string>>? MapMapOfString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets DirectMap
|
||||
/// </summary>
|
||||
[DataMember(Name = "direct_map", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("direct_map")]
|
||||
public Dictionary<string, bool>? DirectMap { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets IndirectMap
|
||||
/// </summary>
|
||||
[DataMember(Name = "indirect_map", EmitDefaultValue = false)]
|
||||
[JsonPropertyName("indirect_map")]
|
||||
public Dictionary<string, bool>? IndirectMap { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, object> AdditionalProperties { get; set; }
|
||||
public Dictionary<string, JsonElement> AdditionalProperties { get; set; } = new Dictionary<string, JsonElement>();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
@@ -116,21 +113,12 @@ namespace Org.OpenAPITools.Model
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
public override bool Equals(object? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as MapTest).AreEqual;
|
||||
}
|
||||
@@ -140,7 +128,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of MapTest to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(MapTest input)
|
||||
public bool Equals(MapTest? input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user