diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/AbstractOpenAPISchema.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/AbstractOpenAPISchema.mustache index 6f288f0c34a0..bd65e7144bb1 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/AbstractOpenAPISchema.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/AbstractOpenAPISchema.mustache @@ -11,6 +11,9 @@ namespace {{packageName}}.{{modelPackage}} /// {{>visibility}} abstract partial class AbstractOpenAPISchema { + /// + /// Custom JSON serializer + /// protected readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings { // OpenAPI generated types generally hide default constructors. diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache index 5221740208c8..d327765bd82c 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/ApiClient.mustache @@ -435,7 +435,7 @@ namespace {{packageName}}.Client InterceptRequest(req); IRestResponse response; - if (RetryConfiguration.RetryPolicy != null) + if (RetryConfiguration.RetryPolicy != null) { var policy = RetryConfiguration.RetryPolicy; var policyResult = policy.ExecuteAndCapture(() => client.Execute(req)); diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache index ee7ab978ef2a..175dc6c0858a 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache @@ -143,7 +143,7 @@ namespace {{packageName}}.Client } {{/-last}} {{/enumValues}} - } + } }{{^-last}},{{/-last}} {{#-last}} } @@ -397,7 +397,7 @@ namespace {{packageName}}.Client /// Gets or sets the servers. /// /// The servers. - public virtual IList> Servers + public virtual IList> Servers { get { return _servers; } set @@ -447,7 +447,7 @@ namespace {{packageName}}.Client { IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); - + if (inputVariables.ContainsKey(variable.Key)) { if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/HttpSigningConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/HttpSigningConfiguration.mustache index 89ece6b65807..0f59f32b478d 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/HttpSigningConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/HttpSigningConfiguration.mustache @@ -26,10 +26,10 @@ namespace {{packageName}}.Client SigningAlgorithm = "PKCS1-v15"; } #endregion - + #region Properties /// - ///Gets the Api keyId + ///Gets the Api keyId /// public string KeyId { get; set; } @@ -141,7 +141,7 @@ namespace {{packageName}}.Client var dateTime = DateTime.Now; String Digest = String.Empty; - //get the body + //get the body string requestBody = string.Empty; if (requestOptions.Data != null) { @@ -296,7 +296,7 @@ namespace {{packageName}}.Client } /// - /// Gets the ECDSA signature + /// Gets the ECDSA signature /// /// /// @@ -313,16 +313,16 @@ namespace {{packageName}}.Client var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); var ecdsa = ECDsa.Create(); - var bytCount = 0; #if (NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0) + var byteCount = 0; if (configuration.KeyPassPhrase != null) { - ecdsa.ImportEncryptedPkcs8PrivateKey(keyPassPhrase, keyBytes, out bytCount); + ecdsa.ImportEncryptedPkcs8PrivateKey(keyPassPhrase, keyBytes, out byteCount); } else { - ecdsa.ImportPkcs8PrivateKey(keyBytes, out bytCount); + ecdsa.ImportPkcs8PrivateKey(keyBytes, out byteCount); } var signedBytes = ecdsa.SignHash(dataToSign); var derBytes = ConvertToECDSAANS1Format(signedBytes); @@ -339,7 +339,7 @@ namespace {{packageName}}.Client { var derBytes = new List(); byte derLength = 68; //default lenght for ECDSA code signinged bit 0x44 - byte rbytesLength = 32; //R length 0x20 + byte rbytesLength = 32; //R length 0x20 byte sbytesLength = 32; //S length 0x20 var rBytes = new List(); var sBytes = new List(); @@ -610,7 +610,7 @@ namespace {{packageName}}.Client { // ---- Now hash consecutively for count times ------ if (j == 0) - result = data00; //initialize + result = data00; //initialize else { Array.Copy(result, hashtarget, result.Length); @@ -669,8 +669,8 @@ namespace {{packageName}}.Client var ecPrivateKeyFooter = "END EC PRIVATE KEY"; var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; var rsaPrivateFooter = "END RSA PRIVATE KEY"; - var pkcs8Header = "BEGIN PRIVATE KEY"; - var pkcs8Footer = "END PRIVATE KEY"; + //var pkcs8Header = "BEGIN PRIVATE KEY"; + //var pkcs8Footer = "END PRIVATE KEY"; var keyType = PrivateKeyType.None; var key = File.ReadAllLines(keyFilePath); diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache index 0246a36ed3ad..a12e0337af01 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache @@ -89,9 +89,10 @@ } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of {{classname}} /// /// JSON string + /// An instance of {{classname}} public static {{classname}} FromJson(string jsonString) { {{classname}} new{{classname}} = new {{classname}}(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs index f65853a26051..520c1c8a6d51 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Model/SpecialModelNameTests.cs @@ -42,7 +42,6 @@ public void SpecialModelNameInstanceTest() //Assert.IsType (instance, "variable 'instance' is a SpecialModelName"); } - /// /// Test the property 'SpecialPropertyName' /// @@ -50,7 +49,7 @@ public void SpecialModelNameInstanceTest() public void SpecialPropertyNameTest() { SpecialModelName s = new SpecialModelName(); - s.SpecialPropertyName = 123l; + s.SpecialPropertyName = 123L; Assert.Equal("{\"$special[property.name]\":123}", JsonConvert.SerializeObject(s)); // comment out the following as the result is OS-dependent //Assert.Equal("{\"id\":123}", s.ToJson()); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs index 40870dcffc69..d46baa056daa 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/ApiClient.cs @@ -439,7 +439,7 @@ private ApiResponse Exec(RestRequest req, IReadableConfiguration configura InterceptRequest(req); IRestResponse response; - if (RetryConfiguration.RetryPolicy != null) + if (RetryConfiguration.RetryPolicy != null) { var policy = RetryConfiguration.RetryPolicy; var policyResult = policy.ExecuteAndCapture(() => client.Execute(req)); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs index 18f051847002..96683c563d41 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/Configuration.cs @@ -128,7 +128,7 @@ public Configuration() "dev-petstore" } } - } + } }, { "port", new Dictionary { @@ -140,7 +140,7 @@ public Configuration() "8080" } } - } + } } } } @@ -162,7 +162,7 @@ public Configuration() "v2" } } - } + } } } } @@ -415,7 +415,7 @@ public virtual IDictionary ApiKey /// Gets or sets the servers. /// /// The servers. - public virtual IList> Servers + public virtual IList> Servers { get { return _servers; } set @@ -465,7 +465,7 @@ public string GetServerUrl(int index, Dictionary inputVariables) { IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); - + if (inputVariables.ContainsKey(variable.Key)) { if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index df3ad7b2f3f9..3bf59ad7f451 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -26,10 +26,10 @@ public HttpSigningConfiguration() SigningAlgorithm = "PKCS1-v15"; } #endregion - + #region Properties /// - ///Gets the Api keyId + ///Gets the Api keyId /// public string KeyId { get; set; } @@ -141,7 +141,7 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m var dateTime = DateTime.Now; String Digest = String.Empty; - //get the body + //get the body string requestBody = string.Empty; if (requestOptions.Data != null) { @@ -296,7 +296,7 @@ private string GetRSASignature(byte[] stringToSign) } /// - /// Gets the ECDSA signature + /// Gets the ECDSA signature /// /// /// @@ -313,16 +313,16 @@ private string GetECDSASignature(byte[] dataToSign) var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); var ecdsa = ECDsa.Create(); - var bytCount = 0; #if (NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0) + var byteCount = 0; if (configuration.KeyPassPhrase != null) { - ecdsa.ImportEncryptedPkcs8PrivateKey(keyPassPhrase, keyBytes, out bytCount); + ecdsa.ImportEncryptedPkcs8PrivateKey(keyPassPhrase, keyBytes, out byteCount); } else { - ecdsa.ImportPkcs8PrivateKey(keyBytes, out bytCount); + ecdsa.ImportPkcs8PrivateKey(keyBytes, out byteCount); } var signedBytes = ecdsa.SignHash(dataToSign); var derBytes = ConvertToECDSAANS1Format(signedBytes); @@ -339,7 +339,7 @@ private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) { var derBytes = new List(); byte derLength = 68; //default lenght for ECDSA code signinged bit 0x44 - byte rbytesLength = 32; //R length 0x20 + byte rbytesLength = 32; //R length 0x20 byte sbytesLength = 32; //S length 0x20 var rBytes = new List(); var sBytes = new List(); @@ -610,7 +610,7 @@ private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int { // ---- Now hash consecutively for count times ------ if (j == 0) - result = data00; //initialize + result = data00; //initialize else { Array.Copy(result, hashtarget, result.Length); @@ -669,8 +669,8 @@ private PrivateKeyType GetKeyType(string keyFilePath) var ecPrivateKeyFooter = "END EC PRIVATE KEY"; var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; var rsaPrivateFooter = "END RSA PRIVATE KEY"; - var pkcs8Header = "BEGIN PRIVATE KEY"; - var pkcs8Footer = "END PRIVATE KEY"; + //var pkcs8Header = "BEGIN PRIVATE KEY"; + //var pkcs8Footer = "END PRIVATE KEY"; var keyType = PrivateKeyType.None; var key = File.ReadAllLines(keyFilePath); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs index c2a6dd6d40ec..2d3fda31aee1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs @@ -19,6 +19,9 @@ namespace Org.OpenAPITools.Model /// public abstract partial class AbstractOpenAPISchema { + /// + /// Custom JSON serializer + /// protected readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings { // OpenAPI generated types generally hide default constructors. diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Fruit.cs index 859f7018a040..ee556c02c617 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Fruit.cs @@ -137,9 +137,10 @@ public override string ToJson() } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of Fruit /// /// JSON string + /// An instance of Fruit public static Fruit FromJson(string jsonString) { Fruit newFruit = new Fruit(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FruitReq.cs index bc5a1054383b..6e997adbd07c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/FruitReq.cs @@ -137,9 +137,10 @@ public override string ToJson() } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of FruitReq /// /// JSON string + /// An instance of FruitReq public static FruitReq FromJson(string jsonString) { FruitReq newFruitReq = new FruitReq(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Mammal.cs index 82c6cb5f1bff..88add0eabe13 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Mammal.cs @@ -164,9 +164,10 @@ public override string ToJson() } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of Mammal /// /// JSON string + /// An instance of Mammal public static Mammal FromJson(string jsonString) { Mammal newMammal = new Mammal(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableShape.cs index a709910375ba..6b7003a52fb0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/NullableShape.cs @@ -138,9 +138,10 @@ public override string ToJson() } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of NullableShape /// /// JSON string + /// An instance of NullableShape public static NullableShape FromJson(string jsonString) { NullableShape newNullableShape = new NullableShape(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pig.cs index 6aa62f1a345e..ae6baa4019c9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Pig.cs @@ -138,9 +138,10 @@ public override string ToJson() } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of Pig /// /// JSON string + /// An instance of Pig public static Pig FromJson(string jsonString) { Pig newPig = new Pig(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Quadrilateral.cs index 928ec48f2639..80b27aeaeb2f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -138,9 +138,10 @@ public override string ToJson() } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of Quadrilateral /// /// JSON string + /// An instance of Quadrilateral public static Quadrilateral FromJson(string jsonString) { Quadrilateral newQuadrilateral = new Quadrilateral(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Shape.cs index e72104fddcac..95ecc2dfd0fe 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Shape.cs @@ -138,9 +138,10 @@ public override string ToJson() } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of Shape /// /// JSON string + /// An instance of Shape public static Shape FromJson(string jsonString) { Shape newShape = new Shape(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeOrNull.cs index 5dc4f41aca7c..838b4f885dc3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -138,9 +138,10 @@ public override string ToJson() } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of ShapeOrNull /// /// JSON string + /// An instance of ShapeOrNull public static ShapeOrNull FromJson(string jsonString) { ShapeOrNull newShapeOrNull = new ShapeOrNull(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Triangle.cs index 4194a853154b..ba98a3b1d257 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/Triangle.cs @@ -164,9 +164,10 @@ public override string ToJson() } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of Triangle /// /// JSON string + /// An instance of Triangle public static Triangle FromJson(string jsonString) { Triangle newTriangle = new Triangle(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs index 3b0ae496fc59..7b807ef86b85 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -440,7 +440,7 @@ private ApiResponse Exec(RestRequest req, IReadableConfiguration configura InterceptRequest(req); IRestResponse response; - if (RetryConfiguration.RetryPolicy != null) + if (RetryConfiguration.RetryPolicy != null) { var policy = RetryConfiguration.RetryPolicy; var policyResult = policy.ExecuteAndCapture(() => client.Execute(req)); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Configuration.cs index 844b70770c34..6ea883d24e3b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/Configuration.cs @@ -133,7 +133,7 @@ public Configuration() "dev-petstore" } } - } + } }, { "port", new Dictionary { @@ -145,7 +145,7 @@ public Configuration() "8080" } } - } + } } } } @@ -167,7 +167,7 @@ public Configuration() "v2" } } - } + } } } } @@ -420,7 +420,7 @@ public virtual IDictionary ApiKey /// Gets or sets the servers. /// /// The servers. - public virtual IList> Servers + public virtual IList> Servers { get { return _servers; } set @@ -470,7 +470,7 @@ public string GetServerUrl(int index, Dictionary inputVariables) { IReadOnlyDictionary serverVariables = (IReadOnlyDictionary)(variable.Value); - + if (inputVariables.ContainsKey(variable.Key)) { if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key])) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index df3ad7b2f3f9..3bf59ad7f451 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -26,10 +26,10 @@ public HttpSigningConfiguration() SigningAlgorithm = "PKCS1-v15"; } #endregion - + #region Properties /// - ///Gets the Api keyId + ///Gets the Api keyId /// public string KeyId { get; set; } @@ -141,7 +141,7 @@ internal Dictionary GetHttpSignedHeader(string basePath,string m var dateTime = DateTime.Now; String Digest = String.Empty; - //get the body + //get the body string requestBody = string.Empty; if (requestOptions.Data != null) { @@ -296,7 +296,7 @@ private string GetRSASignature(byte[] stringToSign) } /// - /// Gets the ECDSA signature + /// Gets the ECDSA signature /// /// /// @@ -313,16 +313,16 @@ private string GetECDSASignature(byte[] dataToSign) var ecKeyBase64String = keyStr.Replace(ecKeyHeader, "").Replace(ecKeyFooter, "").Trim(); var keyBytes = System.Convert.FromBase64String(ecKeyBase64String); var ecdsa = ECDsa.Create(); - var bytCount = 0; #if (NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0) + var byteCount = 0; if (configuration.KeyPassPhrase != null) { - ecdsa.ImportEncryptedPkcs8PrivateKey(keyPassPhrase, keyBytes, out bytCount); + ecdsa.ImportEncryptedPkcs8PrivateKey(keyPassPhrase, keyBytes, out byteCount); } else { - ecdsa.ImportPkcs8PrivateKey(keyBytes, out bytCount); + ecdsa.ImportPkcs8PrivateKey(keyBytes, out byteCount); } var signedBytes = ecdsa.SignHash(dataToSign); var derBytes = ConvertToECDSAANS1Format(signedBytes); @@ -339,7 +339,7 @@ private byte[] ConvertToECDSAANS1Format(byte[] signedBytes) { var derBytes = new List(); byte derLength = 68; //default lenght for ECDSA code signinged bit 0x44 - byte rbytesLength = 32; //R length 0x20 + byte rbytesLength = 32; //R length 0x20 byte sbytesLength = 32; //S length 0x20 var rBytes = new List(); var sBytes = new List(); @@ -610,7 +610,7 @@ private byte[] GetEncryptedKey(byte[] salt, SecureString secpswd, int count, int { // ---- Now hash consecutively for count times ------ if (j == 0) - result = data00; //initialize + result = data00; //initialize else { Array.Copy(result, hashtarget, result.Length); @@ -669,8 +669,8 @@ private PrivateKeyType GetKeyType(string keyFilePath) var ecPrivateKeyFooter = "END EC PRIVATE KEY"; var rsaPrivateKeyHeader = "BEGIN RSA PRIVATE KEY"; var rsaPrivateFooter = "END RSA PRIVATE KEY"; - var pkcs8Header = "BEGIN PRIVATE KEY"; - var pkcs8Footer = "END PRIVATE KEY"; + //var pkcs8Header = "BEGIN PRIVATE KEY"; + //var pkcs8Footer = "END PRIVATE KEY"; var keyType = PrivateKeyType.None; var key = File.ReadAllLines(keyFilePath); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs index c2a6dd6d40ec..2d3fda31aee1 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/AbstractOpenAPISchema.cs @@ -19,6 +19,9 @@ namespace Org.OpenAPITools.Model /// public abstract partial class AbstractOpenAPISchema { + /// + /// Custom JSON serializer + /// protected readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings { // OpenAPI generated types generally hide default constructors. diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Fruit.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Fruit.cs index 859f7018a040..ee556c02c617 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Fruit.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Fruit.cs @@ -137,9 +137,10 @@ public override string ToJson() } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of Fruit /// /// JSON string + /// An instance of Fruit public static Fruit FromJson(string jsonString) { Fruit newFruit = new Fruit(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FruitReq.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FruitReq.cs index bc5a1054383b..6e997adbd07c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FruitReq.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/FruitReq.cs @@ -137,9 +137,10 @@ public override string ToJson() } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of FruitReq /// /// JSON string + /// An instance of FruitReq public static FruitReq FromJson(string jsonString) { FruitReq newFruitReq = new FruitReq(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Mammal.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Mammal.cs index 043e20f486ec..ec33598d3b52 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Mammal.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Mammal.cs @@ -164,9 +164,10 @@ public override string ToJson() } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of Mammal /// /// JSON string + /// An instance of Mammal public static Mammal FromJson(string jsonString) { Mammal newMammal = new Mammal(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableShape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableShape.cs index 9b11da2ba18a..c5eac2897769 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableShape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/NullableShape.cs @@ -138,9 +138,10 @@ public override string ToJson() } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of NullableShape /// /// JSON string + /// An instance of NullableShape public static NullableShape FromJson(string jsonString) { NullableShape newNullableShape = new NullableShape(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pig.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pig.cs index b459268c7c75..d61ca3d16dc2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pig.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Pig.cs @@ -138,9 +138,10 @@ public override string ToJson() } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of Pig /// /// JSON string + /// An instance of Pig public static Pig FromJson(string jsonString) { Pig newPig = new Pig(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Quadrilateral.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Quadrilateral.cs index fcf2fa13a8e8..69e004d99b1b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Quadrilateral.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Quadrilateral.cs @@ -138,9 +138,10 @@ public override string ToJson() } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of Quadrilateral /// /// JSON string + /// An instance of Quadrilateral public static Quadrilateral FromJson(string jsonString) { Quadrilateral newQuadrilateral = new Quadrilateral(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Shape.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Shape.cs index 422b36510728..f9fa8ce1eb3d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Shape.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Shape.cs @@ -138,9 +138,10 @@ public override string ToJson() } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of Shape /// /// JSON string + /// An instance of Shape public static Shape FromJson(string jsonString) { Shape newShape = new Shape(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeOrNull.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeOrNull.cs index 5ae425f807e3..3ea7b875fbb3 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeOrNull.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/ShapeOrNull.cs @@ -138,9 +138,10 @@ public override string ToJson() } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of ShapeOrNull /// /// JSON string + /// An instance of ShapeOrNull public static ShapeOrNull FromJson(string jsonString) { ShapeOrNull newShapeOrNull = new ShapeOrNull(); diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Triangle.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Triangle.cs index 198a81823f8b..8dc4576c57c5 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Triangle.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/Triangle.cs @@ -164,9 +164,10 @@ public override string ToJson() } /// - /// Converts the JSON string into the object + /// Converts the JSON string into an instance of Triangle /// /// JSON string + /// An instance of Triangle public static Triangle FromJson(string jsonString) { Triangle newTriangle = new Triangle();