Skip to content

Commit

Permalink
fix: Fixed response deserialization when response type is just string.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Aug 31, 2024
1 parent a551442 commit ae70f6e
Show file tree
Hide file tree
Showing 143 changed files with 143 additions and 427 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public static string GenerateMethod(
}" : @"
response.EnsureSuccessStatusCode();")}
{(endPoint.ContentType == ContentType.String ? $@"
{(endPoint.ContentType == ContentType.String && endPoint.ResponseType.CSharpTypeWithoutNullability is not "string" ? $@"
return
{jsonSerializer.GenerateDeserializeCall(endPoint.ResponseType, endPoint.Settings.JsonSerializerContext)} ??
throw new global::System.InvalidOperationException($""Response deserialization failed for \""{{__content}}\"" "");" : @"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ partial void ProcessV1LibraryManagement4ResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ partial void ProcessV1LibraryManagement4ResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::System.Text.Json.JsonSerializer.Deserialize<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ partial void ProcessAccountGetExportStorageMetricsJobIdResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ partial void ProcessAccountSendPaymentReceiptResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ partial void ProcessAccountStartExportAccountChargesJobResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ partial void ProcessAccountStartExportAccountPaymentsJobResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ partial void ProcessAccountStartExportAccountProjectSummaryJobResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ partial void ProcessAccountStartGetAccountProjectInfoJobResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ partial void ProcessDescriptorForceDeleteDescriptorSetPolledResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ partial void ProcessDescriptorStartExportDescriptorsJobResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ partial void ProcessExcerptStartDeleteExcerptsJobResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ partial void ProcessExcerptStartSearchExcerptsJobResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ partial void ProcessExportGetExcerptsExportURLResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ partial void ProcessExportGetExportJobURIResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,7 @@ partial void ProcessExportStartExcerptsExportResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ partial void ProcessFileGetExportJobFileURIResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ partial void ProcessFileGetMoveFileFromTempToPermJobResultResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ partial void ProcessFileStoreProjectFileStringResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ partial void ProcessGetStringFromFileStorageResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ partial void ProcessUploadToFileStorageResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ partial void ProcessCreateLoginResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ partial void ProcessUnsafeLoginResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ partial void ProcessMemoStartExportMemosResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ partial void ProcessMemoStartExportMemosXMLResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ partial void ProcessMemoStartImportMemosXMLResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ partial void ProcessMemoStartSearchMemosJobResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ partial void ProcessProjectGetExportAccountProjectsJobIdResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ partial void ProcessProjectStartCopyProjectJobResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ partial void ProcessProjectStartDeleteProjectResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ partial void ProcessProjectStartProjectExportJobResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ partial void ProcessProjectStartProjectImportJobResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ partial void ProcessResourceAddAudioResourceResponseContent(
throw new global::System.InvalidOperationException(__content, ex);
}

return
global::Newtonsoft.Json.JsonConvert.DeserializeObject<string?>(__content, _jsonSerializerOptions) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
return __content;
}
}
}
Loading

0 comments on commit ae70f6e

Please sign in to comment.