forked from loafle/openapi-generator-original
moved deserialization to template (#15474)
This commit is contained in:
@@ -112,9 +112,7 @@ namespace {{packageName}}.{{clientPackage}}
|
||||
/// </summary>
|
||||
public T{{nrt?}} ToModel(System.Text.Json.JsonSerializerOptions{{nrt?}} options = null)
|
||||
{
|
||||
return IsSuccessStatusCode
|
||||
? System.Text.Json.JsonSerializer.Deserialize<T>(RawContent, options ?? _jsonSerializerOptions)
|
||||
: default(T);
|
||||
{{>ToModel}}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// This logic may be modified with the ToModel.mustache template
|
||||
return IsSuccessStatusCode
|
||||
? System.Text.Json.JsonSerializer.Deserialize<T>(RawContent, options ?? _jsonSerializerOptions)
|
||||
: default(T);
|
||||
@@ -118,6 +118,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// </summary>
|
||||
public T? ToModel(System.Text.Json.JsonSerializerOptions? options = null)
|
||||
{
|
||||
// This logic may be modified with the ToModel.mustache template
|
||||
return IsSuccessStatusCode
|
||||
? System.Text.Json.JsonSerializer.Deserialize<T>(RawContent, options ?? _jsonSerializerOptions)
|
||||
: default(T);
|
||||
|
||||
@@ -116,6 +116,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// </summary>
|
||||
public T ToModel(System.Text.Json.JsonSerializerOptions options = null)
|
||||
{
|
||||
// This logic may be modified with the ToModel.mustache template
|
||||
return IsSuccessStatusCode
|
||||
? System.Text.Json.JsonSerializer.Deserialize<T>(RawContent, options ?? _jsonSerializerOptions)
|
||||
: default(T);
|
||||
|
||||
@@ -118,6 +118,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// </summary>
|
||||
public T? ToModel(System.Text.Json.JsonSerializerOptions? options = null)
|
||||
{
|
||||
// This logic may be modified with the ToModel.mustache template
|
||||
return IsSuccessStatusCode
|
||||
? System.Text.Json.JsonSerializer.Deserialize<T>(RawContent, options ?? _jsonSerializerOptions)
|
||||
: default(T);
|
||||
|
||||
@@ -118,6 +118,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// </summary>
|
||||
public T? ToModel(System.Text.Json.JsonSerializerOptions? options = null)
|
||||
{
|
||||
// This logic may be modified with the ToModel.mustache template
|
||||
return IsSuccessStatusCode
|
||||
? System.Text.Json.JsonSerializer.Deserialize<T>(RawContent, options ?? _jsonSerializerOptions)
|
||||
: default(T);
|
||||
|
||||
@@ -118,6 +118,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// </summary>
|
||||
public T? ToModel(System.Text.Json.JsonSerializerOptions? options = null)
|
||||
{
|
||||
// This logic may be modified with the ToModel.mustache template
|
||||
return IsSuccessStatusCode
|
||||
? System.Text.Json.JsonSerializer.Deserialize<T>(RawContent, options ?? _jsonSerializerOptions)
|
||||
: default(T);
|
||||
|
||||
@@ -116,6 +116,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// </summary>
|
||||
public T ToModel(System.Text.Json.JsonSerializerOptions options = null)
|
||||
{
|
||||
// This logic may be modified with the ToModel.mustache template
|
||||
return IsSuccessStatusCode
|
||||
? System.Text.Json.JsonSerializer.Deserialize<T>(RawContent, options ?? _jsonSerializerOptions)
|
||||
: default(T);
|
||||
|
||||
Reference in New Issue
Block a user