diff --git a/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache index 3105952c247..97b855dc534 100644 --- a/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache @@ -133,16 +133,18 @@ namespace {{packageName}}.Client foreach (var parameter in requestOptions.QueryParameters) { #if (NETCOREAPP) + string framework = RuntimeInformation.FrameworkDescription; + string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key) + "[]", value); + httpValues.Add(key + "[]", value); } } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(key, parameter.Value[0]); } #else if (parameter.Value.Count > 1) diff --git a/samples/client/petstore/csharp/httpclient/net9/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/httpclient/net9/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index c362a4f5051..f3d8d64b477 100644 --- a/samples/client/petstore/csharp/httpclient/net9/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/httpclient/net9/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -141,16 +141,18 @@ namespace Org.OpenAPITools.Client foreach (var parameter in requestOptions.QueryParameters) { #if (NETCOREAPP) + string framework = RuntimeInformation.FrameworkDescription; + string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key) + "[]", value); + httpValues.Add(key + "[]", value); } } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(key, parameter.Value[0]); } #else if (parameter.Value.Count > 1) diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index c370847420c..6973f2bf669 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -141,16 +141,18 @@ namespace Org.OpenAPITools.Client foreach (var parameter in requestOptions.QueryParameters) { #if (NETCOREAPP) + string framework = RuntimeInformation.FrameworkDescription; + string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key) + "[]", value); + httpValues.Add(key + "[]", value); } } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(key, parameter.Value[0]); } #else if (parameter.Value.Count > 1) diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index c370847420c..6973f2bf669 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -141,16 +141,18 @@ namespace Org.OpenAPITools.Client foreach (var parameter in requestOptions.QueryParameters) { #if (NETCOREAPP) + string framework = RuntimeInformation.FrameworkDescription; + string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key) + "[]", value); + httpValues.Add(key + "[]", value); } } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(key, parameter.Value[0]); } #else if (parameter.Value.Count > 1) diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index c370847420c..6973f2bf669 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -141,16 +141,18 @@ namespace Org.OpenAPITools.Client foreach (var parameter in requestOptions.QueryParameters) { #if (NETCOREAPP) + string framework = RuntimeInformation.FrameworkDescription; + string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key) + "[]", value); + httpValues.Add(key + "[]", value); } } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(key, parameter.Value[0]); } #else if (parameter.Value.Count > 1) diff --git a/samples/client/petstore/csharp/restsharp/net8/EnumMappings/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/restsharp/net8/EnumMappings/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index c362a4f5051..f3d8d64b477 100644 --- a/samples/client/petstore/csharp/restsharp/net8/EnumMappings/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net8/EnumMappings/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -141,16 +141,18 @@ namespace Org.OpenAPITools.Client foreach (var parameter in requestOptions.QueryParameters) { #if (NETCOREAPP) + string framework = RuntimeInformation.FrameworkDescription; + string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key) + "[]", value); + httpValues.Add(key + "[]", value); } } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(key, parameter.Value[0]); } #else if (parameter.Value.Count > 1) diff --git a/samples/client/petstore/csharp/restsharp/net8/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/restsharp/net8/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index c362a4f5051..f3d8d64b477 100644 --- a/samples/client/petstore/csharp/restsharp/net8/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net8/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -141,16 +141,18 @@ namespace Org.OpenAPITools.Client foreach (var parameter in requestOptions.QueryParameters) { #if (NETCOREAPP) + string framework = RuntimeInformation.FrameworkDescription; + string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key) + "[]", value); + httpValues.Add(key + "[]", value); } } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(key, parameter.Value[0]); } #else if (parameter.Value.Count > 1) diff --git a/samples/client/petstore/csharp/restsharp/net9/EnumMappings/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/restsharp/net9/EnumMappings/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index c362a4f5051..f3d8d64b477 100644 --- a/samples/client/petstore/csharp/restsharp/net9/EnumMappings/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/net9/EnumMappings/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -141,16 +141,18 @@ namespace Org.OpenAPITools.Client foreach (var parameter in requestOptions.QueryParameters) { #if (NETCOREAPP) + string framework = RuntimeInformation.FrameworkDescription; + string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key) + "[]", value); + httpValues.Add(key + "[]", value); } } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(key, parameter.Value[0]); } #else if (parameter.Value.Count > 1) diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index c370847420c..6973f2bf669 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -141,16 +141,18 @@ namespace Org.OpenAPITools.Client foreach (var parameter in requestOptions.QueryParameters) { #if (NETCOREAPP) + string framework = RuntimeInformation.FrameworkDescription; + string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key) + "[]", value); + httpValues.Add(key + "[]", value); } } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(key, parameter.Value[0]); } #else if (parameter.Value.Count > 1) diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index c370847420c..6973f2bf669 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -141,16 +141,18 @@ namespace Org.OpenAPITools.Client foreach (var parameter in requestOptions.QueryParameters) { #if (NETCOREAPP) + string framework = RuntimeInformation.FrameworkDescription; + string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key) + "[]", value); + httpValues.Add(key + "[]", value); } } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(key, parameter.Value[0]); } #else if (parameter.Value.Count > 1) diff --git a/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index c362a4f5051..f3d8d64b477 100644 --- a/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -141,16 +141,18 @@ namespace Org.OpenAPITools.Client foreach (var parameter in requestOptions.QueryParameters) { #if (NETCOREAPP) + string framework = RuntimeInformation.FrameworkDescription; + string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key) + "[]", value); + httpValues.Add(key + "[]", value); } } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(key, parameter.Value[0]); } #else if (parameter.Value.Count > 1) diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs index c370847420c..6973f2bf669 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs @@ -141,16 +141,18 @@ namespace Org.OpenAPITools.Client foreach (var parameter in requestOptions.QueryParameters) { #if (NETCOREAPP) + string framework = RuntimeInformation.FrameworkDescription; + string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key) + "[]", value); + httpValues.Add(key + "[]", value); } } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add(key, parameter.Value[0]); } #else if (parameter.Value.Count > 1)