From f3af25b10cda2458a433fd02a3f2a2940cff3e22 Mon Sep 17 00:00:00 2001 From: devhl-labs Date: Sun, 4 May 2025 10:30:40 -0400 Subject: [PATCH] fixed encoding (#21207) --- .../csharp-functions/HttpSigningConfiguration.mustache | 4 ++-- .../main/resources/csharp/HttpSigningConfiguration.mustache | 2 +- .../src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs | 2 +- .../src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs | 2 +- .../src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs | 2 +- .../src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs | 2 +- .../src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs | 2 +- .../src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs | 2 +- .../src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs | 2 +- .../src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs | 2 +- .../src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs | 2 +- .../src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs | 2 +- .../src/Org.OpenAPITools/Client/HttpSigningConfiguration.cs | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp-functions/HttpSigningConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp-functions/HttpSigningConfiguration.mustache index 58c9cf6dba3..89935303ab2 100644 --- a/modules/openapi-generator/src/main/resources/csharp-functions/HttpSigningConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-functions/HttpSigningConfiguration.mustache @@ -128,12 +128,12 @@ namespace {{packageName}}.Client { // array foreach (var value in parameter.Value) { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key) + "[]", value); + httpValues.Add({{#net90OrLater}}HttpUtility.UrlEncode({{/net90OrLater}}parameter.Key{{#net90OrLater}}){{/net90OrLater}} + "[]", value); } } else { - httpValues.Add(HttpUtility.UrlEncode(parameter.Key), parameter.Value[0]); + httpValues.Add({{#net90OrLater}}HttpUtility.UrlEncode({{/net90OrLater}}parameter.Key{{#net90OrLater}}){{/net90OrLater}}, parameter.Value[0]); } #else if (parameter.Value.Count > 1) diff --git a/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache b/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache index 97b855dc534..2d56fde4aec 100644 --- a/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/HttpSigningConfiguration.mustache @@ -134,7 +134,7 @@ namespace {{packageName}}.Client { #if (NETCOREAPP) string framework = RuntimeInformation.FrameworkDescription; - string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); + string key = framework.StartsWith(".NET 9") ? parameter.Key : {{#net90OrLater}}HttpUtility.UrlEncode({{/net90OrLater}}parameter.Key{{#net90OrLater}}){{/net90OrLater}}; if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) 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 f3d8d64b477..60d62fa0d9f 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 @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Client { #if (NETCOREAPP) string framework = RuntimeInformation.FrameworkDescription; - string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); + string key = framework.StartsWith(".NET 9") ? parameter.Key : HttpUtility.UrlEncode(parameter.Key); if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) 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 6973f2bf669..d4067aed3c3 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 @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Client { #if (NETCOREAPP) string framework = RuntimeInformation.FrameworkDescription; - string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); + string key = framework.StartsWith(".NET 9") ? parameter.Key : parameter.Key; if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) 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 6973f2bf669..d4067aed3c3 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 @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Client { #if (NETCOREAPP) string framework = RuntimeInformation.FrameworkDescription; - string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); + string key = framework.StartsWith(".NET 9") ? parameter.Key : parameter.Key; if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) 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 6973f2bf669..d4067aed3c3 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 @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Client { #if (NETCOREAPP) string framework = RuntimeInformation.FrameworkDescription; - string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); + string key = framework.StartsWith(".NET 9") ? parameter.Key : parameter.Key; if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) 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 f3d8d64b477..805b45bd084 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 @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Client { #if (NETCOREAPP) string framework = RuntimeInformation.FrameworkDescription; - string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); + string key = framework.StartsWith(".NET 9") ? parameter.Key : parameter.Key; if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) 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 f3d8d64b477..805b45bd084 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 @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Client { #if (NETCOREAPP) string framework = RuntimeInformation.FrameworkDescription; - string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); + string key = framework.StartsWith(".NET 9") ? parameter.Key : parameter.Key; if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) 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 f3d8d64b477..60d62fa0d9f 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 @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Client { #if (NETCOREAPP) string framework = RuntimeInformation.FrameworkDescription; - string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); + string key = framework.StartsWith(".NET 9") ? parameter.Key : HttpUtility.UrlEncode(parameter.Key); if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) 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 6973f2bf669..d4067aed3c3 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 @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Client { #if (NETCOREAPP) string framework = RuntimeInformation.FrameworkDescription; - string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); + string key = framework.StartsWith(".NET 9") ? parameter.Key : parameter.Key; if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) 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 6973f2bf669..d4067aed3c3 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 @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Client { #if (NETCOREAPP) string framework = RuntimeInformation.FrameworkDescription; - string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); + string key = framework.StartsWith(".NET 9") ? parameter.Key : parameter.Key; if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) 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 f3d8d64b477..60d62fa0d9f 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 @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Client { #if (NETCOREAPP) string framework = RuntimeInformation.FrameworkDescription; - string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); + string key = framework.StartsWith(".NET 9") ? parameter.Key : HttpUtility.UrlEncode(parameter.Key); if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value) 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 6973f2bf669..d4067aed3c3 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 @@ -142,7 +142,7 @@ namespace Org.OpenAPITools.Client { #if (NETCOREAPP) string framework = RuntimeInformation.FrameworkDescription; - string key = framework.StartsWith(".NET 9")?parameter.Key:HttpUtility.UrlEncode(parameter.Key); + string key = framework.StartsWith(".NET 9") ? parameter.Key : parameter.Key; if (parameter.Value.Count > 1) { // array foreach (var value in parameter.Value)