forked from loafle/openapi-generator-original
remove deprecated restsharp parameter class (#8933)
This commit is contained in:
parent
952483abde
commit
f56dd9f59b
@ -95,8 +95,6 @@ namespace {{packageName}}.Client
|
|||||||
/// <returns>Object representation of the JSON string.</returns>
|
/// <returns>Object representation of the JSON string.</returns>
|
||||||
internal object Deserialize(IRestResponse response, Type type)
|
internal object Deserialize(IRestResponse response, Type type)
|
||||||
{
|
{
|
||||||
IList<Parameter> headers = response.Headers;
|
|
||||||
|
|
||||||
if (type == typeof(byte[])) // return byte array
|
if (type == typeof(byte[])) // return byte array
|
||||||
{
|
{
|
||||||
return response.RawBytes;
|
return response.RawBytes;
|
||||||
@ -106,13 +104,13 @@ namespace {{packageName}}.Client
|
|||||||
if (type == typeof(Stream))
|
if (type == typeof(Stream))
|
||||||
{
|
{
|
||||||
var bytes = response.RawBytes;
|
var bytes = response.RawBytes;
|
||||||
if (headers != null)
|
if (response.Headers != null)
|
||||||
{
|
{
|
||||||
var filePath = String.IsNullOrEmpty(_configuration.TempFolderPath)
|
var filePath = String.IsNullOrEmpty(_configuration.TempFolderPath)
|
||||||
? Path.GetTempPath()
|
? Path.GetTempPath()
|
||||||
: _configuration.TempFolderPath;
|
: _configuration.TempFolderPath;
|
||||||
var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$");
|
var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$");
|
||||||
foreach (var header in headers)
|
foreach (var header in response.Headers)
|
||||||
{
|
{
|
||||||
var match = regex.Match(header.ToString());
|
var match = regex.Match(header.ToString());
|
||||||
if (match.Success)
|
if (match.Success)
|
||||||
|
@ -96,8 +96,6 @@ namespace Org.OpenAPITools.Client
|
|||||||
/// <returns>Object representation of the JSON string.</returns>
|
/// <returns>Object representation of the JSON string.</returns>
|
||||||
internal object Deserialize(IRestResponse response, Type type)
|
internal object Deserialize(IRestResponse response, Type type)
|
||||||
{
|
{
|
||||||
IList<Parameter> headers = response.Headers;
|
|
||||||
|
|
||||||
if (type == typeof(byte[])) // return byte array
|
if (type == typeof(byte[])) // return byte array
|
||||||
{
|
{
|
||||||
return response.RawBytes;
|
return response.RawBytes;
|
||||||
@ -107,13 +105,13 @@ namespace Org.OpenAPITools.Client
|
|||||||
if (type == typeof(Stream))
|
if (type == typeof(Stream))
|
||||||
{
|
{
|
||||||
var bytes = response.RawBytes;
|
var bytes = response.RawBytes;
|
||||||
if (headers != null)
|
if (response.Headers != null)
|
||||||
{
|
{
|
||||||
var filePath = String.IsNullOrEmpty(_configuration.TempFolderPath)
|
var filePath = String.IsNullOrEmpty(_configuration.TempFolderPath)
|
||||||
? Path.GetTempPath()
|
? Path.GetTempPath()
|
||||||
: _configuration.TempFolderPath;
|
: _configuration.TempFolderPath;
|
||||||
var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$");
|
var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$");
|
||||||
foreach (var header in headers)
|
foreach (var header in response.Headers)
|
||||||
{
|
{
|
||||||
var match = regex.Match(header.ToString());
|
var match = regex.Match(header.ToString());
|
||||||
if (match.Success)
|
if (match.Success)
|
||||||
|
@ -96,8 +96,6 @@ namespace Org.OpenAPITools.Client
|
|||||||
/// <returns>Object representation of the JSON string.</returns>
|
/// <returns>Object representation of the JSON string.</returns>
|
||||||
internal object Deserialize(IRestResponse response, Type type)
|
internal object Deserialize(IRestResponse response, Type type)
|
||||||
{
|
{
|
||||||
IList<Parameter> headers = response.Headers;
|
|
||||||
|
|
||||||
if (type == typeof(byte[])) // return byte array
|
if (type == typeof(byte[])) // return byte array
|
||||||
{
|
{
|
||||||
return response.RawBytes;
|
return response.RawBytes;
|
||||||
@ -107,13 +105,13 @@ namespace Org.OpenAPITools.Client
|
|||||||
if (type == typeof(Stream))
|
if (type == typeof(Stream))
|
||||||
{
|
{
|
||||||
var bytes = response.RawBytes;
|
var bytes = response.RawBytes;
|
||||||
if (headers != null)
|
if (response.Headers != null)
|
||||||
{
|
{
|
||||||
var filePath = String.IsNullOrEmpty(_configuration.TempFolderPath)
|
var filePath = String.IsNullOrEmpty(_configuration.TempFolderPath)
|
||||||
? Path.GetTempPath()
|
? Path.GetTempPath()
|
||||||
: _configuration.TempFolderPath;
|
: _configuration.TempFolderPath;
|
||||||
var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$");
|
var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$");
|
||||||
foreach (var header in headers)
|
foreach (var header in response.Headers)
|
||||||
{
|
{
|
||||||
var match = regex.Match(header.ToString());
|
var match = regex.Match(header.ToString());
|
||||||
if (match.Success)
|
if (match.Success)
|
||||||
|
@ -95,8 +95,6 @@ namespace Org.OpenAPITools.Client
|
|||||||
/// <returns>Object representation of the JSON string.</returns>
|
/// <returns>Object representation of the JSON string.</returns>
|
||||||
internal object Deserialize(IRestResponse response, Type type)
|
internal object Deserialize(IRestResponse response, Type type)
|
||||||
{
|
{
|
||||||
IList<Parameter> headers = response.Headers;
|
|
||||||
|
|
||||||
if (type == typeof(byte[])) // return byte array
|
if (type == typeof(byte[])) // return byte array
|
||||||
{
|
{
|
||||||
return response.RawBytes;
|
return response.RawBytes;
|
||||||
@ -106,13 +104,13 @@ namespace Org.OpenAPITools.Client
|
|||||||
if (type == typeof(Stream))
|
if (type == typeof(Stream))
|
||||||
{
|
{
|
||||||
var bytes = response.RawBytes;
|
var bytes = response.RawBytes;
|
||||||
if (headers != null)
|
if (response.Headers != null)
|
||||||
{
|
{
|
||||||
var filePath = String.IsNullOrEmpty(_configuration.TempFolderPath)
|
var filePath = String.IsNullOrEmpty(_configuration.TempFolderPath)
|
||||||
? Path.GetTempPath()
|
? Path.GetTempPath()
|
||||||
: _configuration.TempFolderPath;
|
: _configuration.TempFolderPath;
|
||||||
var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$");
|
var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$");
|
||||||
foreach (var header in headers)
|
foreach (var header in response.Headers)
|
||||||
{
|
{
|
||||||
var match = regex.Match(header.ToString());
|
var match = regex.Match(header.ToString());
|
||||||
if (match.Success)
|
if (match.Success)
|
||||||
|
@ -96,8 +96,6 @@ namespace Org.OpenAPITools.Client
|
|||||||
/// <returns>Object representation of the JSON string.</returns>
|
/// <returns>Object representation of the JSON string.</returns>
|
||||||
internal object Deserialize(IRestResponse response, Type type)
|
internal object Deserialize(IRestResponse response, Type type)
|
||||||
{
|
{
|
||||||
IList<Parameter> headers = response.Headers;
|
|
||||||
|
|
||||||
if (type == typeof(byte[])) // return byte array
|
if (type == typeof(byte[])) // return byte array
|
||||||
{
|
{
|
||||||
return response.RawBytes;
|
return response.RawBytes;
|
||||||
@ -107,13 +105,13 @@ namespace Org.OpenAPITools.Client
|
|||||||
if (type == typeof(Stream))
|
if (type == typeof(Stream))
|
||||||
{
|
{
|
||||||
var bytes = response.RawBytes;
|
var bytes = response.RawBytes;
|
||||||
if (headers != null)
|
if (response.Headers != null)
|
||||||
{
|
{
|
||||||
var filePath = String.IsNullOrEmpty(_configuration.TempFolderPath)
|
var filePath = String.IsNullOrEmpty(_configuration.TempFolderPath)
|
||||||
? Path.GetTempPath()
|
? Path.GetTempPath()
|
||||||
: _configuration.TempFolderPath;
|
: _configuration.TempFolderPath;
|
||||||
var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$");
|
var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$");
|
||||||
foreach (var header in headers)
|
foreach (var header in response.Headers)
|
||||||
{
|
{
|
||||||
var match = regex.Match(header.ToString());
|
var match = regex.Match(header.ToString());
|
||||||
if (match.Success)
|
if (match.Success)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user