From 1fd137496f1019b4836d278b32acc16eca7ad4df Mon Sep 17 00:00:00 2001 From: alfredo Date: Tue, 13 Aug 2024 13:05:40 -0600 Subject: [PATCH 1/3] fix: csharp mustash fully qualify namespace Path The generated code of Csharp get a fully quallify namespace for PATH using Path = global::System.IO.Path; --- .../src/main/resources/csharp/ApiClient.mustache | 1 + .../csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs | 1 + .../MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs | 1 + .../net4.7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs | 1 + .../net4.8/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs | 1 + .../ParameterMappings/src/Org.OpenAPITools/Client/ApiClient.cs | 1 + .../net7/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs | 1 + .../net7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs | 1 + .../UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiClient.cs | 1 + .../src/Org.OpenAPITools/Client/ApiClient.cs | 1 + .../Petstore/src/Org.OpenAPITools/Client/ApiClient.cs | 1 + 11 files changed, 11 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache index 1cf23cc2bc5b..a75c061fbd68 100644 --- a/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache @@ -23,6 +23,7 @@ using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; +using Path = global::System.IO.Path; {{#supportsRetry}} using Polly; {{/supportsRetry}} diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs index e3ae4e14ff07..bb8fd5fcdacb 100644 --- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs @@ -29,6 +29,7 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; +using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Model; diff --git a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs index 1fcf07903a62..119c055f66bd 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs @@ -29,6 +29,7 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; +using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Client.Auth; using Org.OpenAPITools.Model; diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs index e383b0f70fed..73019d5d22c2 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -29,6 +29,7 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; +using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Client.Auth; using Org.OpenAPITools.Model; diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs index e383b0f70fed..73019d5d22c2 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -29,6 +29,7 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; +using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Client.Auth; using Org.OpenAPITools.Model; diff --git a/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/ApiClient.cs index e66ebeceeb22..744c6e8bad86 100644 --- a/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/ApiClient.cs @@ -28,6 +28,7 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; +using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Model; diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs index 3b6edaa8b48c..a69e5c43630a 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs @@ -28,6 +28,7 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; +using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Client.Auth; using Org.OpenAPITools.Model; diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs index 3b6edaa8b48c..a69e5c43630a 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -28,6 +28,7 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; +using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Client.Auth; using Org.OpenAPITools.Model; diff --git a/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiClient.cs index c98004a0527b..a5248752b165 100644 --- a/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiClient.cs @@ -28,6 +28,7 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; +using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Model; diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs index e383b0f70fed..73019d5d22c2 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs @@ -29,6 +29,7 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; +using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Client.Auth; using Org.OpenAPITools.Model; diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs index e383b0f70fed..73019d5d22c2 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -29,6 +29,7 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; +using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Client.Auth; using Org.OpenAPITools.Model; From 6d7ed68ae15d65ad93d9cbdefdd1ecfc3677a6a3 Mon Sep 17 00:00:00 2001 From: alfredo Date: Tue, 13 Aug 2024 15:40:20 -0600 Subject: [PATCH 2/3] mend --- .../src/Org.OpenAPITools/Client/ApiClient.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs index 556ac5015243..64f47ac223f3 100644 --- a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs @@ -29,6 +29,7 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; +using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Model; From cf70b7a1223bd5cb0b6e51e62275c20270ccd629 Mon Sep 17 00:00:00 2001 From: alfredo Date: Tue, 13 Aug 2024 20:43:53 -0600 Subject: [PATCH 3/3] Remove alias for fully qualify Path class --- .../src/main/resources/csharp/ApiClient.mustache | 5 ++--- .../src/Org.OpenAPITools/Client/ApiClient.cs | 5 ++--- .../src/Org.OpenAPITools/Client/ApiClient.cs | 5 ++--- .../src/Org.OpenAPITools/Client/ApiClient.cs | 5 ++--- .../net4.7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs | 5 ++--- .../net4.8/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs | 5 ++--- .../src/Org.OpenAPITools/Client/ApiClient.cs | 5 ++--- .../EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs | 5 ++--- .../net7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs | 5 ++--- .../src/Org.OpenAPITools/Client/ApiClient.cs | 5 ++--- .../src/Org.OpenAPITools/Client/ApiClient.cs | 5 ++--- .../Petstore/src/Org.OpenAPITools/Client/ApiClient.cs | 5 ++--- 12 files changed, 24 insertions(+), 36 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache index a75c061fbd68..050314a0e669 100644 --- a/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/ApiClient.mustache @@ -23,7 +23,6 @@ using RestSharp; using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; -using Path = global::System.IO.Path; {{#supportsRetry}} using Polly; {{/supportsRetry}} @@ -110,7 +109,7 @@ namespace {{packageName}}.Client if (response.Headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() + ? global::System.IO.Path.GetTempPath() : _configuration.TempFolderPath; var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); foreach (var header in response.Headers) @@ -378,7 +377,7 @@ namespace {{packageName}}.Client var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } diff --git a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs index bb8fd5fcdacb..f3183ab338f1 100644 --- a/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/echo_api/csharp-restsharp/src/Org.OpenAPITools/Client/ApiClient.cs @@ -29,7 +29,6 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; -using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Model; @@ -111,7 +110,7 @@ internal object Deserialize(RestResponse response, Type type) if (response.Headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() + ? global::System.IO.Path.GetTempPath() : _configuration.TempFolderPath; var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); foreach (var header in response.Headers) @@ -378,7 +377,7 @@ private RestRequest NewRequest( var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } diff --git a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs index 64f47ac223f3..68957c7508ab 100644 --- a/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/others/csharp-complex-files/src/Org.OpenAPITools/Client/ApiClient.cs @@ -29,7 +29,6 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; -using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Model; @@ -111,7 +110,7 @@ internal object Deserialize(RestResponse response, Type type) if (response.Headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() + ? global::System.IO.Path.GetTempPath() : _configuration.TempFolderPath; var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); foreach (var header in response.Headers) @@ -378,7 +377,7 @@ private RestRequest NewRequest( var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs index 119c055f66bd..0bfea976f16f 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs @@ -29,7 +29,6 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; -using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Client.Auth; using Org.OpenAPITools.Model; @@ -112,7 +111,7 @@ internal object Deserialize(RestResponse response, Type type) if (response.Headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() + ? global::System.IO.Path.GetTempPath() : _configuration.TempFolderPath; var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); foreach (var header in response.Headers) @@ -379,7 +378,7 @@ private RestRequest NewRequest( var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs index 73019d5d22c2..eec5122081ff 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -29,7 +29,6 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; -using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Client.Auth; using Org.OpenAPITools.Model; @@ -112,7 +111,7 @@ internal object Deserialize(RestResponse response, Type type) if (response.Headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() + ? global::System.IO.Path.GetTempPath() : _configuration.TempFolderPath; var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); foreach (var header in response.Headers) @@ -379,7 +378,7 @@ private RestRequest NewRequest( var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs index 73019d5d22c2..eec5122081ff 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -29,7 +29,6 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; -using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Client.Auth; using Org.OpenAPITools.Model; @@ -112,7 +111,7 @@ internal object Deserialize(RestResponse response, Type type) if (response.Headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() + ? global::System.IO.Path.GetTempPath() : _configuration.TempFolderPath; var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); foreach (var header in response.Headers) @@ -379,7 +378,7 @@ private RestRequest NewRequest( var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } diff --git a/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/ApiClient.cs index 744c6e8bad86..6533e6313cfa 100644 --- a/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net6/ParameterMappings/src/Org.OpenAPITools/Client/ApiClient.cs @@ -28,7 +28,6 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; -using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Model; @@ -110,7 +109,7 @@ internal object Deserialize(RestResponse response, Type type) if (response.Headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() + ? global::System.IO.Path.GetTempPath() : _configuration.TempFolderPath; var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); foreach (var header in response.Headers) @@ -377,7 +376,7 @@ private RestRequest NewRequest( var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs index a69e5c43630a..25a9fbd46c0c 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/ApiClient.cs @@ -28,7 +28,6 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; -using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Client.Auth; using Org.OpenAPITools.Model; @@ -111,7 +110,7 @@ internal object Deserialize(RestResponse response, Type type) if (response.Headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() + ? global::System.IO.Path.GetTempPath() : _configuration.TempFolderPath; var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); foreach (var header in response.Headers) @@ -378,7 +377,7 @@ private RestRequest NewRequest( var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs index a69e5c43630a..25a9fbd46c0c 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -28,7 +28,6 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; -using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Client.Auth; using Org.OpenAPITools.Model; @@ -111,7 +110,7 @@ internal object Deserialize(RestResponse response, Type type) if (response.Headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() + ? global::System.IO.Path.GetTempPath() : _configuration.TempFolderPath; var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); foreach (var header in response.Headers) @@ -378,7 +377,7 @@ private RestRequest NewRequest( var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } diff --git a/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiClient.cs index a5248752b165..21b944aa06e2 100644 --- a/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net7/UseDateTimeForDate/src/Org.OpenAPITools/Client/ApiClient.cs @@ -28,7 +28,6 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; -using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Model; @@ -110,7 +109,7 @@ internal object Deserialize(RestResponse response, Type type) if (response.Headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() + ? global::System.IO.Path.GetTempPath() : _configuration.TempFolderPath; var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); foreach (var header in response.Headers) @@ -377,7 +376,7 @@ private RestRequest NewRequest( var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs index 73019d5d22c2..eec5122081ff 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/ApiClient.cs @@ -29,7 +29,6 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; -using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Client.Auth; using Org.OpenAPITools.Model; @@ -112,7 +111,7 @@ internal object Deserialize(RestResponse response, Type type) if (response.Headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() + ? global::System.IO.Path.GetTempPath() : _configuration.TempFolderPath; var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); foreach (var header in response.Headers) @@ -379,7 +378,7 @@ private RestRequest NewRequest( var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs index 73019d5d22c2..eec5122081ff 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/ApiClient.cs @@ -29,7 +29,6 @@ using RestSharp.Serializers; using RestSharpMethod = RestSharp.Method; using FileIO = System.IO.File; -using Path = global::System.IO.Path; using Polly; using Org.OpenAPITools.Client.Auth; using Org.OpenAPITools.Model; @@ -112,7 +111,7 @@ internal object Deserialize(RestResponse response, Type type) if (response.Headers != null) { var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath) - ? Path.GetTempPath() + ? global::System.IO.Path.GetTempPath() : _configuration.TempFolderPath; var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$"); foreach (var header in response.Headers) @@ -379,7 +378,7 @@ private RestRequest NewRequest( var bytes = ClientUtils.ReadAsBytes(file); var fileStream = file as FileStream; if (fileStream != null) - request.AddFile(fileParam.Key, bytes, Path.GetFileName(fileStream.Name)); + request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name)); else request.AddFile(fileParam.Key, bytes, "no_file_name_provided"); }