-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[csharp] Changed enums to start from 0 (#15503)
* zero based enums * changed locale
- Loading branch information
1 parent
780d266
commit fd20632
Showing
75 changed files
with
1,738 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2279,3 +2279,8 @@ components: | |
pattern: ^a | ||
- type: string | ||
pattern: ^b | ||
ZeroBasedEnum: | ||
type: string | ||
enum: | ||
- unknown | ||
- notUnknown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...ore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/ZeroBasedEnum.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Org.OpenAPITools.Model.ZeroBasedEnum | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
61 changes: 61 additions & 0 deletions
61
...nAPIClient-ConditionalSerialization/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* 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 Xunit; | ||
|
||
using System; | ||
using System.Linq; | ||
using System.IO; | ||
using System.Collections.Generic; | ||
using Org.OpenAPITools.Model; | ||
using Org.OpenAPITools.Client; | ||
using System.Reflection; | ||
using Newtonsoft.Json; | ||
|
||
namespace Org.OpenAPITools.Test.Model | ||
{ | ||
/// <summary> | ||
/// Class for testing ZeroBasedEnum | ||
/// </summary> | ||
/// <remarks> | ||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). | ||
/// Please update the test case below to test the model. | ||
/// </remarks> | ||
public class ZeroBasedEnumTests : IDisposable | ||
{ | ||
// TODO uncomment below to declare an instance variable for ZeroBasedEnum | ||
//private ZeroBasedEnum instance; | ||
|
||
public ZeroBasedEnumTests() | ||
{ | ||
// TODO uncomment below to create an instance of ZeroBasedEnum | ||
//instance = new ZeroBasedEnum(); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
// Cleanup when everything is done. | ||
} | ||
|
||
/// <summary> | ||
/// Test an instance of ZeroBasedEnum | ||
/// </summary> | ||
[Fact] | ||
public void ZeroBasedEnumInstanceTest() | ||
{ | ||
// TODO uncomment below to test "IsType" ZeroBasedEnum | ||
//Assert.IsType<ZeroBasedEnum>(instance); | ||
} | ||
|
||
|
||
|
||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
...etcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/ZeroBasedEnum.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* 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.Collections; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Linq; | ||
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.ComponentModel.DataAnnotations; | ||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter; | ||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils; | ||
|
||
namespace Org.OpenAPITools.Model | ||
{ | ||
/// <summary> | ||
/// Defines ZeroBasedEnum | ||
/// </summary> | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
public enum ZeroBasedEnum | ||
{ | ||
/// <summary> | ||
/// Enum Unknown for value: unknown | ||
/// </summary> | ||
[EnumMember(Value = "unknown")] | ||
Unknown, | ||
|
||
/// <summary> | ||
/// Enum NotUnknown for value: notUnknown | ||
/// </summary> | ||
[EnumMember(Value = "notUnknown")] | ||
NotUnknown | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...sharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/ZeroBasedEnum.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Org.OpenAPITools.Model.ZeroBasedEnum | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
|
||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) | ||
|
60 changes: 60 additions & 0 deletions
60
...penAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Model/ZeroBasedEnumTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* 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 Xunit; | ||
|
||
using System; | ||
using System.Linq; | ||
using System.IO; | ||
using System.Collections.Generic; | ||
using Org.OpenAPITools.Model; | ||
using Org.OpenAPITools.Client; | ||
using System.Reflection; | ||
|
||
namespace Org.OpenAPITools.Test.Model | ||
{ | ||
/// <summary> | ||
/// Class for testing ZeroBasedEnum | ||
/// </summary> | ||
/// <remarks> | ||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech). | ||
/// Please update the test case below to test the model. | ||
/// </remarks> | ||
public class ZeroBasedEnumTests : IDisposable | ||
{ | ||
// TODO uncomment below to declare an instance variable for ZeroBasedEnum | ||
//private ZeroBasedEnum instance; | ||
|
||
public ZeroBasedEnumTests() | ||
{ | ||
// TODO uncomment below to create an instance of ZeroBasedEnum | ||
//instance = new ZeroBasedEnum(); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
// Cleanup when everything is done. | ||
} | ||
|
||
/// <summary> | ||
/// Test an instance of ZeroBasedEnum | ||
/// </summary> | ||
[Fact] | ||
public void ZeroBasedEnumInstanceTest() | ||
{ | ||
// TODO uncomment below to test "IsType" ZeroBasedEnum | ||
//Assert.IsType<ZeroBasedEnum>(instance); | ||
} | ||
|
||
|
||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.