diff --git a/src/libs/OpenApiGenerator.Core/Generation/Data.cs b/src/libs/OpenApiGenerator.Core/Generation/Data.cs index 0a7c6ba264..4a28169d01 100644 --- a/src/libs/OpenApiGenerator.Core/Generation/Data.cs +++ b/src/libs/OpenApiGenerator.Core/Generation/Data.cs @@ -127,7 +127,7 @@ public static (EquatableArray Models, EquatableArray Method !settings.ExcludeTags.Contains(x.Name)) .ToArray(); EndPoint[] constructors = settings.GenerateSdk || settings.GenerateConstructors ? [new EndPoint( - Id: "Constructors", + Id: "MainConstructor", Namespace: settings.Namespace, ClassName: settings.ClassName.Replace(".", string.Empty), BaseUrl: openApiDocument.Servers.FirstOrDefault()?.Url ?? string.Empty, @@ -155,7 +155,8 @@ .. includedTags.Select(x => PropertyData.Default with RequestType: TypeData.Default, ResponseType: TypeData.Default, AdditionalModels: [], - AdditionalTypes: [])] : []; + AdditionalTypes: [], + Converters: [])] : []; if (settings.GroupByTags && (settings.GenerateSdk || settings.GenerateConstructors)) { constructors = constructors.Concat( @@ -177,7 +178,8 @@ .. includedTags.Select(x => PropertyData.Default with RequestType: TypeData.Default, ResponseType: TypeData.Default, AdditionalModels: [], - AdditionalTypes: []))) + AdditionalTypes: [], + Converters: []))) .ToArray(); } @@ -250,6 +252,22 @@ .. includedTags.Select(x => PropertyData.Default with .GroupBy(x => x.FileNameWithoutExtension) .Select(x => x.First()) .ToImmutableArray() : []; + + for (var i = 0; i < methods.Length; i++) + { + if (methods[i].Id != "MainConstructor") + { + continue; + } + + methods[i] = methods[i] with + { + Converters = models + .Where(x => x.Style == ModelStyle.Enumeration && x.JsonSerializerType != JsonSerializerType.NewtonsoftJson) + .Select(x => $"global::OpenApiGenerator.JsonConverters.{x.ClassName}JsonConverter") + .ToImmutableArray(), + }; + } return (Models: models, Methods: settings.GenerateSdk || settings.GenerateMethods diff --git a/src/libs/OpenApiGenerator.Core/Generation/Sources.Clients.cs b/src/libs/OpenApiGenerator.Core/Generation/Sources.Clients.cs index efa5c75630..2749043f96 100644 --- a/src/libs/OpenApiGenerator.Core/Generation/Sources.Clients.cs +++ b/src/libs/OpenApiGenerator.Core/Generation/Sources.Clients.cs @@ -1,4 +1,5 @@ using OpenApiGenerator.Core.Extensions; +using OpenApiGenerator.Core.Json; using OpenApiGenerator.Core.Models; namespace OpenApiGenerator.Core.Generation; @@ -8,6 +9,9 @@ public static partial class Sources public static string GenerateConstructors( EndPoint endPoint) { + var serializer = endPoint.JsonSerializerType.GetSerializer(); + var hasOptions = string.IsNullOrWhiteSpace(endPoint.JsonSerializerContext); + return $@" #nullable enable @@ -17,9 +21,12 @@ namespace {endPoint.Namespace} public sealed partial class {endPoint.ClassName} : global::System.IDisposable {{ private readonly global::System.Net.Http.HttpClient _httpClient; +{(hasOptions ? $@" + private readonly {serializer.GetOptionsType()} _jsonSerializerOptions;" : " ")} + {(endPoint.Properties.Length != 0 ? "\n" + endPoint.Properties.Select(x => $@" {x.Summary.ToXmlDocumentationSummary(level: 8)} - public {x.Type.CSharpType} {x.Name} => new {x.Type.CSharpType}(_httpClient); + public {x.Type.CSharpType} {x.Name} => new {x.Type.CSharpType}(_httpClient{(hasOptions ? ", jsonSerializerOptions: _jsonSerializerOptions" : "")}); ").Inject() : " ")} /// @@ -31,10 +38,14 @@ public sealed partial class {endPoint.ClassName} : global::System.IDisposable /// public {endPoint.ClassName}( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null{(hasOptions ? $@", + {serializer.GetOptionsType()}? jsonSerializerOptions = null" : " ")} + ) {{ _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(""{endPoint.BaseUrl}""); +{(hasOptions ? $@" + _jsonSerializerOptions = _jsonSerializerOptions ?? {(endPoint.Id == "MainConstructor" ? serializer.CreateDefaultSettings(endPoint.Converters) : $"new {serializer.GetOptionsType()}()")};" : " ")} }} /// diff --git a/src/libs/OpenApiGenerator.Core/Json/IJsonSerializer.cs b/src/libs/OpenApiGenerator.Core/Json/IJsonSerializer.cs index 5b8c9e2422..50657de397 100644 --- a/src/libs/OpenApiGenerator.Core/Json/IJsonSerializer.cs +++ b/src/libs/OpenApiGenerator.Core/Json/IJsonSerializer.cs @@ -8,4 +8,6 @@ public interface IJsonSerializer string GenerateDeserializeCall(string type, string jsonSerializerContext); string GenerateSerializeCall(string type, string jsonSerializerContext); string GenerateConverterAttribute(string type); + string GetOptionsType(); + string CreateDefaultSettings(IReadOnlyList converters); } \ No newline at end of file diff --git a/src/libs/OpenApiGenerator.Core/Json/NewtonsoftJsonSerializer.cs b/src/libs/OpenApiGenerator.Core/Json/NewtonsoftJsonSerializer.cs index da7ee2909b..96952ea03e 100644 --- a/src/libs/OpenApiGenerator.Core/Json/NewtonsoftJsonSerializer.cs +++ b/src/libs/OpenApiGenerator.Core/Json/NewtonsoftJsonSerializer.cs @@ -1,3 +1,5 @@ +using OpenApiGenerator.Core.Extensions; + namespace OpenApiGenerator.Core.Json; public class NewtonsoftJsonSerializer : IJsonSerializer @@ -19,6 +21,16 @@ public string GenerateRequiredAttribute() { return string.Empty; } + + public string GetOptionsType() + { + return "global::Newtonsoft.Json.JsonSerializerSettings"; + } + + public string CreateDefaultSettings(IReadOnlyList converters) + { + return "new global::Newtonsoft.Json.JsonSerializerSettings()"; + } public string GenerateConverterAttribute(string type) { @@ -27,11 +39,11 @@ public string GenerateConverterAttribute(string type) public string GenerateSerializeCall(string type, string jsonSerializerContext) { - return "global::Newtonsoft.Json.JsonConvert.SerializeObject(request)"; + return "global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions)"; } public string GenerateDeserializeCall(string type, string jsonSerializerContext) { - return $"global::Newtonsoft.Json.JsonConvert.DeserializeObject<{type}>(__content)"; + return $"global::Newtonsoft.Json.JsonConvert.DeserializeObject<{type}>(__content, _jsonSerializerOptions)"; } } \ No newline at end of file diff --git a/src/libs/OpenApiGenerator.Core/Json/SystemTextJsonSerializer.cs b/src/libs/OpenApiGenerator.Core/Json/SystemTextJsonSerializer.cs index 1b8d95fcef..b2b1471ffb 100644 --- a/src/libs/OpenApiGenerator.Core/Json/SystemTextJsonSerializer.cs +++ b/src/libs/OpenApiGenerator.Core/Json/SystemTextJsonSerializer.cs @@ -1,3 +1,5 @@ +using OpenApiGenerator.Core.Extensions; + namespace OpenApiGenerator.Core.Json; public class SystemTextJsonSerializer : IJsonSerializer @@ -18,6 +20,26 @@ public string GenerateRequiredAttribute() { return "[global::System.Text.Json.Serialization.JsonRequired]"; } + + public string GetOptionsType() + { + return "global::System.Text.Json.JsonSerializerOptions"; + } + + public string CreateDefaultSettings(IReadOnlyList converters) + { + return @$"new global::System.Text.Json.JsonSerializerOptions + {{ + PropertyNameCaseInsensitive = true, + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = + {{ +{converters.Select(x => $@" + new {x}(), +").Inject()} + }} + }}"; + } public string GenerateConverterAttribute(string type) { @@ -68,7 +90,7 @@ public string GenerateSerializeCall(string type, string jsonSerializerContext) type = type ?? throw new ArgumentNullException(nameof(type)); return string.IsNullOrWhiteSpace(jsonSerializerContext) - ? "global::System.Text.Json.JsonSerializer.Serialize(request)" + ? "global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions)" : $"global::System.Text.Json.JsonSerializer.Serialize(request, global::{jsonSerializerContext}.Default.{GetContextType(type)})"; } @@ -77,7 +99,7 @@ public string GenerateDeserializeCall(string type, string jsonSerializerContext) type = type ?? throw new ArgumentNullException(nameof(type)); return string.IsNullOrWhiteSpace(jsonSerializerContext) - ? $"global::System.Text.Json.JsonSerializer.Deserialize<{type}>(__content)" + ? $"global::System.Text.Json.JsonSerializer.Deserialize<{type}>(__content, _jsonSerializerOptions)" : $"global::System.Text.Json.JsonSerializer.Deserialize(__content, global::{jsonSerializerContext}.Default.{GetContextType(type)})"; } } \ No newline at end of file diff --git a/src/libs/OpenApiGenerator.Core/Models/EndPoint.cs b/src/libs/OpenApiGenerator.Core/Models/EndPoint.cs index e1281faf54..6cfa70929e 100644 --- a/src/libs/OpenApiGenerator.Core/Models/EndPoint.cs +++ b/src/libs/OpenApiGenerator.Core/Models/EndPoint.cs @@ -22,7 +22,8 @@ public readonly record struct EndPoint( TypeData RequestType, TypeData ResponseType, ImmutableArray AdditionalModels, - ImmutableArray AdditionalTypes + ImmutableArray AdditionalTypes, + ImmutableArray Converters ) { public string MethodName => $"{NotAsyncMethodName}Async"; @@ -202,7 +203,8 @@ public static EndPoint FromSchema( AdditionalTypes: [ ..requestBodyTypes, ..responseTypes, - ]); + ], + Converters: []); return endPoint; } @@ -228,7 +230,8 @@ public static EndPoint FromAuthorization( RequestType: TypeData.Default, ResponseType: TypeData.Default, AdditionalModels: [], - AdditionalTypes: []); + AdditionalTypes: [], + Converters: []); return endPoint; } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.Api.g.verified.cs index d03523614d..6fde64d310 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.Api.g.verified.cs @@ -12,11 +12,13 @@ namespace G public sealed partial class Api : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Move projects to or from GitHub. /// - public MigrationsClient Migrations => new MigrationsClient(_httpClient); + public MigrationsClient Migrations => new MigrationsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Creates a new instance of the Api. @@ -27,10 +29,13 @@ public sealed partial class Api : global::System.IDisposable /// public Api( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.github.com"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsCancelImport.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsCancelImport.g.verified.cs index 837b846727..b01b18a78e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsCancelImport.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsCancelImport.g.verified.cs @@ -31,7 +31,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsDeleteArchiveForAuthenticatedUser.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsDeleteArchiveForAuthenticatedUser.g.verified.cs index 15fb2bb8ba..780f7da831 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsDeleteArchiveForAuthenticatedUser.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsDeleteArchiveForAuthenticatedUser.g.verified.cs @@ -29,7 +29,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsDeleteArchiveForOrg.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsDeleteArchiveForOrg.g.verified.cs index 8fef638210..b8cd522de7 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsDeleteArchiveForOrg.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsDeleteArchiveForOrg.g.verified.cs @@ -31,7 +31,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsDownloadArchiveForOrg.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsDownloadArchiveForOrg.g.verified.cs index a04921fcce..cb6da7ce48 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsDownloadArchiveForOrg.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsDownloadArchiveForOrg.g.verified.cs @@ -31,7 +31,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetArchiveForAuthenticatedUser.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetArchiveForAuthenticatedUser.g.verified.cs index b8507dc6a2..af5d1fb352 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetArchiveForAuthenticatedUser.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetArchiveForAuthenticatedUser.g.verified.cs @@ -29,7 +29,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetCommitAuthors.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetCommitAuthors.g.verified.cs index 88c9dabb23..6b2da95cd5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetCommitAuthors.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetCommitAuthors.g.verified.cs @@ -33,7 +33,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetImportStatus.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetImportStatus.g.verified.cs index a6b0b09dcc..b3f5371b38 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetImportStatus.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetImportStatus.g.verified.cs @@ -31,7 +31,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetLargeFiles.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetLargeFiles.g.verified.cs index 81e0aba1aa..741053c948 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetLargeFiles.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetLargeFiles.g.verified.cs @@ -31,7 +31,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetStatusForAuthenticatedUser.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetStatusForAuthenticatedUser.g.verified.cs index 3b88516d23..9a6d7e6844 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetStatusForAuthenticatedUser.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetStatusForAuthenticatedUser.g.verified.cs @@ -32,7 +32,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetStatusForOrg.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetStatusForOrg.g.verified.cs index 425f8f4fb4..f276b0706c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetStatusForOrg.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsGetStatusForOrg.g.verified.cs @@ -34,7 +34,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsListForAuthenticatedUser.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsListForAuthenticatedUser.g.verified.cs index 3a8d9da61e..9d0ebbeef7 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsListForAuthenticatedUser.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsListForAuthenticatedUser.g.verified.cs @@ -31,7 +31,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsListForOrg.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsListForOrg.g.verified.cs index 7274cab582..e721737f4b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsListForOrg.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsListForOrg.g.verified.cs @@ -36,7 +36,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsListReposForAuthenticatedUser.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsListReposForAuthenticatedUser.g.verified.cs index a096c7c790..a893773dc0 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsListReposForAuthenticatedUser.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsListReposForAuthenticatedUser.g.verified.cs @@ -33,7 +33,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsListReposForOrg.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsListReposForOrg.g.verified.cs index b94f87901c..971813fd11 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsListReposForOrg.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsListReposForOrg.g.verified.cs @@ -35,7 +35,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsMapCommitAuthor.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsMapCommitAuthor.g.verified.cs index b92e2daee2..ac50ca78cf 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsMapCommitAuthor.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsMapCommitAuthor.g.verified.cs @@ -28,7 +28,7 @@ public partial class MigrationsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/repos/{owner}/{repo}/import/authors/{authorId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -41,7 +41,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsSetLfsPreference.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsSetLfsPreference.g.verified.cs index 86acf78e58..068cecbaab 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsSetLfsPreference.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsSetLfsPreference.g.verified.cs @@ -26,7 +26,7 @@ public partial class MigrationsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/repos/{owner}/{repo}/import/lfs", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsStartForAuthenticatedUser.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsStartForAuthenticatedUser.g.verified.cs index 63952043e7..7fc92a530a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsStartForAuthenticatedUser.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsStartForAuthenticatedUser.g.verified.cs @@ -22,7 +22,7 @@ public partial class MigrationsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/user/migrations", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsStartForOrg.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsStartForOrg.g.verified.cs index d5dbc62673..a64afbebc4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsStartForOrg.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsStartForOrg.g.verified.cs @@ -24,7 +24,7 @@ public partial class MigrationsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/orgs/{org}/migrations", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsStartImport.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsStartImport.g.verified.cs index 0a4123e62f..d55309b3d4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsStartImport.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsStartImport.g.verified.cs @@ -26,7 +26,7 @@ public partial class MigrationsClient method: global::System.Net.Http.HttpMethod.Put, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/repos/{owner}/{repo}/import", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsUnlockRepoForAuthenticatedUser.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsUnlockRepoForAuthenticatedUser.g.verified.cs index 75c72cb004..4dc1b075c5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsUnlockRepoForAuthenticatedUser.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsUnlockRepoForAuthenticatedUser.g.verified.cs @@ -31,7 +31,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsUnlockRepoForOrg.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsUnlockRepoForOrg.g.verified.cs index a7d6826464..97fdbfdb88 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsUnlockRepoForOrg.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsUnlockRepoForOrg.g.verified.cs @@ -33,7 +33,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsUpdateImport.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsUpdateImport.g.verified.cs index 492fc795c1..a621a853de 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsUpdateImport.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.MigrationsUpdateImport.g.verified.cs @@ -26,7 +26,7 @@ public partial class MigrationsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/repos/{owner}/{repo}/import", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.g.verified.cs index 57690deed5..a44b564115 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/NewtonsoftJson/_#G.MigrationsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class MigrationsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the MigrationsClient. @@ -22,10 +24,13 @@ public sealed partial class MigrationsClient : global::System.IDisposable /// public MigrationsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.github.com"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.Api.g.verified.cs index d03523614d..0ce44ab827 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.Api.g.verified.cs @@ -12,11 +12,13 @@ namespace G public sealed partial class Api : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Move projects to or from GitHub. /// - public MigrationsClient Migrations => new MigrationsClient(_httpClient); + public MigrationsClient Migrations => new MigrationsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Creates a new instance of the Api. @@ -27,10 +29,40 @@ public sealed partial class Api : global::System.IDisposable /// public Api( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.github.com"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = + { + new global::OpenApiGenerator.JsonConverters.RepositorySquashMergeCommitTitleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RepositorySquashMergeCommitMessageJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RepositoryMergeCommitTitleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RepositoryMergeCommitMessageJsonConverter(), + new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisAdvancedSecurityStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisDependabotSecurityUpdatesStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisSecretScanningStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisSecretScanningPushProtectionStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ImportStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PagesHttpsCertificateStateJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PageStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PageProtectedDomainStateJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PageBuildTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MigrationsListForOrgExcludeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MigrationsStartForOrgRequestExcludeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MigrationsGetStatusForOrgExcludeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MigrationsStartImportRequestVcsJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MigrationsUpdateImportRequestVcsJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MigrationsSetLfsPreferenceRequestUseLfsJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MigrationsStartForAuthenticatedUserRequestExcludeJsonConverter(), + } + }; } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsCancelImport.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsCancelImport.g.verified.cs index 8dacdbec15..a737f608db 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsCancelImport.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsCancelImport.g.verified.cs @@ -31,7 +31,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsDeleteArchiveForAuthenticatedUser.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsDeleteArchiveForAuthenticatedUser.g.verified.cs index f3b7fc81e1..3d0adf9ab1 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsDeleteArchiveForAuthenticatedUser.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsDeleteArchiveForAuthenticatedUser.g.verified.cs @@ -29,7 +29,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsDeleteArchiveForOrg.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsDeleteArchiveForOrg.g.verified.cs index 0525459e2a..30f2e2511e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsDeleteArchiveForOrg.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsDeleteArchiveForOrg.g.verified.cs @@ -31,7 +31,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsDownloadArchiveForOrg.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsDownloadArchiveForOrg.g.verified.cs index d0cb3b9afb..d726598088 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsDownloadArchiveForOrg.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsDownloadArchiveForOrg.g.verified.cs @@ -31,7 +31,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetArchiveForAuthenticatedUser.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetArchiveForAuthenticatedUser.g.verified.cs index 903ef76428..870db12977 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetArchiveForAuthenticatedUser.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetArchiveForAuthenticatedUser.g.verified.cs @@ -29,7 +29,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetCommitAuthors.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetCommitAuthors.g.verified.cs index 2ef9ef7631..04875ef6c5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetCommitAuthors.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetCommitAuthors.g.verified.cs @@ -33,7 +33,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize?>(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetImportStatus.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetImportStatus.g.verified.cs index b8ff7cdfcb..e27d8d2c7a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetImportStatus.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetImportStatus.g.verified.cs @@ -31,7 +31,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetLargeFiles.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetLargeFiles.g.verified.cs index e36b1764c9..e630a593d3 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetLargeFiles.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetLargeFiles.g.verified.cs @@ -31,7 +31,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize?>(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetStatusForAuthenticatedUser.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetStatusForAuthenticatedUser.g.verified.cs index 257218eb97..48859f8562 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetStatusForAuthenticatedUser.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetStatusForAuthenticatedUser.g.verified.cs @@ -32,7 +32,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetStatusForOrg.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetStatusForOrg.g.verified.cs index 7679bcd8f9..4877161209 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetStatusForOrg.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsGetStatusForOrg.g.verified.cs @@ -34,7 +34,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsListForAuthenticatedUser.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsListForAuthenticatedUser.g.verified.cs index 64fcc8bb3d..eb75bb4df5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsListForAuthenticatedUser.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsListForAuthenticatedUser.g.verified.cs @@ -31,7 +31,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize?>(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsListForOrg.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsListForOrg.g.verified.cs index fb22ddf866..d30c2ea185 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsListForOrg.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsListForOrg.g.verified.cs @@ -36,7 +36,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize?>(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsListReposForAuthenticatedUser.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsListReposForAuthenticatedUser.g.verified.cs index ee5dd73c6d..04fb5adb46 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsListReposForAuthenticatedUser.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsListReposForAuthenticatedUser.g.verified.cs @@ -33,7 +33,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize?>(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsListReposForOrg.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsListReposForOrg.g.verified.cs index fe80fd1ff6..a800e1cd31 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsListReposForOrg.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsListReposForOrg.g.verified.cs @@ -35,7 +35,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize?>(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsMapCommitAuthor.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsMapCommitAuthor.g.verified.cs index 6b494c9184..17ba662122 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsMapCommitAuthor.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsMapCommitAuthor.g.verified.cs @@ -28,7 +28,7 @@ public partial class MigrationsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/repos/{owner}/{repo}/import/authors/{authorId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -41,7 +41,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsSetLfsPreference.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsSetLfsPreference.g.verified.cs index 270e65bfe1..797007d8a7 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsSetLfsPreference.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsSetLfsPreference.g.verified.cs @@ -26,7 +26,7 @@ public partial class MigrationsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/repos/{owner}/{repo}/import/lfs", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsStartForAuthenticatedUser.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsStartForAuthenticatedUser.g.verified.cs index 952b52e212..c606d51e7e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsStartForAuthenticatedUser.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsStartForAuthenticatedUser.g.verified.cs @@ -22,7 +22,7 @@ public partial class MigrationsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/user/migrations", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsStartForOrg.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsStartForOrg.g.verified.cs index aa17bad268..871d6e2359 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsStartForOrg.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsStartForOrg.g.verified.cs @@ -24,7 +24,7 @@ public partial class MigrationsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/orgs/{org}/migrations", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsStartImport.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsStartImport.g.verified.cs index 3e8d254a89..fa87bda9ce 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsStartImport.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsStartImport.g.verified.cs @@ -26,7 +26,7 @@ public partial class MigrationsClient method: global::System.Net.Http.HttpMethod.Put, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/repos/{owner}/{repo}/import", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsUnlockRepoForAuthenticatedUser.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsUnlockRepoForAuthenticatedUser.g.verified.cs index 36488b2b1a..c44fde3069 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsUnlockRepoForAuthenticatedUser.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsUnlockRepoForAuthenticatedUser.g.verified.cs @@ -31,7 +31,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsUnlockRepoForOrg.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsUnlockRepoForOrg.g.verified.cs index d105c1393b..641ab6c362 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsUnlockRepoForOrg.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsUnlockRepoForOrg.g.verified.cs @@ -33,7 +33,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsUpdateImport.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsUpdateImport.g.verified.cs index 371ecbdc18..ee7a351347 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsUpdateImport.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.MigrationsUpdateImport.g.verified.cs @@ -26,7 +26,7 @@ public partial class MigrationsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/repos/{owner}/{repo}/import", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class MigrationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.g.verified.cs index 57690deed5..0e75e32f95 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.MigrationsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class MigrationsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the MigrationsClient. @@ -22,10 +24,13 @@ public sealed partial class MigrationsClient : global::System.IDisposable /// public MigrationsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.github.com"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.AbuseClient.GetAbuse.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.AbuseClient.GetAbuse.g.verified.cs index 7ab49d7492..8839eac86c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.AbuseClient.GetAbuse.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.AbuseClient.GetAbuse.g.verified.cs @@ -29,7 +29,7 @@ public partial class AbuseClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.AbuseClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.AbuseClient.g.verified.cs index e6faac55cb..20f87d97c2 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.AbuseClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.AbuseClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class AbuseClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the AbuseClient. @@ -22,10 +24,13 @@ public sealed partial class AbuseClient : global::System.IDisposable /// public AbuseClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://ipinfo.io/"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.Api.g.verified.cs index fbc7cab0cd..7bbabe1567 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.Api.g.verified.cs @@ -12,41 +12,43 @@ namespace G public sealed partial class Api : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// General API. /// - public GeneralClient General => new GeneralClient(_httpClient); + public GeneralClient General => new GeneralClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Single info API. /// - public SingleClient Single => new SingleClient(_httpClient); + public SingleClient Single => new SingleClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Privacy Detection API. /// - public PrivacyDetectionClient PrivacyDetection => new PrivacyDetectionClient(_httpClient); + public PrivacyDetectionClient PrivacyDetection => new PrivacyDetectionClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// ASN API. /// - public AsnClient Asn => new AsnClient(_httpClient); + public AsnClient Asn => new AsnClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// IP Ranges API. /// - public RangesClient Ranges => new RangesClient(_httpClient); + public RangesClient Ranges => new RangesClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Hosted Domains API. /// - public DomainsClient Domains => new DomainsClient(_httpClient); + public DomainsClient Domains => new DomainsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Abuse Contact API. /// - public AbuseClient Abuse => new AbuseClient(_httpClient); + public AbuseClient Abuse => new AbuseClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Creates a new instance of the Api. @@ -57,10 +59,13 @@ public sealed partial class Api : global::System.IDisposable /// public Api( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://ipinfo.io/"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.AsnClient.GetAsn.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.AsnClient.GetAsn.g.verified.cs index 7db806a464..54451d64a4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.AsnClient.GetAsn.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.AsnClient.GetAsn.g.verified.cs @@ -29,7 +29,7 @@ public partial class AsnClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.AsnClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.AsnClient.g.verified.cs index edbe4bb15f..9c56717e1d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.AsnClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.AsnClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class AsnClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the AsnClient. @@ -22,10 +24,13 @@ public sealed partial class AsnClient : global::System.IDisposable /// public AsnClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://ipinfo.io/"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.DomainsClient.GetDomains.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.DomainsClient.GetDomains.g.verified.cs index 4a355c81ea..2bf8aa34f8 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.DomainsClient.GetDomains.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.DomainsClient.GetDomains.g.verified.cs @@ -33,7 +33,7 @@ public partial class DomainsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.DomainsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.DomainsClient.g.verified.cs index 9204c97f14..90dba25c89 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.DomainsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.DomainsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class DomainsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the DomainsClient. @@ -22,10 +24,13 @@ public sealed partial class DomainsClient : global::System.IDisposable /// public DomainsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://ipinfo.io/"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.GeneralClient.Batch.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.GeneralClient.Batch.g.verified.cs index b211a4e681..45ea57bd87 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.GeneralClient.Batch.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.GeneralClient.Batch.g.verified.cs @@ -22,7 +22,7 @@ public partial class GeneralClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/batch", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class GeneralClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.GeneralClient.GetCurrentInformation.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.GeneralClient.GetCurrentInformation.g.verified.cs index 0d30d2ac14..5291104d98 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.GeneralClient.GetCurrentInformation.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.GeneralClient.GetCurrentInformation.g.verified.cs @@ -27,7 +27,7 @@ public partial class GeneralClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.GeneralClient.GetInformationByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.GeneralClient.GetInformationByIp.g.verified.cs index 0480852699..2f02e7f69b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.GeneralClient.GetInformationByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.GeneralClient.GetInformationByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class GeneralClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.GeneralClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.GeneralClient.g.verified.cs index 91336b30c4..d47686e9ac 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.GeneralClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.GeneralClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class GeneralClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the GeneralClient. @@ -22,10 +24,13 @@ public sealed partial class GeneralClient : global::System.IDisposable /// public GeneralClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://ipinfo.io/"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.PrivacyDetectionClient.GetPrivacyInformationByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.PrivacyDetectionClient.GetPrivacyInformationByIp.g.verified.cs index f42f722e37..425c87ae80 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.PrivacyDetectionClient.GetPrivacyInformationByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.PrivacyDetectionClient.GetPrivacyInformationByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class PrivacyDetectionClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.PrivacyDetectionClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.PrivacyDetectionClient.g.verified.cs index e3b7383add..c21f97618d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.PrivacyDetectionClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.PrivacyDetectionClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class PrivacyDetectionClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the PrivacyDetectionClient. @@ -22,10 +24,13 @@ public sealed partial class PrivacyDetectionClient : global::System.IDisposable /// public PrivacyDetectionClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://ipinfo.io/"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.RangesClient.GetRanges.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.RangesClient.GetRanges.g.verified.cs index b4e17fd02b..a41518eaef 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.RangesClient.GetRanges.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.RangesClient.GetRanges.g.verified.cs @@ -29,7 +29,7 @@ public partial class RangesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.RangesClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.RangesClient.g.verified.cs index 8913c2155d..b1df5e4671 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.RangesClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.RangesClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class RangesClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the RangesClient. @@ -22,10 +24,13 @@ public sealed partial class RangesClient : global::System.IDisposable /// public RangesClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://ipinfo.io/"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCityByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCityByIp.g.verified.cs index 9a8da5ed5a..1c4bc78264 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCityByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCityByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCountryByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCountryByIp.g.verified.cs index 90cb2cd6bf..b15e177331 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCountryByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCountryByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentCity.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentCity.g.verified.cs index ea6998ef6d..71f70ab718 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentCity.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentCity.g.verified.cs @@ -27,7 +27,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentCountry.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentCountry.g.verified.cs index d1ebfbd755..534c0c3591 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentCountry.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentCountry.g.verified.cs @@ -27,7 +27,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentHostname.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentHostname.g.verified.cs index 89afa8c505..0141fcae5f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentHostname.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentHostname.g.verified.cs @@ -27,7 +27,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentIp.g.verified.cs index b3ce7977f1..9a261929d5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentIp.g.verified.cs @@ -27,7 +27,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentLocation.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentLocation.g.verified.cs index 189200ccfb..53f7f82d86 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentLocation.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentLocation.g.verified.cs @@ -27,7 +27,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentOrganization.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentOrganization.g.verified.cs index bb948a8d63..bc4aa399a4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentOrganization.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentOrganization.g.verified.cs @@ -27,7 +27,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentPostal.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentPostal.g.verified.cs index d7a5d64544..b8c2ff1007 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentPostal.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentPostal.g.verified.cs @@ -27,7 +27,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentRegion.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentRegion.g.verified.cs index 9a85fa32a8..0f4de3ff7d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentRegion.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentRegion.g.verified.cs @@ -27,7 +27,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentTimezone.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentTimezone.g.verified.cs index 0bd915f797..9531b3d1ad 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentTimezone.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetCurrentTimezone.g.verified.cs @@ -27,7 +27,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetHostnameByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetHostnameByIp.g.verified.cs index fc31c0667d..dffa6a52cd 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetHostnameByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetHostnameByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetIpByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetIpByIp.g.verified.cs index 76b8af47ad..b3f749b570 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetIpByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetIpByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetLocationByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetLocationByIp.g.verified.cs index 7ea8edcac3..daf092debd 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetLocationByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetLocationByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetOrganizationByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetOrganizationByIp.g.verified.cs index b4a576f418..fdced6def1 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetOrganizationByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetOrganizationByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetPostalByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetPostalByIp.g.verified.cs index 02ce031efb..0529441444 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetPostalByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetPostalByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetRegionByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetRegionByIp.g.verified.cs index 84f1ee8e1b..6b79f8bf31 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetRegionByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetRegionByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetTimezoneByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetTimezoneByIp.g.verified.cs index 453fe387ae..3a5fa13a96 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetTimezoneByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.GetTimezoneByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.g.verified.cs index 59e2dba424..58b17ee62a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/NewtonsoftJson/_#G.SingleClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class SingleClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the SingleClient. @@ -22,10 +24,13 @@ public sealed partial class SingleClient : global::System.IDisposable /// public SingleClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://ipinfo.io/"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.AbuseClient.GetAbuse.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.AbuseClient.GetAbuse.g.verified.cs index 4945769576..451294ed24 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.AbuseClient.GetAbuse.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.AbuseClient.GetAbuse.g.verified.cs @@ -29,7 +29,7 @@ public partial class AbuseClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.AbuseClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.AbuseClient.g.verified.cs index e6faac55cb..41507137d5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.AbuseClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.AbuseClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class AbuseClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the AbuseClient. @@ -22,10 +24,13 @@ public sealed partial class AbuseClient : global::System.IDisposable /// public AbuseClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://ipinfo.io/"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.Api.g.verified.cs index fbc7cab0cd..84822078dc 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.Api.g.verified.cs @@ -12,41 +12,43 @@ namespace G public sealed partial class Api : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// General API. /// - public GeneralClient General => new GeneralClient(_httpClient); + public GeneralClient General => new GeneralClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Single info API. /// - public SingleClient Single => new SingleClient(_httpClient); + public SingleClient Single => new SingleClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Privacy Detection API. /// - public PrivacyDetectionClient PrivacyDetection => new PrivacyDetectionClient(_httpClient); + public PrivacyDetectionClient PrivacyDetection => new PrivacyDetectionClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// ASN API. /// - public AsnClient Asn => new AsnClient(_httpClient); + public AsnClient Asn => new AsnClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// IP Ranges API. /// - public RangesClient Ranges => new RangesClient(_httpClient); + public RangesClient Ranges => new RangesClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Hosted Domains API. /// - public DomainsClient Domains => new DomainsClient(_httpClient); + public DomainsClient Domains => new DomainsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Abuse Contact API. /// - public AbuseClient Abuse => new AbuseClient(_httpClient); + public AbuseClient Abuse => new AbuseClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Creates a new instance of the Api. @@ -57,10 +59,22 @@ public sealed partial class Api : global::System.IDisposable /// public Api( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://ipinfo.io/"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = + { + new global::OpenApiGenerator.JsonConverters.AsnResponseTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CompanyTypeJsonConverter(), + } + }; } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.AsnClient.GetAsn.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.AsnClient.GetAsn.g.verified.cs index 025ad7c139..1d25f17958 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.AsnClient.GetAsn.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.AsnClient.GetAsn.g.verified.cs @@ -29,7 +29,7 @@ public partial class AsnClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.AsnClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.AsnClient.g.verified.cs index edbe4bb15f..32481f7d77 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.AsnClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.AsnClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class AsnClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the AsnClient. @@ -22,10 +24,13 @@ public sealed partial class AsnClient : global::System.IDisposable /// public AsnClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://ipinfo.io/"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.DomainsClient.GetDomains.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.DomainsClient.GetDomains.g.verified.cs index 6512c1944a..67de0bd9dc 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.DomainsClient.GetDomains.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.DomainsClient.GetDomains.g.verified.cs @@ -33,7 +33,7 @@ public partial class DomainsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.DomainsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.DomainsClient.g.verified.cs index 9204c97f14..e46f2e5ecb 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.DomainsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.DomainsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class DomainsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the DomainsClient. @@ -22,10 +24,13 @@ public sealed partial class DomainsClient : global::System.IDisposable /// public DomainsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://ipinfo.io/"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.GeneralClient.Batch.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.GeneralClient.Batch.g.verified.cs index 9a94b99c53..6e8e0998e8 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.GeneralClient.Batch.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.GeneralClient.Batch.g.verified.cs @@ -22,7 +22,7 @@ public partial class GeneralClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/batch", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class GeneralClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.GeneralClient.GetCurrentInformation.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.GeneralClient.GetCurrentInformation.g.verified.cs index b00e90b57e..893b5a9fdf 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.GeneralClient.GetCurrentInformation.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.GeneralClient.GetCurrentInformation.g.verified.cs @@ -27,7 +27,7 @@ public partial class GeneralClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.GeneralClient.GetInformationByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.GeneralClient.GetInformationByIp.g.verified.cs index 97f3449fad..8816412e37 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.GeneralClient.GetInformationByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.GeneralClient.GetInformationByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class GeneralClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.GeneralClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.GeneralClient.g.verified.cs index 91336b30c4..8fa754afe7 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.GeneralClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.GeneralClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class GeneralClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the GeneralClient. @@ -22,10 +24,13 @@ public sealed partial class GeneralClient : global::System.IDisposable /// public GeneralClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://ipinfo.io/"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.PrivacyDetectionClient.GetPrivacyInformationByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.PrivacyDetectionClient.GetPrivacyInformationByIp.g.verified.cs index e276e1f82d..6203e4ee89 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.PrivacyDetectionClient.GetPrivacyInformationByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.PrivacyDetectionClient.GetPrivacyInformationByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class PrivacyDetectionClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.PrivacyDetectionClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.PrivacyDetectionClient.g.verified.cs index e3b7383add..e4da80242b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.PrivacyDetectionClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.PrivacyDetectionClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class PrivacyDetectionClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the PrivacyDetectionClient. @@ -22,10 +24,13 @@ public sealed partial class PrivacyDetectionClient : global::System.IDisposable /// public PrivacyDetectionClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://ipinfo.io/"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.RangesClient.GetRanges.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.RangesClient.GetRanges.g.verified.cs index 227d00e2f7..597046e62c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.RangesClient.GetRanges.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.RangesClient.GetRanges.g.verified.cs @@ -29,7 +29,7 @@ public partial class RangesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.RangesClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.RangesClient.g.verified.cs index 8913c2155d..34b2168130 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.RangesClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.RangesClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class RangesClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the RangesClient. @@ -22,10 +24,13 @@ public sealed partial class RangesClient : global::System.IDisposable /// public RangesClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://ipinfo.io/"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCityByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCityByIp.g.verified.cs index 002e4d62e6..f7d0eaccc4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCityByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCityByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCountryByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCountryByIp.g.verified.cs index fae608f0de..b90f6f70ca 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCountryByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCountryByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentCity.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentCity.g.verified.cs index 80b49a1348..1906fd4c56 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentCity.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentCity.g.verified.cs @@ -27,7 +27,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentCountry.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentCountry.g.verified.cs index e2bb178b95..5496dab419 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentCountry.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentCountry.g.verified.cs @@ -27,7 +27,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentHostname.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentHostname.g.verified.cs index 44de92672f..d17432a8ca 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentHostname.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentHostname.g.verified.cs @@ -27,7 +27,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentIp.g.verified.cs index d25d9ad359..fc83f15ec4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentIp.g.verified.cs @@ -27,7 +27,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentLocation.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentLocation.g.verified.cs index e6ea45e8d7..128a4fef6d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentLocation.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentLocation.g.verified.cs @@ -27,7 +27,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentOrganization.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentOrganization.g.verified.cs index 21b62e8f57..c200a3737c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentOrganization.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentOrganization.g.verified.cs @@ -27,7 +27,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentPostal.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentPostal.g.verified.cs index 9d21e606a7..4a6d805e37 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentPostal.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentPostal.g.verified.cs @@ -27,7 +27,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentRegion.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentRegion.g.verified.cs index ea6faaf7a5..2a22e31055 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentRegion.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentRegion.g.verified.cs @@ -27,7 +27,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentTimezone.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentTimezone.g.verified.cs index 4052bc5bb1..03ebe58666 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentTimezone.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetCurrentTimezone.g.verified.cs @@ -27,7 +27,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetHostnameByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetHostnameByIp.g.verified.cs index efb5e49fd0..9282f04133 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetHostnameByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetHostnameByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetIpByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetIpByIp.g.verified.cs index 798bfa6aa2..e662737ad8 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetIpByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetIpByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetLocationByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetLocationByIp.g.verified.cs index 37261a701f..f51058545a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetLocationByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetLocationByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetOrganizationByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetOrganizationByIp.g.verified.cs index 9ee332d088..f1f0a7dc01 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetOrganizationByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetOrganizationByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetPostalByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetPostalByIp.g.verified.cs index de0942bd1e..ceae6e2948 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetPostalByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetPostalByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetRegionByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetRegionByIp.g.verified.cs index 81363ade9c..4f445d1f6f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetRegionByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetRegionByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetTimezoneByIp.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetTimezoneByIp.g.verified.cs index 2bb68f0ac5..60b6e72d09 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetTimezoneByIp.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.GetTimezoneByIp.g.verified.cs @@ -29,7 +29,7 @@ public partial class SingleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.g.verified.cs index 59e2dba424..29c648ff88 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.SingleClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class SingleClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the SingleClient. @@ -22,10 +24,13 @@ public sealed partial class SingleClient : global::System.IDisposable /// public SingleClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://ipinfo.io/"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/NewtonsoftJson/_#G.Api.CreateRunRunsPost.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/NewtonsoftJson/_#G.Api.CreateRunRunsPost.g.verified.cs index e40e3532e6..778a700422 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/NewtonsoftJson/_#G.Api.CreateRunRunsPost.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/NewtonsoftJson/_#G.Api.CreateRunRunsPost.g.verified.cs @@ -22,7 +22,7 @@ public partial class Api method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/runs", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/NewtonsoftJson/_#G.Api.UpdateRunRunsRunIdPatch.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/NewtonsoftJson/_#G.Api.UpdateRunRunsRunIdPatch.g.verified.cs index 1fc195c3ab..ff66799890 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/NewtonsoftJson/_#G.Api.UpdateRunRunsRunIdPatch.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/NewtonsoftJson/_#G.Api.UpdateRunRunsRunIdPatch.g.verified.cs @@ -24,7 +24,7 @@ public partial class Api method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/runs/{runId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/NewtonsoftJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/NewtonsoftJson/_#G.Api.g.verified.cs index 8f83dbddd3..b44bd21e93 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/NewtonsoftJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/NewtonsoftJson/_#G.Api.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class Api : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the Api. @@ -22,10 +24,13 @@ public sealed partial class Api : global::System.IDisposable /// public Api( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(""); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#G.Api.CreateRunRunsPost.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#G.Api.CreateRunRunsPost.g.verified.cs index 38decf5558..7bde977dc2 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#G.Api.CreateRunRunsPost.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#G.Api.CreateRunRunsPost.g.verified.cs @@ -22,7 +22,7 @@ public partial class Api method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/runs", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#G.Api.UpdateRunRunsRunIdPatch.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#G.Api.UpdateRunRunsRunIdPatch.g.verified.cs index ee12e22b82..914aa6f8d7 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#G.Api.UpdateRunRunsRunIdPatch.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#G.Api.UpdateRunRunsRunIdPatch.g.verified.cs @@ -24,7 +24,7 @@ public partial class Api method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/runs/{runId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#G.Api.g.verified.cs index 8f83dbddd3..8c06801234 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#G.Api.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class Api : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the Api. @@ -22,10 +24,22 @@ public sealed partial class Api : global::System.IDisposable /// public Api( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri(""); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = + { + new global::OpenApiGenerator.JsonConverters.RunCreateSchemaExtendedRunTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunCreateSchemaRunTypeJsonConverter(), + } + }; } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.Api.g.verified.cs index 94d692560a..eaf526f7d9 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.Api.g.verified.cs @@ -12,26 +12,28 @@ namespace G public sealed partial class Api : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Given a prompt, the model will generate a completion. /// - public CompletionsClient Completions => new CompletionsClient(_httpClient); + public CompletionsClient Completions => new CompletionsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Given a list of messages comprising a conversation, the model will return a response. /// - public ChatClient Chat => new ChatClient(_httpClient); + public ChatClient Chat => new ChatClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Get a vector representation of a given input. /// - public EmbeddingsClient Embeddings => new EmbeddingsClient(_httpClient); + public EmbeddingsClient Embeddings => new EmbeddingsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// List and describe the various models available. /// - public ModelsClient Models => new ModelsClient(_httpClient); + public ModelsClient Models => new ModelsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Creates a new instance of the Api. @@ -42,10 +44,13 @@ public sealed partial class Api : global::System.IDisposable /// public Api( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("http://localhost:11434/api"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ChatClient.GenerateChatCompletion.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ChatClient.GenerateChatCompletion.g.verified.cs index f2e8e2f577..01fe9f69b4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ChatClient.GenerateChatCompletion.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ChatClient.GenerateChatCompletion.g.verified.cs @@ -22,7 +22,7 @@ public partial class ChatClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/chat", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -38,7 +38,7 @@ public partial class ChatClient while (!reader.EndOfStream && !cancellationToken.IsCancellationRequested) { var __content = await reader.ReadLineAsync().ConfigureAwait(false) ?? string.Empty; - var streamedResponse = global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + var streamedResponse = global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); yield return streamedResponse; diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ChatClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ChatClient.g.verified.cs index 710a9be8ec..758fd1c40f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ChatClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ChatClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class ChatClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the ChatClient. @@ -22,10 +24,13 @@ public sealed partial class ChatClient : global::System.IDisposable /// public ChatClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("http://localhost:11434/api"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.CompletionsClient.GenerateCompletion.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.CompletionsClient.GenerateCompletion.g.verified.cs index 1249490ca6..a0816231da 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.CompletionsClient.GenerateCompletion.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.CompletionsClient.GenerateCompletion.g.verified.cs @@ -22,7 +22,7 @@ public partial class CompletionsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/generate", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -38,7 +38,7 @@ public partial class CompletionsClient while (!reader.EndOfStream && !cancellationToken.IsCancellationRequested) { var __content = await reader.ReadLineAsync().ConfigureAwait(false) ?? string.Empty; - var streamedResponse = global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + var streamedResponse = global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); yield return streamedResponse; diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.CompletionsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.CompletionsClient.g.verified.cs index 92376b03f9..3540828586 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.CompletionsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.CompletionsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class CompletionsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the CompletionsClient. @@ -22,10 +24,13 @@ public sealed partial class CompletionsClient : global::System.IDisposable /// public CompletionsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("http://localhost:11434/api"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.EmbeddingsClient.GenerateEmbedding.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.EmbeddingsClient.GenerateEmbedding.g.verified.cs index 7ae5836707..d94a0d0b21 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.EmbeddingsClient.GenerateEmbedding.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.EmbeddingsClient.GenerateEmbedding.g.verified.cs @@ -22,7 +22,7 @@ public partial class EmbeddingsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/embeddings", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class EmbeddingsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.EmbeddingsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.EmbeddingsClient.g.verified.cs index 7377f4f3dc..8eb31bc365 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.EmbeddingsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.EmbeddingsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class EmbeddingsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the EmbeddingsClient. @@ -22,10 +24,13 @@ public sealed partial class EmbeddingsClient : global::System.IDisposable /// public EmbeddingsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("http://localhost:11434/api"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.CopyModel.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.CopyModel.g.verified.cs index 557bb66bf1..90a8882a3d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.CopyModel.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.CopyModel.g.verified.cs @@ -22,7 +22,7 @@ public partial class ModelsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/copy", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.CreateBlob.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.CreateBlob.g.verified.cs index 346f6d665a..acad381445 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.CreateBlob.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.CreateBlob.g.verified.cs @@ -24,7 +24,7 @@ public partial class ModelsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/blobs/{digest}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.CreateModel.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.CreateModel.g.verified.cs index 6152a3120b..7ab02599a9 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.CreateModel.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.CreateModel.g.verified.cs @@ -22,7 +22,7 @@ public partial class ModelsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/create", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -38,7 +38,7 @@ public partial class ModelsClient while (!reader.EndOfStream && !cancellationToken.IsCancellationRequested) { var __content = await reader.ReadLineAsync().ConfigureAwait(false) ?? string.Empty; - var streamedResponse = global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + var streamedResponse = global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); yield return streamedResponse; diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.DeleteModel.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.DeleteModel.g.verified.cs index 6bf11c43c4..2a16df0ce4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.DeleteModel.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.DeleteModel.g.verified.cs @@ -22,7 +22,7 @@ public partial class ModelsClient method: global::System.Net.Http.HttpMethod.Delete, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/delete", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.ListModels.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.ListModels.g.verified.cs index c45d56c25a..0dd4f2190c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.ListModels.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.ListModels.g.verified.cs @@ -27,7 +27,7 @@ public partial class ModelsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.PullModel.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.PullModel.g.verified.cs index 3494f99d49..70687e4373 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.PullModel.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.PullModel.g.verified.cs @@ -22,7 +22,7 @@ public partial class ModelsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/pull", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -38,7 +38,7 @@ public partial class ModelsClient while (!reader.EndOfStream && !cancellationToken.IsCancellationRequested) { var __content = await reader.ReadLineAsync().ConfigureAwait(false) ?? string.Empty; - var streamedResponse = global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + var streamedResponse = global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); yield return streamedResponse; diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.PushModel.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.PushModel.g.verified.cs index a665e14db4..07118c473d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.PushModel.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.PushModel.g.verified.cs @@ -22,7 +22,7 @@ public partial class ModelsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/push", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -38,7 +38,7 @@ public partial class ModelsClient while (!reader.EndOfStream && !cancellationToken.IsCancellationRequested) { var __content = await reader.ReadLineAsync().ConfigureAwait(false) ?? string.Empty; - var streamedResponse = global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + var streamedResponse = global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); yield return streamedResponse; diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.ShowModelInfo.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.ShowModelInfo.g.verified.cs index 4173ec1373..71b369d5c7 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.ShowModelInfo.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.ShowModelInfo.g.verified.cs @@ -22,7 +22,7 @@ public partial class ModelsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/show", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ModelsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.g.verified.cs index 2133ba77a5..77b5a8d7f9 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/NewtonsoftJson/_#G.ModelsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class ModelsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the ModelsClient. @@ -22,10 +24,13 @@ public sealed partial class ModelsClient : global::System.IDisposable /// public ModelsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("http://localhost:11434/api"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.Api.g.verified.cs index 94d692560a..e07319c241 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.Api.g.verified.cs @@ -12,26 +12,28 @@ namespace G public sealed partial class Api : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Given a prompt, the model will generate a completion. /// - public CompletionsClient Completions => new CompletionsClient(_httpClient); + public CompletionsClient Completions => new CompletionsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Given a list of messages comprising a conversation, the model will return a response. /// - public ChatClient Chat => new ChatClient(_httpClient); + public ChatClient Chat => new ChatClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Get a vector representation of a given input. /// - public EmbeddingsClient Embeddings => new EmbeddingsClient(_httpClient); + public EmbeddingsClient Embeddings => new EmbeddingsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// List and describe the various models available. /// - public ModelsClient Models => new ModelsClient(_httpClient); + public ModelsClient Models => new ModelsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Creates a new instance of the Api. @@ -42,10 +44,26 @@ public sealed partial class Api : global::System.IDisposable /// public Api( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("http://localhost:11434/api"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = + { + new global::OpenApiGenerator.JsonConverters.GenerateCompletionRequestFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GenerateChatCompletionRequestFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateModelResponseStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PullModelResponseStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PushModelResponseStatusJsonConverter(), + } + }; } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ChatClient.GenerateChatCompletion.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ChatClient.GenerateChatCompletion.g.verified.cs index ad2b7b3959..cdb634a0af 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ChatClient.GenerateChatCompletion.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ChatClient.GenerateChatCompletion.g.verified.cs @@ -22,7 +22,7 @@ public partial class ChatClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/chat", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -38,7 +38,7 @@ public partial class ChatClient while (!reader.EndOfStream && !cancellationToken.IsCancellationRequested) { var __content = await reader.ReadLineAsync().ConfigureAwait(false) ?? string.Empty; - var streamedResponse = global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + var streamedResponse = global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); yield return streamedResponse; diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ChatClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ChatClient.g.verified.cs index 710a9be8ec..59e62339c4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ChatClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ChatClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class ChatClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the ChatClient. @@ -22,10 +24,13 @@ public sealed partial class ChatClient : global::System.IDisposable /// public ChatClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("http://localhost:11434/api"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.CompletionsClient.GenerateCompletion.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.CompletionsClient.GenerateCompletion.g.verified.cs index 5d8f6ed545..6859db25f7 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.CompletionsClient.GenerateCompletion.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.CompletionsClient.GenerateCompletion.g.verified.cs @@ -22,7 +22,7 @@ public partial class CompletionsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/generate", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -38,7 +38,7 @@ public partial class CompletionsClient while (!reader.EndOfStream && !cancellationToken.IsCancellationRequested) { var __content = await reader.ReadLineAsync().ConfigureAwait(false) ?? string.Empty; - var streamedResponse = global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + var streamedResponse = global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); yield return streamedResponse; diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.CompletionsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.CompletionsClient.g.verified.cs index 92376b03f9..5ca22cf542 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.CompletionsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.CompletionsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class CompletionsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the CompletionsClient. @@ -22,10 +24,13 @@ public sealed partial class CompletionsClient : global::System.IDisposable /// public CompletionsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("http://localhost:11434/api"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.EmbeddingsClient.GenerateEmbedding.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.EmbeddingsClient.GenerateEmbedding.g.verified.cs index 32ddf6f050..cd71775bb8 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.EmbeddingsClient.GenerateEmbedding.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.EmbeddingsClient.GenerateEmbedding.g.verified.cs @@ -22,7 +22,7 @@ public partial class EmbeddingsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/embeddings", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class EmbeddingsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.EmbeddingsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.EmbeddingsClient.g.verified.cs index 7377f4f3dc..c1d281114b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.EmbeddingsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.EmbeddingsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class EmbeddingsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the EmbeddingsClient. @@ -22,10 +24,13 @@ public sealed partial class EmbeddingsClient : global::System.IDisposable /// public EmbeddingsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("http://localhost:11434/api"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.CopyModel.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.CopyModel.g.verified.cs index 4fba4c14cf..c972be29d4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.CopyModel.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.CopyModel.g.verified.cs @@ -22,7 +22,7 @@ public partial class ModelsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/copy", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.CreateBlob.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.CreateBlob.g.verified.cs index a929c73f46..f2651ed88c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.CreateBlob.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.CreateBlob.g.verified.cs @@ -24,7 +24,7 @@ public partial class ModelsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/blobs/{digest}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.CreateModel.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.CreateModel.g.verified.cs index 61ed469bbc..93fae4cb66 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.CreateModel.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.CreateModel.g.verified.cs @@ -22,7 +22,7 @@ public partial class ModelsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/create", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -38,7 +38,7 @@ public partial class ModelsClient while (!reader.EndOfStream && !cancellationToken.IsCancellationRequested) { var __content = await reader.ReadLineAsync().ConfigureAwait(false) ?? string.Empty; - var streamedResponse = global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + var streamedResponse = global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); yield return streamedResponse; diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.DeleteModel.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.DeleteModel.g.verified.cs index 17d8e37662..76cf528c0f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.DeleteModel.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.DeleteModel.g.verified.cs @@ -22,7 +22,7 @@ public partial class ModelsClient method: global::System.Net.Http.HttpMethod.Delete, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/delete", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.ListModels.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.ListModels.g.verified.cs index c53acad151..16bb345cdd 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.ListModels.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.ListModels.g.verified.cs @@ -27,7 +27,7 @@ public partial class ModelsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.PullModel.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.PullModel.g.verified.cs index 77c470b268..f178d437bb 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.PullModel.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.PullModel.g.verified.cs @@ -22,7 +22,7 @@ public partial class ModelsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/pull", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -38,7 +38,7 @@ public partial class ModelsClient while (!reader.EndOfStream && !cancellationToken.IsCancellationRequested) { var __content = await reader.ReadLineAsync().ConfigureAwait(false) ?? string.Empty; - var streamedResponse = global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + var streamedResponse = global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); yield return streamedResponse; diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.PushModel.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.PushModel.g.verified.cs index 20e7995297..08b1baea9c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.PushModel.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.PushModel.g.verified.cs @@ -22,7 +22,7 @@ public partial class ModelsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/push", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -38,7 +38,7 @@ public partial class ModelsClient while (!reader.EndOfStream && !cancellationToken.IsCancellationRequested) { var __content = await reader.ReadLineAsync().ConfigureAwait(false) ?? string.Empty; - var streamedResponse = global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + var streamedResponse = global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); yield return streamedResponse; diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.ShowModelInfo.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.ShowModelInfo.g.verified.cs index 85fbe24924..146e7c05a9 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.ShowModelInfo.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.ShowModelInfo.g.verified.cs @@ -22,7 +22,7 @@ public partial class ModelsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/show", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ModelsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.g.verified.cs index 2133ba77a5..26951baebb 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.ModelsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class ModelsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the ModelsClient. @@ -22,10 +24,13 @@ public sealed partial class ModelsClient : global::System.IDisposable /// public ModelsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("http://localhost:11434/api"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CancelRun.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CancelRun.g.verified.cs index 1e0551e69e..584e6fe963 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CancelRun.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CancelRun.g.verified.cs @@ -31,7 +31,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateAssistant.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateAssistant.g.verified.cs index 6480aebe58..a630ad9331 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateAssistant.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateAssistant.g.verified.cs @@ -22,7 +22,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/assistants", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateMessage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateMessage.g.verified.cs index 65a270ea29..06515cf8f0 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateMessage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateMessage.g.verified.cs @@ -24,7 +24,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/threads/{threadId}/messages", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateRun.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateRun.g.verified.cs index 8b6b542f6d..19cedd5070 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateRun.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateRun.g.verified.cs @@ -24,7 +24,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/threads/{threadId}/runs", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateThread.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateThread.g.verified.cs index de1310ee9c..0bb89a39bf 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateThread.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateThread.g.verified.cs @@ -22,7 +22,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/threads", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateThreadAndRun.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateThreadAndRun.g.verified.cs index d6ecd1b9bb..40fb370bc4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateThreadAndRun.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.CreateThreadAndRun.g.verified.cs @@ -22,7 +22,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/threads/runs", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.DeleteAssistant.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.DeleteAssistant.g.verified.cs index bb19bff97f..f7ba40310b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.DeleteAssistant.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.DeleteAssistant.g.verified.cs @@ -29,7 +29,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.DeleteMessage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.DeleteMessage.g.verified.cs index c6d8fac858..aa3518a913 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.DeleteMessage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.DeleteMessage.g.verified.cs @@ -31,7 +31,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.DeleteThread.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.DeleteThread.g.verified.cs index ec327ab878..5c92dcbff8 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.DeleteThread.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.DeleteThread.g.verified.cs @@ -29,7 +29,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetAssistant.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetAssistant.g.verified.cs index 1ce160c681..b9307907ea 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetAssistant.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetAssistant.g.verified.cs @@ -29,7 +29,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetMessage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetMessage.g.verified.cs index 52581eaf7a..940ec1b861 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetMessage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetMessage.g.verified.cs @@ -31,7 +31,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetRun.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetRun.g.verified.cs index cb8c03b67d..e4ab3a1952 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetRun.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetRun.g.verified.cs @@ -31,7 +31,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetRunStep.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetRunStep.g.verified.cs index 977c0f0bfc..4dee274ea9 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetRunStep.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetRunStep.g.verified.cs @@ -33,7 +33,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetThread.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetThread.g.verified.cs index efd3a54307..686c16c23f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetThread.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.GetThread.g.verified.cs @@ -29,7 +29,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ListAssistants.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ListAssistants.g.verified.cs index 768c623fa7..a01913382e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ListAssistants.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ListAssistants.g.verified.cs @@ -41,7 +41,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ListMessages.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ListMessages.g.verified.cs index 61c8927d19..77c7ed70f9 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ListMessages.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ListMessages.g.verified.cs @@ -45,7 +45,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ListRunSteps.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ListRunSteps.g.verified.cs index 236b4b296a..b452ed3383 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ListRunSteps.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ListRunSteps.g.verified.cs @@ -45,7 +45,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ListRuns.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ListRuns.g.verified.cs index d8d3bc17cb..3fad7c087a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ListRuns.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ListRuns.g.verified.cs @@ -43,7 +43,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ModifyAssistant.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ModifyAssistant.g.verified.cs index 08b60dfed7..002588fffe 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ModifyAssistant.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ModifyAssistant.g.verified.cs @@ -24,7 +24,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/assistants/{assistantId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ModifyMessage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ModifyMessage.g.verified.cs index aa01027a6c..fa42dbff7e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ModifyMessage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ModifyMessage.g.verified.cs @@ -26,7 +26,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/threads/{threadId}/messages/{messageId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ModifyRun.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ModifyRun.g.verified.cs index 600bde8697..1146711451 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ModifyRun.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ModifyRun.g.verified.cs @@ -26,7 +26,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/threads/{threadId}/runs/{runId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ModifyThread.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ModifyThread.g.verified.cs index d911c70eb4..dfb93c656d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ModifyThread.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.ModifyThread.g.verified.cs @@ -24,7 +24,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/threads/{threadId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.SubmitToolOuputsToRun.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.SubmitToolOuputsToRun.g.verified.cs index d0a736c67c..47e0ff5bfe 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.SubmitToolOuputsToRun.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.SubmitToolOuputsToRun.g.verified.cs @@ -26,7 +26,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/threads/{threadId}/runs/{runId}/submit_tool_outputs", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.g.verified.cs index 1fc27083be..6af03106fb 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AssistantsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class AssistantsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the AssistantsClient. @@ -22,10 +24,13 @@ public sealed partial class AssistantsClient : global::System.IDisposable /// public AssistantsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AudioClient.CreateSpeech.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AudioClient.CreateSpeech.g.verified.cs index 7e79902bf7..832fe12334 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AudioClient.CreateSpeech.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AudioClient.CreateSpeech.g.verified.cs @@ -22,7 +22,7 @@ public partial class AudioClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/audio/speech", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class AudioClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AudioClient.CreateTranscription.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AudioClient.CreateTranscription.g.verified.cs index a6acc94592..6e447d844f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AudioClient.CreateTranscription.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AudioClient.CreateTranscription.g.verified.cs @@ -22,7 +22,7 @@ public partial class AudioClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/audio/transcriptions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class AudioClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AudioClient.CreateTranslation.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AudioClient.CreateTranslation.g.verified.cs index 5718ff118c..fb1335e1d3 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AudioClient.CreateTranslation.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AudioClient.CreateTranslation.g.verified.cs @@ -22,7 +22,7 @@ public partial class AudioClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/audio/translations", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class AudioClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AudioClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AudioClient.g.verified.cs index c1cfa57ecf..66a7108ae6 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AudioClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.AudioClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class AudioClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the AudioClient. @@ -22,10 +24,13 @@ public sealed partial class AudioClient : global::System.IDisposable /// public AudioClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.CancelBatch.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.CancelBatch.g.verified.cs index c1890e5656..a61f48d506 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.CancelBatch.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.CancelBatch.g.verified.cs @@ -29,7 +29,7 @@ public partial class BatchClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.CreateBatch.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.CreateBatch.g.verified.cs index 003d67b8e7..5c033187e2 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.CreateBatch.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.CreateBatch.g.verified.cs @@ -22,7 +22,7 @@ public partial class BatchClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/batches", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class BatchClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.ListBatches.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.ListBatches.g.verified.cs index 52fd49cac1..b24e0ac1f0 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.ListBatches.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.ListBatches.g.verified.cs @@ -31,7 +31,7 @@ public partial class BatchClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.RetrieveBatch.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.RetrieveBatch.g.verified.cs index a81e2cabd5..b6b0a942e9 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.RetrieveBatch.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.RetrieveBatch.g.verified.cs @@ -29,7 +29,7 @@ public partial class BatchClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.g.verified.cs index ef4a0c7dd5..b98785719b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.BatchClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class BatchClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the BatchClient. @@ -22,10 +24,13 @@ public sealed partial class BatchClient : global::System.IDisposable /// public BatchClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ChatClient.CreateChatCompletion.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ChatClient.CreateChatCompletion.g.verified.cs index 2fbb02b0ff..5d3575caa4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ChatClient.CreateChatCompletion.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ChatClient.CreateChatCompletion.g.verified.cs @@ -22,7 +22,7 @@ public partial class ChatClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/chat/completions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ChatClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ChatClient.g.verified.cs index 85f204e72a..42928126ff 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ChatClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ChatClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class ChatClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the ChatClient. @@ -22,10 +24,13 @@ public sealed partial class ChatClient : global::System.IDisposable /// public ChatClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.CompletionsClient.CreateCompletion.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.CompletionsClient.CreateCompletion.g.verified.cs index 4c45b1f054..7f34d3279d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.CompletionsClient.CreateCompletion.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.CompletionsClient.CreateCompletion.g.verified.cs @@ -22,7 +22,7 @@ public partial class CompletionsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/completions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class CompletionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.CompletionsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.CompletionsClient.g.verified.cs index 10c312538f..d4cebc3757 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.CompletionsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.CompletionsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class CompletionsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the CompletionsClient. @@ -22,10 +24,13 @@ public sealed partial class CompletionsClient : global::System.IDisposable /// public CompletionsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.EmbeddingsClient.CreateEmbedding.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.EmbeddingsClient.CreateEmbedding.g.verified.cs index d67714444b..3c68c7e2bb 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.EmbeddingsClient.CreateEmbedding.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.EmbeddingsClient.CreateEmbedding.g.verified.cs @@ -22,7 +22,7 @@ public partial class EmbeddingsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/embeddings", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class EmbeddingsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.EmbeddingsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.EmbeddingsClient.g.verified.cs index 04fad1e31a..c399fbd1ae 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.EmbeddingsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.EmbeddingsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class EmbeddingsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the EmbeddingsClient. @@ -22,10 +24,13 @@ public sealed partial class EmbeddingsClient : global::System.IDisposable /// public EmbeddingsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.CreateFile.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.CreateFile.g.verified.cs index 4897babb3e..f659587b80 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.CreateFile.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.CreateFile.g.verified.cs @@ -22,7 +22,7 @@ public partial class FilesClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/files", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class FilesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.DeleteFile.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.DeleteFile.g.verified.cs index f36a2177bb..f29e0bc102 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.DeleteFile.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.DeleteFile.g.verified.cs @@ -29,7 +29,7 @@ public partial class FilesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.DownloadFile.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.DownloadFile.g.verified.cs index e2a68e34f8..16443f35ef 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.DownloadFile.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.DownloadFile.g.verified.cs @@ -29,7 +29,7 @@ public partial class FilesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.ListFiles.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.ListFiles.g.verified.cs index d07c6f35b7..c0d5df02df 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.ListFiles.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.ListFiles.g.verified.cs @@ -29,7 +29,7 @@ public partial class FilesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.RetrieveFile.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.RetrieveFile.g.verified.cs index 6174e7d66c..99a32ebd26 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.RetrieveFile.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.RetrieveFile.g.verified.cs @@ -29,7 +29,7 @@ public partial class FilesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.g.verified.cs index 8ba6ad5b46..a0e51e2efb 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FilesClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class FilesClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the FilesClient. @@ -22,10 +24,13 @@ public sealed partial class FilesClient : global::System.IDisposable /// public FilesClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.CancelFineTuningJob.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.CancelFineTuningJob.g.verified.cs index 07b7fd376a..b6bad3cd98 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.CancelFineTuningJob.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.CancelFineTuningJob.g.verified.cs @@ -29,7 +29,7 @@ public partial class FineTuningClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.CreateFineTuningJob.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.CreateFineTuningJob.g.verified.cs index 1a5e6dd167..27fd17d70d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.CreateFineTuningJob.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.CreateFineTuningJob.g.verified.cs @@ -22,7 +22,7 @@ public partial class FineTuningClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/fine_tuning/jobs", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class FineTuningClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.ListFineTuningEvents.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.ListFineTuningEvents.g.verified.cs index 52bbabc1c3..979ed24ba3 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.ListFineTuningEvents.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.ListFineTuningEvents.g.verified.cs @@ -33,7 +33,7 @@ public partial class FineTuningClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.ListFineTuningJobCheckpoints.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.ListFineTuningJobCheckpoints.g.verified.cs index 83762a2243..4cc6fa68ae 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.ListFineTuningJobCheckpoints.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.ListFineTuningJobCheckpoints.g.verified.cs @@ -33,7 +33,7 @@ public partial class FineTuningClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.ListPaginatedFineTuningJobs.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.ListPaginatedFineTuningJobs.g.verified.cs index ae3442c951..d16c4c92e2 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.ListPaginatedFineTuningJobs.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.ListPaginatedFineTuningJobs.g.verified.cs @@ -31,7 +31,7 @@ public partial class FineTuningClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.RetrieveFineTuningJob.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.RetrieveFineTuningJob.g.verified.cs index c978ecd67b..be5abea8aa 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.RetrieveFineTuningJob.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.RetrieveFineTuningJob.g.verified.cs @@ -29,7 +29,7 @@ public partial class FineTuningClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.g.verified.cs index 049013bbc1..97059febee 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.FineTuningClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class FineTuningClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the FineTuningClient. @@ -22,10 +24,13 @@ public sealed partial class FineTuningClient : global::System.IDisposable /// public FineTuningClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ImagesClient.CreateImage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ImagesClient.CreateImage.g.verified.cs index c947db2063..c21187ef13 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ImagesClient.CreateImage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ImagesClient.CreateImage.g.verified.cs @@ -22,7 +22,7 @@ public partial class ImagesClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/images/generations", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ImagesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ImagesClient.CreateImageEdit.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ImagesClient.CreateImageEdit.g.verified.cs index 62404177d9..000b70742b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ImagesClient.CreateImageEdit.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ImagesClient.CreateImageEdit.g.verified.cs @@ -22,7 +22,7 @@ public partial class ImagesClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/images/edits", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ImagesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ImagesClient.CreateImageVariation.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ImagesClient.CreateImageVariation.g.verified.cs index 7d1ebfc044..e030391200 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ImagesClient.CreateImageVariation.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ImagesClient.CreateImageVariation.g.verified.cs @@ -22,7 +22,7 @@ public partial class ImagesClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/images/variations", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ImagesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ImagesClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ImagesClient.g.verified.cs index b5ad9ae7f4..1b86702716 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ImagesClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ImagesClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class ImagesClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the ImagesClient. @@ -22,10 +24,13 @@ public sealed partial class ImagesClient : global::System.IDisposable /// public ImagesClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModelsClient.DeleteModel.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModelsClient.DeleteModel.g.verified.cs index 39f598216b..3a552430dd 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModelsClient.DeleteModel.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModelsClient.DeleteModel.g.verified.cs @@ -29,7 +29,7 @@ public partial class ModelsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModelsClient.ListModels.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModelsClient.ListModels.g.verified.cs index fb8eb88b2a..02200bf949 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModelsClient.ListModels.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModelsClient.ListModels.g.verified.cs @@ -27,7 +27,7 @@ public partial class ModelsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModelsClient.RetrieveModel.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModelsClient.RetrieveModel.g.verified.cs index 472e4bcc53..697cb3e43e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModelsClient.RetrieveModel.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModelsClient.RetrieveModel.g.verified.cs @@ -29,7 +29,7 @@ public partial class ModelsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModelsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModelsClient.g.verified.cs index c56b189373..2c308de670 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModelsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModelsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class ModelsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the ModelsClient. @@ -22,10 +24,13 @@ public sealed partial class ModelsClient : global::System.IDisposable /// public ModelsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModerationsClient.CreateModeration.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModerationsClient.CreateModeration.g.verified.cs index c381c9bba6..7dc198ead6 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModerationsClient.CreateModeration.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModerationsClient.CreateModeration.g.verified.cs @@ -22,7 +22,7 @@ public partial class ModerationsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/moderations", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ModerationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModerationsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModerationsClient.g.verified.cs index c66ba7c865..1a76662796 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModerationsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.ModerationsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class ModerationsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the ModerationsClient. @@ -22,10 +24,13 @@ public sealed partial class ModerationsClient : global::System.IDisposable /// public ModerationsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.OpenAiClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.OpenAiClient.g.verified.cs index 64443329bb..72876e77d6 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.OpenAiClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.OpenAiClient.g.verified.cs @@ -12,66 +12,68 @@ namespace G public sealed partial class OpenAiClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Build Assistants that can call models and use tools. /// - public AssistantsClient Assistants => new AssistantsClient(_httpClient); + public AssistantsClient Assistants => new AssistantsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Learn how to turn audio into text or text into audio. /// - public AudioClient Audio => new AudioClient(_httpClient); + public AudioClient Audio => new AudioClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Given a list of messages comprising a conversation, the model will return a response. /// - public ChatClient Chat => new ChatClient(_httpClient); + public ChatClient Chat => new ChatClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position. /// - public CompletionsClient Completions => new CompletionsClient(_httpClient); + public CompletionsClient Completions => new CompletionsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. /// - public EmbeddingsClient Embeddings => new EmbeddingsClient(_httpClient); + public EmbeddingsClient Embeddings => new EmbeddingsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Manage fine-tuning jobs to tailor a model to your specific training data. /// - public FineTuningClient FineTuning => new FineTuningClient(_httpClient); + public FineTuningClient FineTuning => new FineTuningClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Create large batches of API requests to run asynchronously. /// - public BatchClient Batch => new BatchClient(_httpClient); + public BatchClient Batch => new BatchClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Files are used to upload documents that can be used with features like Assistants and Fine-tuning. /// - public FilesClient Files => new FilesClient(_httpClient); + public FilesClient Files => new FilesClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Given a prompt and/or an input image, the model will generate a new image. /// - public ImagesClient Images => new ImagesClient(_httpClient); + public ImagesClient Images => new ImagesClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// List and describe the various models available in the API. /// - public ModelsClient Models => new ModelsClient(_httpClient); + public ModelsClient Models => new ModelsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Given a input text, outputs if the model classifies it as potentially harmful. /// - public ModerationsClient Moderations => new ModerationsClient(_httpClient); + public ModerationsClient Moderations => new ModerationsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public VectorStoresClient VectorStores => new VectorStoresClient(_httpClient); + public VectorStoresClient VectorStores => new VectorStoresClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Creates a new instance of the OpenAiClient. @@ -82,10 +84,13 @@ public sealed partial class OpenAiClient : global::System.IDisposable /// public OpenAiClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.CancelVectorStoreFileBatch.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.CancelVectorStoreFileBatch.g.verified.cs index bb31752448..b0dce8e6b2 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.CancelVectorStoreFileBatch.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.CancelVectorStoreFileBatch.g.verified.cs @@ -31,7 +31,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.CreateVectorStore.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.CreateVectorStore.g.verified.cs index 291c7d4e9e..531847e480 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.CreateVectorStore.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.CreateVectorStore.g.verified.cs @@ -22,7 +22,7 @@ public partial class VectorStoresClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/vector_stores", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.CreateVectorStoreFile.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.CreateVectorStoreFile.g.verified.cs index 2e8d2f3409..5b671738b5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.CreateVectorStoreFile.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.CreateVectorStoreFile.g.verified.cs @@ -24,7 +24,7 @@ public partial class VectorStoresClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/vector_stores/{vectorStoreId}/files", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.CreateVectorStoreFileBatch.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.CreateVectorStoreFileBatch.g.verified.cs index be674e7956..98507d867b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.CreateVectorStoreFileBatch.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.CreateVectorStoreFileBatch.g.verified.cs @@ -24,7 +24,7 @@ public partial class VectorStoresClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/vector_stores/{vectorStoreId}/file_batches", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.DeleteVectorStore.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.DeleteVectorStore.g.verified.cs index e939e91e4f..1839ce8b9e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.DeleteVectorStore.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.DeleteVectorStore.g.verified.cs @@ -29,7 +29,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.DeleteVectorStoreFile.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.DeleteVectorStoreFile.g.verified.cs index 89d8586c98..3f4b27a38e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.DeleteVectorStoreFile.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.DeleteVectorStoreFile.g.verified.cs @@ -31,7 +31,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.GetVectorStore.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.GetVectorStore.g.verified.cs index 6722810326..562a28f0de 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.GetVectorStore.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.GetVectorStore.g.verified.cs @@ -29,7 +29,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.GetVectorStoreFile.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.GetVectorStoreFile.g.verified.cs index d0f5900e8a..0af3a44b2d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.GetVectorStoreFile.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.GetVectorStoreFile.g.verified.cs @@ -31,7 +31,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.GetVectorStoreFileBatch.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.GetVectorStoreFileBatch.g.verified.cs index b5b94931fd..614723e328 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.GetVectorStoreFileBatch.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.GetVectorStoreFileBatch.g.verified.cs @@ -31,7 +31,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.ListFilesInVectorStoreBatch.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.ListFilesInVectorStoreBatch.g.verified.cs index 25d1756f31..b52b22ee66 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.ListFilesInVectorStoreBatch.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.ListFilesInVectorStoreBatch.g.verified.cs @@ -55,7 +55,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.ListVectorStoreFiles.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.ListVectorStoreFiles.g.verified.cs index 92d5156a13..21093a8d39 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.ListVectorStoreFiles.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.ListVectorStoreFiles.g.verified.cs @@ -53,7 +53,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.ListVectorStores.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.ListVectorStores.g.verified.cs index cb46a6e7c1..ef3c606b00 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.ListVectorStores.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.ListVectorStores.g.verified.cs @@ -41,7 +41,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.ModifyVectorStore.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.ModifyVectorStore.g.verified.cs index 9f6568896e..197d925782 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.ModifyVectorStore.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.ModifyVectorStore.g.verified.cs @@ -24,7 +24,7 @@ public partial class VectorStoresClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/vector_stores/{vectorStoreId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.g.verified.cs index 5efd63994b..b776c7752e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.VectorStoresClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class VectorStoresClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the VectorStoresClient. @@ -21,10 +23,13 @@ public sealed partial class VectorStoresClient : global::System.IDisposable /// public VectorStoresClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CancelRun.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CancelRun.g.verified.cs index bea82778fb..b66933c78c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CancelRun.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CancelRun.g.verified.cs @@ -31,7 +31,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateAssistant.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateAssistant.g.verified.cs index ed0d3333fe..69a316c55e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateAssistant.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateAssistant.g.verified.cs @@ -22,7 +22,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/assistants", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateMessage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateMessage.g.verified.cs index 4381bb6b77..12e6efd53c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateMessage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateMessage.g.verified.cs @@ -24,7 +24,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/threads/{threadId}/messages", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateRun.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateRun.g.verified.cs index 1d7f497f67..8db55d1dc5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateRun.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateRun.g.verified.cs @@ -24,7 +24,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/threads/{threadId}/runs", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateThread.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateThread.g.verified.cs index 802332353c..af3551aa79 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateThread.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateThread.g.verified.cs @@ -22,7 +22,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/threads", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateThreadAndRun.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateThreadAndRun.g.verified.cs index f6714508a6..f626e6ed33 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateThreadAndRun.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.CreateThreadAndRun.g.verified.cs @@ -22,7 +22,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/threads/runs", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.DeleteAssistant.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.DeleteAssistant.g.verified.cs index 73ffe9459f..33e163c76e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.DeleteAssistant.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.DeleteAssistant.g.verified.cs @@ -29,7 +29,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.DeleteMessage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.DeleteMessage.g.verified.cs index 9a2b41c87f..bb054e31f2 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.DeleteMessage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.DeleteMessage.g.verified.cs @@ -31,7 +31,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.DeleteThread.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.DeleteThread.g.verified.cs index f098c70ca6..6e1d93cbeb 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.DeleteThread.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.DeleteThread.g.verified.cs @@ -29,7 +29,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetAssistant.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetAssistant.g.verified.cs index ce5264575c..c074bee322 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetAssistant.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetAssistant.g.verified.cs @@ -29,7 +29,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetMessage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetMessage.g.verified.cs index dbf1a93f60..6f0a26b69b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetMessage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetMessage.g.verified.cs @@ -31,7 +31,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetRun.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetRun.g.verified.cs index caf95d67dc..7a3efa3ca2 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetRun.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetRun.g.verified.cs @@ -31,7 +31,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetRunStep.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetRunStep.g.verified.cs index 54fec677b8..0fd4dfacd1 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetRunStep.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetRunStep.g.verified.cs @@ -33,7 +33,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetThread.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetThread.g.verified.cs index 4c6a41c2c7..954dc32728 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetThread.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.GetThread.g.verified.cs @@ -29,7 +29,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ListAssistants.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ListAssistants.g.verified.cs index 533e3bf93a..52eebea59b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ListAssistants.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ListAssistants.g.verified.cs @@ -35,7 +35,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ListMessages.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ListMessages.g.verified.cs index 3eea9fc814..e5042d0cd0 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ListMessages.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ListMessages.g.verified.cs @@ -39,7 +39,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ListRunSteps.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ListRunSteps.g.verified.cs index ae087c3f06..268c858764 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ListRunSteps.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ListRunSteps.g.verified.cs @@ -39,7 +39,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ListRuns.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ListRuns.g.verified.cs index 594eec2ed6..91903a2807 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ListRuns.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ListRuns.g.verified.cs @@ -37,7 +37,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ModifyAssistant.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ModifyAssistant.g.verified.cs index b41fa42aff..92dd90189a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ModifyAssistant.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ModifyAssistant.g.verified.cs @@ -24,7 +24,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/assistants/{assistantId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ModifyMessage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ModifyMessage.g.verified.cs index 0434f79c32..681cec89be 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ModifyMessage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ModifyMessage.g.verified.cs @@ -26,7 +26,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/threads/{threadId}/messages/{messageId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ModifyRun.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ModifyRun.g.verified.cs index aa299e9168..dbdb2c356c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ModifyRun.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ModifyRun.g.verified.cs @@ -26,7 +26,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/threads/{threadId}/runs/{runId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ModifyThread.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ModifyThread.g.verified.cs index d8e93f1221..b8439db3a5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ModifyThread.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.ModifyThread.g.verified.cs @@ -24,7 +24,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/threads/{threadId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.SubmitToolOuputsToRun.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.SubmitToolOuputsToRun.g.verified.cs index f6ba689a8b..430db7acdf 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.SubmitToolOuputsToRun.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.SubmitToolOuputsToRun.g.verified.cs @@ -26,7 +26,7 @@ public partial class AssistantsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/threads/{threadId}/runs/{runId}/submit_tool_outputs", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class AssistantsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.g.verified.cs index 1fc27083be..c33cba1199 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AssistantsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class AssistantsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the AssistantsClient. @@ -22,10 +24,13 @@ public sealed partial class AssistantsClient : global::System.IDisposable /// public AssistantsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AudioClient.CreateSpeech.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AudioClient.CreateSpeech.g.verified.cs index b0bed0655c..69d4cfcfc5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AudioClient.CreateSpeech.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AudioClient.CreateSpeech.g.verified.cs @@ -22,7 +22,7 @@ public partial class AudioClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/audio/speech", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class AudioClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AudioClient.CreateTranscription.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AudioClient.CreateTranscription.g.verified.cs index 26587b73ab..9d835e6e72 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AudioClient.CreateTranscription.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AudioClient.CreateTranscription.g.verified.cs @@ -22,7 +22,7 @@ public partial class AudioClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/audio/transcriptions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class AudioClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize?>(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AudioClient.CreateTranslation.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AudioClient.CreateTranslation.g.verified.cs index c7ed53b779..96bfdb9443 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AudioClient.CreateTranslation.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AudioClient.CreateTranslation.g.verified.cs @@ -22,7 +22,7 @@ public partial class AudioClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/audio/translations", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class AudioClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize?>(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AudioClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AudioClient.g.verified.cs index c1cfa57ecf..007d04c4d2 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AudioClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.AudioClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class AudioClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the AudioClient. @@ -22,10 +24,13 @@ public sealed partial class AudioClient : global::System.IDisposable /// public AudioClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.CancelBatch.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.CancelBatch.g.verified.cs index 3874d66d94..fd9331e133 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.CancelBatch.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.CancelBatch.g.verified.cs @@ -29,7 +29,7 @@ public partial class BatchClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.CreateBatch.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.CreateBatch.g.verified.cs index bf5fe20661..baeaa513d1 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.CreateBatch.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.CreateBatch.g.verified.cs @@ -22,7 +22,7 @@ public partial class BatchClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/batches", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class BatchClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.ListBatches.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.ListBatches.g.verified.cs index e392e69e26..6944763f7d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.ListBatches.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.ListBatches.g.verified.cs @@ -31,7 +31,7 @@ public partial class BatchClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.RetrieveBatch.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.RetrieveBatch.g.verified.cs index 08f286fe9b..d595ed34de 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.RetrieveBatch.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.RetrieveBatch.g.verified.cs @@ -29,7 +29,7 @@ public partial class BatchClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.g.verified.cs index ef4a0c7dd5..48be83383f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.BatchClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class BatchClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the BatchClient. @@ -22,10 +24,13 @@ public sealed partial class BatchClient : global::System.IDisposable /// public BatchClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ChatClient.CreateChatCompletion.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ChatClient.CreateChatCompletion.g.verified.cs index c5fca9e4ca..ff9c753066 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ChatClient.CreateChatCompletion.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ChatClient.CreateChatCompletion.g.verified.cs @@ -22,7 +22,7 @@ public partial class ChatClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/chat/completions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ChatClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ChatClient.g.verified.cs index 85f204e72a..71e21d7c71 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ChatClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ChatClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class ChatClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the ChatClient. @@ -22,10 +24,13 @@ public sealed partial class ChatClient : global::System.IDisposable /// public ChatClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.CompletionsClient.CreateCompletion.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.CompletionsClient.CreateCompletion.g.verified.cs index 6212f632c2..b9ed6244fc 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.CompletionsClient.CreateCompletion.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.CompletionsClient.CreateCompletion.g.verified.cs @@ -22,7 +22,7 @@ public partial class CompletionsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/completions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class CompletionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.CompletionsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.CompletionsClient.g.verified.cs index 10c312538f..714efb0e4b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.CompletionsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.CompletionsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class CompletionsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the CompletionsClient. @@ -22,10 +24,13 @@ public sealed partial class CompletionsClient : global::System.IDisposable /// public CompletionsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.EmbeddingsClient.CreateEmbedding.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.EmbeddingsClient.CreateEmbedding.g.verified.cs index d84fdf6b39..548d86ca90 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.EmbeddingsClient.CreateEmbedding.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.EmbeddingsClient.CreateEmbedding.g.verified.cs @@ -22,7 +22,7 @@ public partial class EmbeddingsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/embeddings", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class EmbeddingsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.EmbeddingsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.EmbeddingsClient.g.verified.cs index 04fad1e31a..641050c09f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.EmbeddingsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.EmbeddingsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class EmbeddingsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the EmbeddingsClient. @@ -22,10 +24,13 @@ public sealed partial class EmbeddingsClient : global::System.IDisposable /// public EmbeddingsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.CreateFile.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.CreateFile.g.verified.cs index 0c4744b55e..950ba3e077 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.CreateFile.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.CreateFile.g.verified.cs @@ -22,7 +22,7 @@ public partial class FilesClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/files", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class FilesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.DeleteFile.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.DeleteFile.g.verified.cs index 547bfbe9b8..2e0264db9b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.DeleteFile.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.DeleteFile.g.verified.cs @@ -29,7 +29,7 @@ public partial class FilesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.DownloadFile.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.DownloadFile.g.verified.cs index 1f2c4ec4fb..a3736f953c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.DownloadFile.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.DownloadFile.g.verified.cs @@ -29,7 +29,7 @@ public partial class FilesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.ListFiles.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.ListFiles.g.verified.cs index 754d80c7ba..dd7b4c2c91 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.ListFiles.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.ListFiles.g.verified.cs @@ -29,7 +29,7 @@ public partial class FilesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.RetrieveFile.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.RetrieveFile.g.verified.cs index 2e971b5971..e55bc67e11 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.RetrieveFile.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.RetrieveFile.g.verified.cs @@ -29,7 +29,7 @@ public partial class FilesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.g.verified.cs index 8ba6ad5b46..6aa445b34d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FilesClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class FilesClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the FilesClient. @@ -22,10 +24,13 @@ public sealed partial class FilesClient : global::System.IDisposable /// public FilesClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.CancelFineTuningJob.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.CancelFineTuningJob.g.verified.cs index 803858baee..b56a1f8b1b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.CancelFineTuningJob.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.CancelFineTuningJob.g.verified.cs @@ -29,7 +29,7 @@ public partial class FineTuningClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.CreateFineTuningJob.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.CreateFineTuningJob.g.verified.cs index 0939d74d58..44ceee56d2 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.CreateFineTuningJob.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.CreateFineTuningJob.g.verified.cs @@ -22,7 +22,7 @@ public partial class FineTuningClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/fine_tuning/jobs", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class FineTuningClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.ListFineTuningEvents.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.ListFineTuningEvents.g.verified.cs index 346e1b35c7..e185cd0607 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.ListFineTuningEvents.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.ListFineTuningEvents.g.verified.cs @@ -33,7 +33,7 @@ public partial class FineTuningClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.ListFineTuningJobCheckpoints.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.ListFineTuningJobCheckpoints.g.verified.cs index 2992037f48..2f7b799956 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.ListFineTuningJobCheckpoints.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.ListFineTuningJobCheckpoints.g.verified.cs @@ -33,7 +33,7 @@ public partial class FineTuningClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.ListPaginatedFineTuningJobs.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.ListPaginatedFineTuningJobs.g.verified.cs index df941e9d06..9cc5b24881 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.ListPaginatedFineTuningJobs.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.ListPaginatedFineTuningJobs.g.verified.cs @@ -31,7 +31,7 @@ public partial class FineTuningClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.RetrieveFineTuningJob.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.RetrieveFineTuningJob.g.verified.cs index 0fe379bb61..c46f900360 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.RetrieveFineTuningJob.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.RetrieveFineTuningJob.g.verified.cs @@ -29,7 +29,7 @@ public partial class FineTuningClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.g.verified.cs index 049013bbc1..9590b52c48 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.FineTuningClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class FineTuningClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the FineTuningClient. @@ -22,10 +24,13 @@ public sealed partial class FineTuningClient : global::System.IDisposable /// public FineTuningClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ImagesClient.CreateImage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ImagesClient.CreateImage.g.verified.cs index 512e5d7bac..73928bc398 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ImagesClient.CreateImage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ImagesClient.CreateImage.g.verified.cs @@ -22,7 +22,7 @@ public partial class ImagesClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/images/generations", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ImagesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ImagesClient.CreateImageEdit.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ImagesClient.CreateImageEdit.g.verified.cs index 13d182c814..ffa823ddf5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ImagesClient.CreateImageEdit.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ImagesClient.CreateImageEdit.g.verified.cs @@ -22,7 +22,7 @@ public partial class ImagesClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/images/edits", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ImagesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ImagesClient.CreateImageVariation.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ImagesClient.CreateImageVariation.g.verified.cs index 94bd5f141c..e0343d3db6 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ImagesClient.CreateImageVariation.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ImagesClient.CreateImageVariation.g.verified.cs @@ -22,7 +22,7 @@ public partial class ImagesClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/images/variations", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ImagesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ImagesClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ImagesClient.g.verified.cs index b5ad9ae7f4..66368e021d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ImagesClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ImagesClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class ImagesClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the ImagesClient. @@ -22,10 +24,13 @@ public sealed partial class ImagesClient : global::System.IDisposable /// public ImagesClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModelsClient.DeleteModel.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModelsClient.DeleteModel.g.verified.cs index 1dd646e67e..aef7b10f48 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModelsClient.DeleteModel.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModelsClient.DeleteModel.g.verified.cs @@ -29,7 +29,7 @@ public partial class ModelsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModelsClient.ListModels.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModelsClient.ListModels.g.verified.cs index 5ce622cdbc..ecbd8a0141 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModelsClient.ListModels.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModelsClient.ListModels.g.verified.cs @@ -27,7 +27,7 @@ public partial class ModelsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModelsClient.RetrieveModel.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModelsClient.RetrieveModel.g.verified.cs index 47ac5b78fc..deab042372 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModelsClient.RetrieveModel.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModelsClient.RetrieveModel.g.verified.cs @@ -29,7 +29,7 @@ public partial class ModelsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModelsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModelsClient.g.verified.cs index c56b189373..75cce8af7a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModelsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModelsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class ModelsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the ModelsClient. @@ -22,10 +24,13 @@ public sealed partial class ModelsClient : global::System.IDisposable /// public ModelsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModerationsClient.CreateModeration.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModerationsClient.CreateModeration.g.verified.cs index 744162683f..8c9030d7e2 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModerationsClient.CreateModeration.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModerationsClient.CreateModeration.g.verified.cs @@ -22,7 +22,7 @@ public partial class ModerationsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/moderations", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ModerationsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModerationsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModerationsClient.g.verified.cs index c66ba7c865..0b6a4dd018 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModerationsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.ModerationsClient.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class ModerationsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the ModerationsClient. @@ -22,10 +24,13 @@ public sealed partial class ModerationsClient : global::System.IDisposable /// public ModerationsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.OpenAiClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.OpenAiClient.g.verified.cs index 64443329bb..be7d0e5cb0 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.OpenAiClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.OpenAiClient.g.verified.cs @@ -12,66 +12,68 @@ namespace G public sealed partial class OpenAiClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Build Assistants that can call models and use tools. /// - public AssistantsClient Assistants => new AssistantsClient(_httpClient); + public AssistantsClient Assistants => new AssistantsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Learn how to turn audio into text or text into audio. /// - public AudioClient Audio => new AudioClient(_httpClient); + public AudioClient Audio => new AudioClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Given a list of messages comprising a conversation, the model will return a response. /// - public ChatClient Chat => new ChatClient(_httpClient); + public ChatClient Chat => new ChatClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Given a prompt, the model will return one or more predicted completions, and can also return the probabilities of alternative tokens at each position. /// - public CompletionsClient Completions => new CompletionsClient(_httpClient); + public CompletionsClient Completions => new CompletionsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. /// - public EmbeddingsClient Embeddings => new EmbeddingsClient(_httpClient); + public EmbeddingsClient Embeddings => new EmbeddingsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Manage fine-tuning jobs to tailor a model to your specific training data. /// - public FineTuningClient FineTuning => new FineTuningClient(_httpClient); + public FineTuningClient FineTuning => new FineTuningClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Create large batches of API requests to run asynchronously. /// - public BatchClient Batch => new BatchClient(_httpClient); + public BatchClient Batch => new BatchClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Files are used to upload documents that can be used with features like Assistants and Fine-tuning. /// - public FilesClient Files => new FilesClient(_httpClient); + public FilesClient Files => new FilesClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Given a prompt and/or an input image, the model will generate a new image. /// - public ImagesClient Images => new ImagesClient(_httpClient); + public ImagesClient Images => new ImagesClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// List and describe the various models available in the API. /// - public ModelsClient Models => new ModelsClient(_httpClient); + public ModelsClient Models => new ModelsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Given a input text, outputs if the model classifies it as potentially harmful. /// - public ModerationsClient Moderations => new ModerationsClient(_httpClient); + public ModerationsClient Moderations => new ModerationsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public VectorStoresClient VectorStores => new VectorStoresClient(_httpClient); + public VectorStoresClient VectorStores => new VectorStoresClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Creates a new instance of the OpenAiClient. @@ -82,10 +84,190 @@ public sealed partial class OpenAiClient : global::System.IDisposable /// public OpenAiClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = + { + new global::OpenApiGenerator.JsonConverters.ListModelsResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateCompletionRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateCompletionResponseChoicesFinishReasonJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateCompletionResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartImageImageUrlDetailJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartImageTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartTextTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestSystemMessageRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestUserMessageRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestAssistantMessageRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestToolMessageRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestFunctionMessageRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionToolTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionNamedToolChoiceTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionMessageToolCallTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionMessageToolCallChunkTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionResponseMessageRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionStreamResponseDeltaRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestResponseFormatTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestToolChoiceJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestFunctionCallJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionResponseChoicesFinishReasonJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionFunctionResponseChoicesFinishReasonJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionFunctionResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListPaginatedFineTuningJobsResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionStreamResponseChoicesFinishReasonJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionStreamResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageRequestQualityJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageRequestResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageRequestSizeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageRequestStyleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageEditRequestSizeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageEditRequestResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageEditRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestSizeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateModerationRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListFilesResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateFileRequestPurposeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DeleteFileResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersBatchSizeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersNEpochsJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestIntegrationsTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListFineTuningJobEventsResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListFineTuningJobCheckpointsResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateEmbeddingRequestEncodingFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateEmbeddingRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateEmbeddingResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateTranscriptionRequestResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateTranscriptionRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateTranslationRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateSpeechRequestVoiceJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateSpeechRequestResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateSpeechRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ModelObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.OpenAIFileObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.OpenAIFilePurposeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.OpenAIFileStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EmbeddingObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.FineTuningJobHyperparametersNEpochsJsonConverter(), + new global::OpenApiGenerator.JsonConverters.FineTuningJobObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.FineTuningJobStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.FineTuningIntegrationTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.FineTuningJobEventLevelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.FineTuningJobEventObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.FineTuningJobCheckpointObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.AssistantsApiResponseFormatTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.AssistantObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.AssistantObjectResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateAssistantRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateAssistantRequestResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ModifyAssistantRequestResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DeleteAssistantResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.AssistantToolsCodeTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.AssistantToolsFileSearchTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.AssistantToolsFunctionTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.TruncationObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.AssistantsNamedToolChoiceTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunObjectRequiredActionTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunObjectLastErrorCodeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunObjectIncompleteDetailsReasonJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunObjectStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunObjectToolChoiceJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunObjectResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateRunRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateRunRequestToolChoiceJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateRunRequestResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunToolCallObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestToolChoiceJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ThreadObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DeleteThreadResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageObjectIncompleteDetailsReasonJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageObjectStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageObjectRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageDeltaObjectDeltaRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageDeltaObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateMessageRequestRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DeleteMessageResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageContentImageFileObjectImageFileDetailJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageContentImageFileObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageFileObjectImageFileDetailJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageFileObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageContentImageUrlObjectImageUrlDetailJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageContentImageUrlObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageUrlObjectImageUrlDetailJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageUrlObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageContentTextObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageRequestContentTextObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageContentTextAnnotationsFileCitationObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageContentTextAnnotationsFilePathObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextAnnotationsFileCitationObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextAnnotationsFilePathObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepObjectLastErrorCodeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepObjectStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDeltaObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDetailsMessageCreationObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsMessageCreationObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeOutputLogsObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeOutputImageObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsFileSearchObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsFunctionObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VectorStoreExpirationAfterAnchorJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VectorStoreObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VectorStoreObjectStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DeleteVectorStoreResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectLastErrorCodeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DeleteVectorStoreFileResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VectorStoreFileBatchObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VectorStoreFileBatchObjectStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ErrorEventEventJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DoneEventEventJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DoneEventDataJsonConverter(), + new global::OpenApiGenerator.JsonConverters.BatchObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.BatchStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.BatchRequestInputMethodJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListBatchesResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListAssistantsOrderJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListMessagesOrderJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListRunsOrderJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListRunStepsOrderJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListVectorStoresOrderJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListVectorStoreFilesOrderJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListVectorStoreFilesFilterJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListFilesInVectorStoreBatchOrderJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListFilesInVectorStoreBatchFilterJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateBatchRequestEndpointJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateBatchRequestCompletionWindowJsonConverter(), + } + }; } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.CancelVectorStoreFileBatch.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.CancelVectorStoreFileBatch.g.verified.cs index c5890be943..0d279724d5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.CancelVectorStoreFileBatch.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.CancelVectorStoreFileBatch.g.verified.cs @@ -31,7 +31,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.CreateVectorStore.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.CreateVectorStore.g.verified.cs index 98d0a36ebd..da50d722a8 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.CreateVectorStore.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.CreateVectorStore.g.verified.cs @@ -22,7 +22,7 @@ public partial class VectorStoresClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/vector_stores", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.CreateVectorStoreFile.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.CreateVectorStoreFile.g.verified.cs index 95ac2f7640..bda7e3cd3d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.CreateVectorStoreFile.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.CreateVectorStoreFile.g.verified.cs @@ -24,7 +24,7 @@ public partial class VectorStoresClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/vector_stores/{vectorStoreId}/files", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.CreateVectorStoreFileBatch.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.CreateVectorStoreFileBatch.g.verified.cs index 654db530d9..122810deb7 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.CreateVectorStoreFileBatch.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.CreateVectorStoreFileBatch.g.verified.cs @@ -24,7 +24,7 @@ public partial class VectorStoresClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/vector_stores/{vectorStoreId}/file_batches", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.DeleteVectorStore.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.DeleteVectorStore.g.verified.cs index 20b1b3dbc0..03ec6256cb 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.DeleteVectorStore.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.DeleteVectorStore.g.verified.cs @@ -29,7 +29,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.DeleteVectorStoreFile.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.DeleteVectorStoreFile.g.verified.cs index cf32dbfae9..e93de3255d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.DeleteVectorStoreFile.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.DeleteVectorStoreFile.g.verified.cs @@ -31,7 +31,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.GetVectorStore.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.GetVectorStore.g.verified.cs index 96ac43802b..ccba27be23 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.GetVectorStore.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.GetVectorStore.g.verified.cs @@ -29,7 +29,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.GetVectorStoreFile.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.GetVectorStoreFile.g.verified.cs index 1d77efcf69..09c40f6350 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.GetVectorStoreFile.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.GetVectorStoreFile.g.verified.cs @@ -31,7 +31,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.GetVectorStoreFileBatch.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.GetVectorStoreFileBatch.g.verified.cs index f37ac36bc7..d9af463b08 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.GetVectorStoreFileBatch.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.GetVectorStoreFileBatch.g.verified.cs @@ -31,7 +31,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.ListFilesInVectorStoreBatch.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.ListFilesInVectorStoreBatch.g.verified.cs index 7253c2730f..7ad326aab2 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.ListFilesInVectorStoreBatch.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.ListFilesInVectorStoreBatch.g.verified.cs @@ -41,7 +41,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.ListVectorStoreFiles.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.ListVectorStoreFiles.g.verified.cs index bd7f62da5d..42a5286d25 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.ListVectorStoreFiles.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.ListVectorStoreFiles.g.verified.cs @@ -39,7 +39,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.ListVectorStores.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.ListVectorStores.g.verified.cs index a472096300..191af25a9a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.ListVectorStores.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.ListVectorStores.g.verified.cs @@ -35,7 +35,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.ModifyVectorStore.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.ModifyVectorStore.g.verified.cs index b3bc6f6823..fb104df208 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.ModifyVectorStore.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.ModifyVectorStore.g.verified.cs @@ -24,7 +24,7 @@ public partial class VectorStoresClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/vector_stores/{vectorStoreId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class VectorStoresClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.g.verified.cs index 5efd63994b..1af6839399 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.VectorStoresClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class VectorStoresClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the VectorStoresClient. @@ -21,10 +23,13 @@ public sealed partial class VectorStoresClient : global::System.IDisposable /// public VectorStoresClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.openai.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenApi3_0_Yaml/NewtonsoftJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenApi3_0_Yaml/NewtonsoftJson/_#G.Api.g.verified.cs index 08fda805b4..2ac26b05a8 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenApi3_0_Yaml/NewtonsoftJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenApi3_0_Yaml/NewtonsoftJson/_#G.Api.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class Api : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the Api. @@ -21,10 +23,13 @@ public sealed partial class Api : global::System.IDisposable /// public Api( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("http://petstore.swagger.io/api"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenApi3_0_Yaml/SystemTextJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenApi3_0_Yaml/SystemTextJson/_#G.Api.g.verified.cs index 08fda805b4..5db88d16fd 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenApi3_0_Yaml/SystemTextJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenApi3_0_Yaml/SystemTextJson/_#G.Api.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class Api : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the Api. @@ -21,10 +23,20 @@ public sealed partial class Api : global::System.IDisposable /// public Api( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("http://petstore.swagger.io/api"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = + { + } + }; } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreateDeployments.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreateDeployments.g.verified.cs index b2cdab997d..a3d8a4cad5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreateDeployments.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreateDeployments.g.verified.cs @@ -22,7 +22,7 @@ public partial class Api method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/deployments", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreateModels.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreateModels.g.verified.cs index 171e3cd052..9cf7147b54 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreateModels.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreateModels.g.verified.cs @@ -22,7 +22,7 @@ public partial class Api method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/models", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreatePredictions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreatePredictions.g.verified.cs index e7aadf739e..5c35357d84 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreatePredictions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreatePredictions.g.verified.cs @@ -22,7 +22,7 @@ public partial class Api method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/predictions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreatePredictionsDeployments.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreatePredictionsDeployments.g.verified.cs index 186fbf091e..793f0566c7 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreatePredictionsDeployments.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreatePredictionsDeployments.g.verified.cs @@ -26,7 +26,7 @@ public partial class Api method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/deployments/{deploymentOwner}/{deploymentName}/predictions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreatePredictionsModels.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreatePredictionsModels.g.verified.cs index e335121bee..18215fe406 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreatePredictionsModels.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreatePredictionsModels.g.verified.cs @@ -26,7 +26,7 @@ public partial class Api method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/models/{modelOwner}/{modelName}/predictions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreateTrainings.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreateTrainings.g.verified.cs index 07c716d1bc..98b09811d1 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreateTrainings.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.CreateTrainings.g.verified.cs @@ -28,7 +28,7 @@ public partial class Api method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/models/{modelOwner}/{modelName}/versions/{versionId}/trainings", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.GetAccount.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.GetAccount.g.verified.cs index 9cd32ce0a4..f58cb11822 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.GetAccount.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.GetAccount.g.verified.cs @@ -27,7 +27,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.GetDeployments.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.GetDeployments.g.verified.cs index 4248498b24..3e9d22f478 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.GetDeployments.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.GetDeployments.g.verified.cs @@ -31,7 +31,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.GetSecretDefaultWebhooks.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.GetSecretDefaultWebhooks.g.verified.cs index 63dc09361e..ffa91c0def 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.GetSecretDefaultWebhooks.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.GetSecretDefaultWebhooks.g.verified.cs @@ -27,7 +27,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.ListDeployments.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.ListDeployments.g.verified.cs index cbee05b318..e01780f5d8 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.ListDeployments.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.ListDeployments.g.verified.cs @@ -27,7 +27,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.ListHardware.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.ListHardware.g.verified.cs index da70e59511..3161fb72dd 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.ListHardware.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.ListHardware.g.verified.cs @@ -27,7 +27,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.UpdateDeployments.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.UpdateDeployments.g.verified.cs index 9afa9db5fd..942957a175 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.UpdateDeployments.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.UpdateDeployments.g.verified.cs @@ -26,7 +26,7 @@ public partial class Api method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/deployments/{deploymentOwner}/{deploymentName}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.g.verified.cs index 3cf229f50c..0c2c710ae0 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/NewtonsoftJson/_#G.Api.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class Api : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the Api. @@ -22,10 +24,13 @@ public sealed partial class Api : global::System.IDisposable /// public Api( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.replicate.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreateDeployments.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreateDeployments.g.verified.cs index 61544d112d..c318a1b8bf 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreateDeployments.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreateDeployments.g.verified.cs @@ -22,7 +22,7 @@ public partial class Api method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/deployments", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreateModels.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreateModels.g.verified.cs index 7129f1e592..7ffb53ff01 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreateModels.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreateModels.g.verified.cs @@ -22,7 +22,7 @@ public partial class Api method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/models", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreatePredictions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreatePredictions.g.verified.cs index 664a6eaff3..1c2ed3a156 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreatePredictions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreatePredictions.g.verified.cs @@ -22,7 +22,7 @@ public partial class Api method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/predictions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreatePredictionsDeployments.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreatePredictionsDeployments.g.verified.cs index aaab0bb1ce..7051390aff 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreatePredictionsDeployments.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreatePredictionsDeployments.g.verified.cs @@ -26,7 +26,7 @@ public partial class Api method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/deployments/{deploymentOwner}/{deploymentName}/predictions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreatePredictionsModels.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreatePredictionsModels.g.verified.cs index 41970c8266..225db6b0fa 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreatePredictionsModels.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreatePredictionsModels.g.verified.cs @@ -26,7 +26,7 @@ public partial class Api method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/models/{modelOwner}/{modelName}/predictions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreateTrainings.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreateTrainings.g.verified.cs index b51c9290a6..37f3cefb2f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreateTrainings.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.CreateTrainings.g.verified.cs @@ -28,7 +28,7 @@ public partial class Api method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/models/{modelOwner}/{modelName}/versions/{versionId}/trainings", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.GetAccount.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.GetAccount.g.verified.cs index 5a46d6d0f7..aa417310f7 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.GetAccount.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.GetAccount.g.verified.cs @@ -27,7 +27,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.GetDeployments.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.GetDeployments.g.verified.cs index 1b14e04460..511caa6322 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.GetDeployments.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.GetDeployments.g.verified.cs @@ -31,7 +31,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.GetSecretDefaultWebhooks.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.GetSecretDefaultWebhooks.g.verified.cs index 5b84f5a2bf..6180ae8263 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.GetSecretDefaultWebhooks.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.GetSecretDefaultWebhooks.g.verified.cs @@ -27,7 +27,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.ListDeployments.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.ListDeployments.g.verified.cs index 9dcbb48c90..2aac14bfdc 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.ListDeployments.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.ListDeployments.g.verified.cs @@ -27,7 +27,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.ListHardware.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.ListHardware.g.verified.cs index 66bfe54cf3..8968a82f1a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.ListHardware.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.ListHardware.g.verified.cs @@ -27,7 +27,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize?>(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.UpdateDeployments.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.UpdateDeployments.g.verified.cs index b4305ffacf..d96b0c1968 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.UpdateDeployments.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.UpdateDeployments.g.verified.cs @@ -26,7 +26,7 @@ public partial class Api method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/deployments/{deploymentOwner}/{deploymentName}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.g.verified.cs index 3cf229f50c..cd3bd7418e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.g.verified.cs @@ -12,6 +12,8 @@ namespace G public sealed partial class Api : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the Api. @@ -22,10 +24,29 @@ public sealed partial class Api : global::System.IDisposable /// public Api( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.replicate.com/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = + { + new global::OpenApiGenerator.JsonConverters.PredictionRequestWebhookEventsFilterJsonConverter(), + new global::OpenApiGenerator.JsonConverters.TrainingRequestWebhookEventsFilterJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VersionPredictionRequestWebhookEventsFilterJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetAccountResponseTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateDeploymentsResponseCurrentReleaseCreatedByTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetDeploymentsResponseCurrentReleaseCreatedByTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateModelsRequestVisibilityJsonConverter(), + } + }; } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/NewtonsoftJson/_#G.Api.CreatePets.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/NewtonsoftJson/_#G.Api.CreatePets.g.verified.cs index de0177e83e..6832142eb5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/NewtonsoftJson/_#G.Api.CreatePets.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/NewtonsoftJson/_#G.Api.CreatePets.g.verified.cs @@ -27,7 +27,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/NewtonsoftJson/_#G.Api.ListPets.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/NewtonsoftJson/_#G.Api.ListPets.g.verified.cs index 4d3b7dc79d..cf62f6f8bd 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/NewtonsoftJson/_#G.Api.ListPets.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/NewtonsoftJson/_#G.Api.ListPets.g.verified.cs @@ -29,7 +29,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/NewtonsoftJson/_#G.Api.ShowPetById.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/NewtonsoftJson/_#G.Api.ShowPetById.g.verified.cs index 557c5af58e..ead42e3033 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/NewtonsoftJson/_#G.Api.ShowPetById.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/NewtonsoftJson/_#G.Api.ShowPetById.g.verified.cs @@ -29,7 +29,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/NewtonsoftJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/NewtonsoftJson/_#G.Api.g.verified.cs index 89a2c87d84..c3311f4d7c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/NewtonsoftJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/NewtonsoftJson/_#G.Api.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class Api : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the Api. @@ -21,10 +23,13 @@ public sealed partial class Api : global::System.IDisposable /// public Api( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("http://petstore.swagger.io/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/SystemTextJson/_#G.Api.CreatePets.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/SystemTextJson/_#G.Api.CreatePets.g.verified.cs index 625731cfd6..6cc9cf8ec9 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/SystemTextJson/_#G.Api.CreatePets.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/SystemTextJson/_#G.Api.CreatePets.g.verified.cs @@ -27,7 +27,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/SystemTextJson/_#G.Api.ListPets.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/SystemTextJson/_#G.Api.ListPets.g.verified.cs index 43a55f03d9..773414cf30 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/SystemTextJson/_#G.Api.ListPets.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/SystemTextJson/_#G.Api.ListPets.g.verified.cs @@ -29,7 +29,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize?>(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize?>(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/SystemTextJson/_#G.Api.ShowPetById.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/SystemTextJson/_#G.Api.ShowPetById.g.verified.cs index 4f7879908c..078f4821b5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/SystemTextJson/_#G.Api.ShowPetById.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/SystemTextJson/_#G.Api.ShowPetById.g.verified.cs @@ -29,7 +29,7 @@ public partial class Api var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/SystemTextJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/SystemTextJson/_#G.Api.g.verified.cs index 89a2c87d84..c3201f6ac1 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/SystemTextJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/SpecialCases/SystemTextJson/_#G.Api.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class Api : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the Api. @@ -21,10 +23,20 @@ public sealed partial class Api : global::System.IDisposable /// public Api( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("http://petstore.swagger.io/v1"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = + { + } + }; } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AdsClient.GetAdSchedule.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AdsClient.GetAdSchedule.g.verified.cs index c3f86be641..ede92533e7 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AdsClient.GetAdSchedule.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AdsClient.GetAdSchedule.g.verified.cs @@ -29,7 +29,7 @@ public partial class AdsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AdsClient.SnoozeNextAd.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AdsClient.SnoozeNextAd.g.verified.cs index 021ef770ac..33f1dfab70 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AdsClient.SnoozeNextAd.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AdsClient.SnoozeNextAd.g.verified.cs @@ -29,7 +29,7 @@ public partial class AdsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AdsClient.StartCommercial.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AdsClient.StartCommercial.g.verified.cs index b30129516d..92e069bf1e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AdsClient.StartCommercial.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AdsClient.StartCommercial.g.verified.cs @@ -22,7 +22,7 @@ public partial class AdsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/channels/commercial", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class AdsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AdsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AdsClient.g.verified.cs index ef5e56670a..2b7c6dca5e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AdsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AdsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class AdsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the AdsClient. @@ -21,10 +23,13 @@ public sealed partial class AdsClient : global::System.IDisposable /// public AdsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AnalyticsClient.GetExtensionAnalytics.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AnalyticsClient.GetExtensionAnalytics.g.verified.cs index 9d1b7af16f..b20caa147d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AnalyticsClient.GetExtensionAnalytics.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AnalyticsClient.GetExtensionAnalytics.g.verified.cs @@ -44,7 +44,7 @@ public partial class AnalyticsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AnalyticsClient.GetGameAnalytics.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AnalyticsClient.GetGameAnalytics.g.verified.cs index 7f97fc3241..65f10d34fb 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AnalyticsClient.GetGameAnalytics.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AnalyticsClient.GetGameAnalytics.g.verified.cs @@ -44,7 +44,7 @@ public partial class AnalyticsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AnalyticsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AnalyticsClient.g.verified.cs index 72f2d00fea..9a56a080b1 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AnalyticsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.AnalyticsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class AnalyticsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the AnalyticsClient. @@ -21,10 +23,13 @@ public sealed partial class AnalyticsClient : global::System.IDisposable /// public AnalyticsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.Api.g.verified.cs index 6dbca9402c..71994fe441 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.Api.g.verified.cs @@ -20,156 +20,158 @@ namespace G public sealed partial class Api : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// /// - public AdsClient Ads => new AdsClient(_httpClient); + public AdsClient Ads => new AdsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public AnalyticsClient Analytics => new AnalyticsClient(_httpClient); + public AnalyticsClient Analytics => new AnalyticsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public BitsClient Bits => new BitsClient(_httpClient); + public BitsClient Bits => new BitsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public ChannelsClient Channels => new ChannelsClient(_httpClient); + public ChannelsClient Channels => new ChannelsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public ChannelPointsClient ChannelPoints => new ChannelPointsClient(_httpClient); + public ChannelPointsClient ChannelPoints => new ChannelPointsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public CharityClient Charity => new CharityClient(_httpClient); + public CharityClient Charity => new CharityClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public ChatClient Chat => new ChatClient(_httpClient); + public ChatClient Chat => new ChatClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public ClipsClient Clips => new ClipsClient(_httpClient); + public ClipsClient Clips => new ClipsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public ConduitsClient Conduits => new ConduitsClient(_httpClient); + public ConduitsClient Conduits => new ConduitsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public CCLsClient CCLs => new CCLsClient(_httpClient); + public CCLsClient CCLs => new CCLsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public EntitlementsClient Entitlements => new EntitlementsClient(_httpClient); + public EntitlementsClient Entitlements => new EntitlementsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public ExtensionsClient Extensions => new ExtensionsClient(_httpClient); + public ExtensionsClient Extensions => new ExtensionsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public EventSubClient EventSub => new EventSubClient(_httpClient); + public EventSubClient EventSub => new EventSubClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public GamesClient Games => new GamesClient(_httpClient); + public GamesClient Games => new GamesClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public GoalsClient Goals => new GoalsClient(_httpClient); + public GoalsClient Goals => new GoalsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public GuestStarClient GuestStar => new GuestStarClient(_httpClient); + public GuestStarClient GuestStar => new GuestStarClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public HypeTrainClient HypeTrain => new HypeTrainClient(_httpClient); + public HypeTrainClient HypeTrain => new HypeTrainClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public ModerationClient Moderation => new ModerationClient(_httpClient); + public ModerationClient Moderation => new ModerationClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public PollsClient Polls => new PollsClient(_httpClient); + public PollsClient Polls => new PollsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public PredictionsClient Predictions => new PredictionsClient(_httpClient); + public PredictionsClient Predictions => new PredictionsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public RaidsClient Raids => new RaidsClient(_httpClient); + public RaidsClient Raids => new RaidsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public ScheduleClient Schedule => new ScheduleClient(_httpClient); + public ScheduleClient Schedule => new ScheduleClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public SearchClient Search => new SearchClient(_httpClient); + public SearchClient Search => new SearchClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public StreamsClient Streams => new StreamsClient(_httpClient); + public StreamsClient Streams => new StreamsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public SubscriptionsClient Subscriptions => new SubscriptionsClient(_httpClient); + public SubscriptionsClient Subscriptions => new SubscriptionsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public TagsClient Tags => new TagsClient(_httpClient); + public TagsClient Tags => new TagsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public TeamsClient Teams => new TeamsClient(_httpClient); + public TeamsClient Teams => new TeamsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public UsersClient Users => new UsersClient(_httpClient); + public UsersClient Users => new UsersClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public VideosClient Videos => new VideosClient(_httpClient); + public VideosClient Videos => new VideosClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public WhispersClient Whispers => new WhispersClient(_httpClient); + public WhispersClient Whispers => new WhispersClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Creates a new instance of the Api. @@ -180,10 +182,13 @@ public sealed partial class Api : global::System.IDisposable /// public Api( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.BitsClient.GetBitsLeaderboard.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.BitsClient.GetBitsLeaderboard.g.verified.cs index 715bdef49e..a42ddbdd44 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.BitsClient.GetBitsLeaderboard.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.BitsClient.GetBitsLeaderboard.g.verified.cs @@ -44,7 +44,7 @@ public partial class BitsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.BitsClient.GetCheermotes.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.BitsClient.GetCheermotes.g.verified.cs index 35fe9e5359..8f19a3ceb2 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.BitsClient.GetCheermotes.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.BitsClient.GetCheermotes.g.verified.cs @@ -29,7 +29,7 @@ public partial class BitsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.BitsClient.GetExtensionTransactions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.BitsClient.GetExtensionTransactions.g.verified.cs index cbdd7c0283..ed372290fa 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.BitsClient.GetExtensionTransactions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.BitsClient.GetExtensionTransactions.g.verified.cs @@ -36,7 +36,7 @@ public partial class BitsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.BitsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.BitsClient.g.verified.cs index 87433ce4b7..9332bb7f95 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.BitsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.BitsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class BitsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the BitsClient. @@ -21,10 +23,13 @@ public sealed partial class BitsClient : global::System.IDisposable /// public BitsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CCLsClient.GetContentClassificationLabels.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CCLsClient.GetContentClassificationLabels.g.verified.cs index 675de4a2fd..25866fb515 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CCLsClient.GetContentClassificationLabels.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CCLsClient.GetContentClassificationLabels.g.verified.cs @@ -29,7 +29,7 @@ public partial class CCLsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CCLsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CCLsClient.g.verified.cs index 79ba7ecc62..769669a01a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CCLsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CCLsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class CCLsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the CCLsClient. @@ -21,10 +23,13 @@ public sealed partial class CCLsClient : global::System.IDisposable /// public CCLsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.CreateCustomRewards.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.CreateCustomRewards.g.verified.cs index b9b2cacec9..f8a5c74049 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.CreateCustomRewards.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.CreateCustomRewards.g.verified.cs @@ -24,7 +24,7 @@ public partial class ChannelPointsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/channel_points/custom_rewards?broadcaster_id={broadcasterId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class ChannelPointsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.GetCustomReward.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.GetCustomReward.g.verified.cs index cf11549c5e..797b069b82 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.GetCustomReward.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.GetCustomReward.g.verified.cs @@ -34,7 +34,7 @@ public partial class ChannelPointsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.GetCustomRewardRedemption.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.GetCustomRewardRedemption.g.verified.cs index b2d1a71f77..05d4bab69a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.GetCustomRewardRedemption.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.GetCustomRewardRedemption.g.verified.cs @@ -55,7 +55,7 @@ public partial class ChannelPointsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.UpdateCustomReward.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.UpdateCustomReward.g.verified.cs index 574488267b..0151fd31e0 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.UpdateCustomReward.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.UpdateCustomReward.g.verified.cs @@ -26,7 +26,7 @@ public partial class ChannelPointsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/channel_points/custom_rewards?broadcaster_id={broadcasterId}&id={id}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class ChannelPointsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.UpdateRedemptionStatus.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.UpdateRedemptionStatus.g.verified.cs index b6798b077f..aac447b282 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.UpdateRedemptionStatus.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.UpdateRedemptionStatus.g.verified.cs @@ -29,7 +29,7 @@ public partial class ChannelPointsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/channel_points/custom_rewards/redemptions?{string.Join("&", id.Select(static x => $"id={x}"))}&broadcaster_id={broadcasterId}&reward_id={rewardId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -42,7 +42,7 @@ public partial class ChannelPointsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.g.verified.cs index 30d61df3a7..df4ed43554 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelPointsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class ChannelPointsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the ChannelPointsClient. @@ -21,10 +23,13 @@ public sealed partial class ChannelPointsClient : global::System.IDisposable /// public ChannelPointsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.GetChannelEditors.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.GetChannelEditors.g.verified.cs index 3f1d76b0de..303fc61aca 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.GetChannelEditors.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.GetChannelEditors.g.verified.cs @@ -29,7 +29,7 @@ public partial class ChannelsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.GetChannelFollowers.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.GetChannelFollowers.g.verified.cs index 4d00922018..d19d8fadcf 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.GetChannelFollowers.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.GetChannelFollowers.g.verified.cs @@ -35,7 +35,7 @@ public partial class ChannelsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.GetChannelInformation.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.GetChannelInformation.g.verified.cs index 0ae7f995e5..9ffc0b20df 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.GetChannelInformation.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.GetChannelInformation.g.verified.cs @@ -30,7 +30,7 @@ public partial class ChannelsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.GetFollowedChannels.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.GetFollowedChannels.g.verified.cs index 0c8d32d18b..215c92c3dd 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.GetFollowedChannels.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.GetFollowedChannels.g.verified.cs @@ -35,7 +35,7 @@ public partial class ChannelsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.ModifyChannelInformation.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.ModifyChannelInformation.g.verified.cs index 4a1aed1295..3f50dd0316 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.ModifyChannelInformation.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.ModifyChannelInformation.g.verified.cs @@ -24,7 +24,7 @@ public partial class ChannelsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/channels?broadcaster_id={broadcasterId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.g.verified.cs index 03a2c9568c..f0e8443658 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChannelsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class ChannelsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the ChannelsClient. @@ -21,10 +23,13 @@ public sealed partial class ChannelsClient : global::System.IDisposable /// public ChannelsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CharityClient.GetCharityCampaign.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CharityClient.GetCharityCampaign.g.verified.cs index df9de74b44..163fd3bbcd 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CharityClient.GetCharityCampaign.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CharityClient.GetCharityCampaign.g.verified.cs @@ -29,7 +29,7 @@ public partial class CharityClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CharityClient.GetCharityCampaignDonations.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CharityClient.GetCharityCampaignDonations.g.verified.cs index a1ca49602a..f90dfcae6e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CharityClient.GetCharityCampaignDonations.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CharityClient.GetCharityCampaignDonations.g.verified.cs @@ -33,7 +33,7 @@ public partial class CharityClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CharityClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CharityClient.g.verified.cs index a47dade843..9c33eb9b58 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CharityClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.CharityClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class CharityClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the CharityClient. @@ -21,10 +23,13 @@ public sealed partial class CharityClient : global::System.IDisposable /// public CharityClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetChannelChatBadges.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetChannelChatBadges.g.verified.cs index 9c9e143954..39af283604 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetChannelChatBadges.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetChannelChatBadges.g.verified.cs @@ -29,7 +29,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetChannelEmotes.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetChannelEmotes.g.verified.cs index 3e5e28528a..f6f841e050 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetChannelEmotes.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetChannelEmotes.g.verified.cs @@ -29,7 +29,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetChatSettings.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetChatSettings.g.verified.cs index 690ff4bb02..e45ac3273f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetChatSettings.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetChatSettings.g.verified.cs @@ -31,7 +31,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetChatters.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetChatters.g.verified.cs index 36eabe4442..622dcf6a86 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetChatters.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetChatters.g.verified.cs @@ -35,7 +35,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetEmoteSets.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetEmoteSets.g.verified.cs index 4d02d376ef..5066e58bc0 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetEmoteSets.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetEmoteSets.g.verified.cs @@ -30,7 +30,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetGlobalChatBadges.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetGlobalChatBadges.g.verified.cs index 4b0d1e6f06..6301e0067d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetGlobalChatBadges.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetGlobalChatBadges.g.verified.cs @@ -27,7 +27,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetGlobalEmotes.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetGlobalEmotes.g.verified.cs index 01f42042d8..63c807ee8a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetGlobalEmotes.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetGlobalEmotes.g.verified.cs @@ -27,7 +27,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetUserChatColor.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetUserChatColor.g.verified.cs index 37f2b6f620..20f6f33894 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetUserChatColor.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetUserChatColor.g.verified.cs @@ -30,7 +30,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetUserEmotes.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetUserEmotes.g.verified.cs index 511c405967..b569803adf 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetUserEmotes.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.GetUserEmotes.g.verified.cs @@ -33,7 +33,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.SendChatAnnouncement.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.SendChatAnnouncement.g.verified.cs index 2cf96f9475..a155360bc0 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.SendChatAnnouncement.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.SendChatAnnouncement.g.verified.cs @@ -26,7 +26,7 @@ public partial class ChatClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/chat/announcements?broadcaster_id={broadcasterId}&moderator_id={moderatorId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.SendChatMessage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.SendChatMessage.g.verified.cs index 46cf56287e..b710eb1b9d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.SendChatMessage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.SendChatMessage.g.verified.cs @@ -22,7 +22,7 @@ public partial class ChatClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/chat/messages", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.UpdateChatSettings.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.UpdateChatSettings.g.verified.cs index 1e0ec838c3..783c924770 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.UpdateChatSettings.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.UpdateChatSettings.g.verified.cs @@ -26,7 +26,7 @@ public partial class ChatClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/chat/settings?broadcaster_id={broadcasterId}&moderator_id={moderatorId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.g.verified.cs index 590012bb60..6fccf7df6a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ChatClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class ChatClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the ChatClient. @@ -21,10 +23,13 @@ public sealed partial class ChatClient : global::System.IDisposable /// public ChatClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ClipsClient.CreateClip.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ClipsClient.CreateClip.g.verified.cs index e7ffb94d61..eca48b1197 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ClipsClient.CreateClip.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ClipsClient.CreateClip.g.verified.cs @@ -31,7 +31,7 @@ public partial class ClipsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ClipsClient.GetClips.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ClipsClient.GetClips.g.verified.cs index 190444a434..a9b4126d77 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ClipsClient.GetClips.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ClipsClient.GetClips.g.verified.cs @@ -46,7 +46,7 @@ public partial class ClipsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ClipsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ClipsClient.g.verified.cs index f7f53768ba..c2a99757bc 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ClipsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ClipsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class ClipsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the ClipsClient. @@ -21,10 +23,13 @@ public sealed partial class ClipsClient : global::System.IDisposable /// public ClipsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.CreateConduits.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.CreateConduits.g.verified.cs index ced6a514f2..337aced373 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.CreateConduits.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.CreateConduits.g.verified.cs @@ -22,7 +22,7 @@ public partial class ConduitsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/eventsub/conduits", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ConduitsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.GetConduitShards.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.GetConduitShards.g.verified.cs index de3aee1d11..dfff2ff6a6 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.GetConduitShards.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.GetConduitShards.g.verified.cs @@ -33,7 +33,7 @@ public partial class ConduitsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.GetConduits.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.GetConduits.g.verified.cs index 1d9040ef41..c3336a9fe4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.GetConduits.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.GetConduits.g.verified.cs @@ -27,7 +27,7 @@ public partial class ConduitsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.UpdateConduitShards.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.UpdateConduitShards.g.verified.cs index e12a30512a..557f28b147 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.UpdateConduitShards.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.UpdateConduitShards.g.verified.cs @@ -22,7 +22,7 @@ public partial class ConduitsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/eventsub/conduits/shards", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ConduitsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.UpdateConduits.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.UpdateConduits.g.verified.cs index 4997db0e19..817ee94330 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.UpdateConduits.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.UpdateConduits.g.verified.cs @@ -22,7 +22,7 @@ public partial class ConduitsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/eventsub/conduits", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ConduitsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.g.verified.cs index b76e678622..62cbcf52bb 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ConduitsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class ConduitsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the ConduitsClient. @@ -21,10 +23,13 @@ public sealed partial class ConduitsClient : global::System.IDisposable /// public ConduitsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EntitlementsClient.GetDropsEntitlements.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EntitlementsClient.GetDropsEntitlements.g.verified.cs index d9013e73a0..ce3db81338 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EntitlementsClient.GetDropsEntitlements.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EntitlementsClient.GetDropsEntitlements.g.verified.cs @@ -46,7 +46,7 @@ public partial class EntitlementsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EntitlementsClient.UpdateDropsEntitlements.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EntitlementsClient.UpdateDropsEntitlements.g.verified.cs index 1de31ac765..23027d8a66 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EntitlementsClient.UpdateDropsEntitlements.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EntitlementsClient.UpdateDropsEntitlements.g.verified.cs @@ -22,7 +22,7 @@ public partial class EntitlementsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/entitlements/drops", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class EntitlementsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EntitlementsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EntitlementsClient.g.verified.cs index 5be704b743..8a475198b6 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EntitlementsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EntitlementsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class EntitlementsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the EntitlementsClient. @@ -21,10 +23,13 @@ public sealed partial class EntitlementsClient : global::System.IDisposable /// public EntitlementsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EventSubClient.CreateEventsubSubscription.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EventSubClient.CreateEventsubSubscription.g.verified.cs index f18cb80dd8..70ed7dfbe0 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EventSubClient.CreateEventsubSubscription.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EventSubClient.CreateEventsubSubscription.g.verified.cs @@ -22,7 +22,7 @@ public partial class EventSubClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/eventsub/subscriptions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class EventSubClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EventSubClient.GetEventsubSubscriptions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EventSubClient.GetEventsubSubscriptions.g.verified.cs index 1475a6f7d2..fc0851547e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EventSubClient.GetEventsubSubscriptions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EventSubClient.GetEventsubSubscriptions.g.verified.cs @@ -129,7 +129,7 @@ public partial class EventSubClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EventSubClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EventSubClient.g.verified.cs index e1665fac02..1a7fa01c86 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EventSubClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.EventSubClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class EventSubClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the EventSubClient. @@ -21,10 +23,13 @@ public sealed partial class EventSubClient : global::System.IDisposable /// public EventSubClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.CreateExtensionSecret.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.CreateExtensionSecret.g.verified.cs index b71ef4e539..86c94abb81 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.CreateExtensionSecret.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.CreateExtensionSecret.g.verified.cs @@ -31,7 +31,7 @@ public partial class ExtensionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensionBitsProducts.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensionBitsProducts.g.verified.cs index 3e824a6e22..01785ffffa 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensionBitsProducts.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensionBitsProducts.g.verified.cs @@ -29,7 +29,7 @@ public partial class ExtensionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensionConfigurationSegment.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensionConfigurationSegment.g.verified.cs index a8d31eea49..86cfcadb50 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensionConfigurationSegment.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensionConfigurationSegment.g.verified.cs @@ -40,7 +40,7 @@ public partial class ExtensionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensionLiveChannels.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensionLiveChannels.g.verified.cs index eeb83521c2..742451d881 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensionLiveChannels.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensionLiveChannels.g.verified.cs @@ -33,7 +33,7 @@ public partial class ExtensionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensionSecrets.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensionSecrets.g.verified.cs index fca9406f8e..cec8d06d1c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensionSecrets.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensionSecrets.g.verified.cs @@ -27,7 +27,7 @@ public partial class ExtensionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensions.g.verified.cs index 1b111fe086..2895a3863b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetExtensions.g.verified.cs @@ -31,7 +31,7 @@ public partial class ExtensionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetReleasedExtensions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetReleasedExtensions.g.verified.cs index 8591d50d63..74909a51eb 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetReleasedExtensions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.GetReleasedExtensions.g.verified.cs @@ -31,7 +31,7 @@ public partial class ExtensionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.SendExtensionChatMessage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.SendExtensionChatMessage.g.verified.cs index 62a1b8601e..946b450fa0 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.SendExtensionChatMessage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.SendExtensionChatMessage.g.verified.cs @@ -24,7 +24,7 @@ public partial class ExtensionsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/extensions/chat?broadcaster_id={broadcasterId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.SendExtensionPubsubMessage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.SendExtensionPubsubMessage.g.verified.cs index c6cec44dd8..099397a185 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.SendExtensionPubsubMessage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.SendExtensionPubsubMessage.g.verified.cs @@ -22,7 +22,7 @@ public partial class ExtensionsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/extensions/pubsub", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.SetExtensionConfigurationSegment.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.SetExtensionConfigurationSegment.g.verified.cs index b356db26b9..0d48f75f58 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.SetExtensionConfigurationSegment.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.SetExtensionConfigurationSegment.g.verified.cs @@ -22,7 +22,7 @@ public partial class ExtensionsClient method: global::System.Net.Http.HttpMethod.Put, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/extensions/configurations", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.SetExtensionRequiredConfiguration.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.SetExtensionRequiredConfiguration.g.verified.cs index 5027fc3a3c..0e954a941b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.SetExtensionRequiredConfiguration.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.SetExtensionRequiredConfiguration.g.verified.cs @@ -24,7 +24,7 @@ public partial class ExtensionsClient method: global::System.Net.Http.HttpMethod.Put, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/extensions/required_configuration?broadcaster_id={broadcasterId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.UpdateExtensionBitsProduct.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.UpdateExtensionBitsProduct.g.verified.cs index f0fb7cb796..b9a72c3904 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.UpdateExtensionBitsProduct.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.UpdateExtensionBitsProduct.g.verified.cs @@ -22,7 +22,7 @@ public partial class ExtensionsClient method: global::System.Net.Http.HttpMethod.Put, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/bits/extensions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ExtensionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.g.verified.cs index 2f05ae1328..8d8aed0061 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ExtensionsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class ExtensionsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the ExtensionsClient. @@ -21,10 +23,13 @@ public sealed partial class ExtensionsClient : global::System.IDisposable /// public ExtensionsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GamesClient.GetGames.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GamesClient.GetGames.g.verified.cs index e6179b04fd..3c653551b6 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GamesClient.GetGames.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GamesClient.GetGames.g.verified.cs @@ -34,7 +34,7 @@ public partial class GamesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GamesClient.GetTopGames.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GamesClient.GetTopGames.g.verified.cs index 167c527b23..0f08c2bc6f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GamesClient.GetTopGames.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GamesClient.GetTopGames.g.verified.cs @@ -33,7 +33,7 @@ public partial class GamesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GamesClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GamesClient.g.verified.cs index 3e954b0164..236a3a0680 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GamesClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GamesClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class GamesClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the GamesClient. @@ -21,10 +23,13 @@ public sealed partial class GamesClient : global::System.IDisposable /// public GamesClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GoalsClient.GetCreatorGoals.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GoalsClient.GetCreatorGoals.g.verified.cs index 96a49492b8..fe209e6894 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GoalsClient.GetCreatorGoals.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GoalsClient.GetCreatorGoals.g.verified.cs @@ -29,7 +29,7 @@ public partial class GoalsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GoalsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GoalsClient.g.verified.cs index 0746b4a64f..45eb6da6b4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GoalsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GoalsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class GoalsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the GoalsClient. @@ -21,10 +23,13 @@ public sealed partial class GoalsClient : global::System.IDisposable /// public GoalsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.CreateGuestStarSession.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.CreateGuestStarSession.g.verified.cs index a4fb8566a7..383a0c16c4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.CreateGuestStarSession.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.CreateGuestStarSession.g.verified.cs @@ -29,7 +29,7 @@ public partial class GuestStarClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.GetChannelGuestStarSettings.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.GetChannelGuestStarSettings.g.verified.cs index f435d9b400..d10a7cc051 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.GetChannelGuestStarSettings.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.GetChannelGuestStarSettings.g.verified.cs @@ -31,7 +31,7 @@ public partial class GuestStarClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.GetGuestStarInvites.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.GetGuestStarInvites.g.verified.cs index 389a08c6db..2d0d435cab 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.GetGuestStarInvites.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.GetGuestStarInvites.g.verified.cs @@ -33,7 +33,7 @@ public partial class GuestStarClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.GetGuestStarSession.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.GetGuestStarSession.g.verified.cs index 8d1eae90e6..098cfd3628 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.GetGuestStarSession.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.GetGuestStarSession.g.verified.cs @@ -31,7 +31,7 @@ public partial class GuestStarClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.UpdateChannelGuestStarSettings.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.UpdateChannelGuestStarSettings.g.verified.cs index 871781707f..8a6cbc59b2 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.UpdateChannelGuestStarSettings.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.UpdateChannelGuestStarSettings.g.verified.cs @@ -24,7 +24,7 @@ public partial class GuestStarClient method: global::System.Net.Http.HttpMethod.Put, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/guest_star/channel_settings?broadcaster_id={broadcasterId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.g.verified.cs index 6e9e5a9ddd..d6ce924420 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.GuestStarClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class GuestStarClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the GuestStarClient. @@ -21,10 +23,13 @@ public sealed partial class GuestStarClient : global::System.IDisposable /// public GuestStarClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.HypeTrainClient.GetHypeTrainEvents.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.HypeTrainClient.GetHypeTrainEvents.g.verified.cs index d5b296a09d..d490f9cc8c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.HypeTrainClient.GetHypeTrainEvents.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.HypeTrainClient.GetHypeTrainEvents.g.verified.cs @@ -33,7 +33,7 @@ public partial class HypeTrainClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.HypeTrainClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.HypeTrainClient.g.verified.cs index 004bad6924..cc1ac26570 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.HypeTrainClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.HypeTrainClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class HypeTrainClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the HypeTrainClient. @@ -21,10 +23,13 @@ public sealed partial class HypeTrainClient : global::System.IDisposable /// public HypeTrainClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.AddBlockedTerm.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.AddBlockedTerm.g.verified.cs index 626970039a..d7cb53fdb4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.AddBlockedTerm.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.AddBlockedTerm.g.verified.cs @@ -26,7 +26,7 @@ public partial class ModerationClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/moderation/blocked_terms?broadcaster_id={broadcasterId}&moderator_id={moderatorId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.BanUser.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.BanUser.g.verified.cs index 3e68329d53..a0eb1c27e5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.BanUser.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.BanUser.g.verified.cs @@ -26,7 +26,7 @@ public partial class ModerationClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/moderation/bans?broadcaster_id={broadcasterId}&moderator_id={moderatorId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.CheckAutomodStatus.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.CheckAutomodStatus.g.verified.cs index 57914d931a..20bef73614 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.CheckAutomodStatus.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.CheckAutomodStatus.g.verified.cs @@ -24,7 +24,7 @@ public partial class ModerationClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/moderation/enforcements/status?broadcaster_id={broadcasterId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetAutomodSettings.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetAutomodSettings.g.verified.cs index a5d748d829..d06ca229e7 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetAutomodSettings.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetAutomodSettings.g.verified.cs @@ -31,7 +31,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetBannedUsers.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetBannedUsers.g.verified.cs index 0dda7de414..a3c88dc5c5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetBannedUsers.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetBannedUsers.g.verified.cs @@ -38,7 +38,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetBlockedTerms.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetBlockedTerms.g.verified.cs index 98d27cd175..713ec68a6f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetBlockedTerms.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetBlockedTerms.g.verified.cs @@ -35,7 +35,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetModeratedChannels.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetModeratedChannels.g.verified.cs index 3904ccf027..fefa59b532 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetModeratedChannels.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetModeratedChannels.g.verified.cs @@ -33,7 +33,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetModerators.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetModerators.g.verified.cs index ecfccc7a52..252492e4b0 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetModerators.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetModerators.g.verified.cs @@ -36,7 +36,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetShieldModeStatus.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetShieldModeStatus.g.verified.cs index 763b7322a0..e6467514e8 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetShieldModeStatus.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetShieldModeStatus.g.verified.cs @@ -31,7 +31,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetUnbanRequests.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetUnbanRequests.g.verified.cs index aec8540ad0..bbecd6261e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetUnbanRequests.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetUnbanRequests.g.verified.cs @@ -39,7 +39,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetVips.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetVips.g.verified.cs index e47525b345..e9c089e864 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetVips.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.GetVips.g.verified.cs @@ -36,7 +36,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.ManageHeldAutomodMessages.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.ManageHeldAutomodMessages.g.verified.cs index 6f938c0549..3b8ff39d32 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.ManageHeldAutomodMessages.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.ManageHeldAutomodMessages.g.verified.cs @@ -22,7 +22,7 @@ public partial class ModerationClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/moderation/automod/message", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.ResolveUnbanRequests.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.ResolveUnbanRequests.g.verified.cs index c4912050a2..7f9bddce62 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.ResolveUnbanRequests.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.ResolveUnbanRequests.g.verified.cs @@ -37,7 +37,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.UpdateAutomodSettings.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.UpdateAutomodSettings.g.verified.cs index bdef510434..d4c24257e3 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.UpdateAutomodSettings.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.UpdateAutomodSettings.g.verified.cs @@ -26,7 +26,7 @@ public partial class ModerationClient method: global::System.Net.Http.HttpMethod.Put, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/moderation/automod/settings?broadcaster_id={broadcasterId}&moderator_id={moderatorId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.UpdateShieldModeStatus.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.UpdateShieldModeStatus.g.verified.cs index e1234f42a2..e409eb125c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.UpdateShieldModeStatus.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.UpdateShieldModeStatus.g.verified.cs @@ -26,7 +26,7 @@ public partial class ModerationClient method: global::System.Net.Http.HttpMethod.Put, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/moderation/shield_mode?broadcaster_id={broadcasterId}&moderator_id={moderatorId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.g.verified.cs index cf4cfa92d0..1fa3ef852b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ModerationClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class ModerationClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the ModerationClient. @@ -21,10 +23,13 @@ public sealed partial class ModerationClient : global::System.IDisposable /// public ModerationClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PollsClient.CreatePoll.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PollsClient.CreatePoll.g.verified.cs index 2b121a5301..5a9ebd9f78 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PollsClient.CreatePoll.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PollsClient.CreatePoll.g.verified.cs @@ -22,7 +22,7 @@ public partial class PollsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/polls", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class PollsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PollsClient.EndPoll.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PollsClient.EndPoll.g.verified.cs index e544fa3631..18760fc140 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PollsClient.EndPoll.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PollsClient.EndPoll.g.verified.cs @@ -22,7 +22,7 @@ public partial class PollsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/polls", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class PollsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PollsClient.GetPolls.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PollsClient.GetPolls.g.verified.cs index f9c5c7630b..959c94c942 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PollsClient.GetPolls.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PollsClient.GetPolls.g.verified.cs @@ -36,7 +36,7 @@ public partial class PollsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PollsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PollsClient.g.verified.cs index 90b33519de..42d400f6b8 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PollsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PollsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class PollsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the PollsClient. @@ -21,10 +23,13 @@ public sealed partial class PollsClient : global::System.IDisposable /// public PollsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PredictionsClient.CreatePrediction.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PredictionsClient.CreatePrediction.g.verified.cs index dcd25d72dc..f07b273c23 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PredictionsClient.CreatePrediction.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PredictionsClient.CreatePrediction.g.verified.cs @@ -22,7 +22,7 @@ public partial class PredictionsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/predictions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class PredictionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PredictionsClient.EndPrediction.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PredictionsClient.EndPrediction.g.verified.cs index 7d0bdff0b4..07da171f79 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PredictionsClient.EndPrediction.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PredictionsClient.EndPrediction.g.verified.cs @@ -22,7 +22,7 @@ public partial class PredictionsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/predictions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class PredictionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PredictionsClient.GetPredictions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PredictionsClient.GetPredictions.g.verified.cs index b2911c0c39..c3f675c73d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PredictionsClient.GetPredictions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PredictionsClient.GetPredictions.g.verified.cs @@ -36,7 +36,7 @@ public partial class PredictionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PredictionsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PredictionsClient.g.verified.cs index 7c3c0c733e..8ea97a6496 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PredictionsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.PredictionsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class PredictionsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the PredictionsClient. @@ -21,10 +23,13 @@ public sealed partial class PredictionsClient : global::System.IDisposable /// public PredictionsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.RaidsClient.StartARaid.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.RaidsClient.StartARaid.g.verified.cs index 0332af824c..06666b7db6 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.RaidsClient.StartARaid.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.RaidsClient.StartARaid.g.verified.cs @@ -31,7 +31,7 @@ public partial class RaidsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.RaidsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.RaidsClient.g.verified.cs index b2d641de49..37535da83e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.RaidsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.RaidsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class RaidsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the RaidsClient. @@ -21,10 +23,13 @@ public sealed partial class RaidsClient : global::System.IDisposable /// public RaidsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ScheduleClient.CreateChannelStreamScheduleSegment.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ScheduleClient.CreateChannelStreamScheduleSegment.g.verified.cs index 0f31597f0e..4c7cc92d5b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ScheduleClient.CreateChannelStreamScheduleSegment.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ScheduleClient.CreateChannelStreamScheduleSegment.g.verified.cs @@ -24,7 +24,7 @@ public partial class ScheduleClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/schedule/segment?broadcaster_id={broadcasterId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class ScheduleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ScheduleClient.GetChannelStreamSchedule.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ScheduleClient.GetChannelStreamSchedule.g.verified.cs index 91fd569e6a..26e619eab7 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ScheduleClient.GetChannelStreamSchedule.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ScheduleClient.GetChannelStreamSchedule.g.verified.cs @@ -40,7 +40,7 @@ public partial class ScheduleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ScheduleClient.UpdateChannelStreamScheduleSegment.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ScheduleClient.UpdateChannelStreamScheduleSegment.g.verified.cs index 50d9c743c4..4a4e9623ae 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ScheduleClient.UpdateChannelStreamScheduleSegment.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ScheduleClient.UpdateChannelStreamScheduleSegment.g.verified.cs @@ -26,7 +26,7 @@ public partial class ScheduleClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/schedule/segment?broadcaster_id={broadcasterId}&id={id}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class ScheduleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ScheduleClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ScheduleClient.g.verified.cs index 33cd6d9693..f6792a521b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ScheduleClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.ScheduleClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class ScheduleClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the ScheduleClient. @@ -21,10 +23,13 @@ public sealed partial class ScheduleClient : global::System.IDisposable /// public ScheduleClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SearchClient.SearchCategories.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SearchClient.SearchCategories.g.verified.cs index 52a762c8ff..c5b555cb71 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SearchClient.SearchCategories.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SearchClient.SearchCategories.g.verified.cs @@ -33,7 +33,7 @@ public partial class SearchClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SearchClient.SearchChannels.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SearchClient.SearchChannels.g.verified.cs index 905d7aad09..b13d2ed61d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SearchClient.SearchChannels.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SearchClient.SearchChannels.g.verified.cs @@ -35,7 +35,7 @@ public partial class SearchClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SearchClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SearchClient.g.verified.cs index 758d751420..2b095e0dbb 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SearchClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SearchClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class SearchClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the SearchClient. @@ -21,10 +23,13 @@ public sealed partial class SearchClient : global::System.IDisposable /// public SearchClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.CreateStreamMarker.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.CreateStreamMarker.g.verified.cs index 7236afdfcd..5eb82e8709 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.CreateStreamMarker.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.CreateStreamMarker.g.verified.cs @@ -22,7 +22,7 @@ public partial class StreamsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/streams/markers", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class StreamsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.GetFollowedStreams.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.GetFollowedStreams.g.verified.cs index efe10f1c3b..ec2d77627e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.GetFollowedStreams.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.GetFollowedStreams.g.verified.cs @@ -33,7 +33,7 @@ public partial class StreamsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.GetStreamKey.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.GetStreamKey.g.verified.cs index 72ea287f16..9ec7dcc662 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.GetStreamKey.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.GetStreamKey.g.verified.cs @@ -29,7 +29,7 @@ public partial class StreamsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.GetStreamMarkers.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.GetStreamMarkers.g.verified.cs index 24b1f4ca9e..10da666382 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.GetStreamMarkers.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.GetStreamMarkers.g.verified.cs @@ -37,7 +37,7 @@ public partial class StreamsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.GetStreams.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.GetStreams.g.verified.cs index c9f02490b3..b431c4081b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.GetStreams.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.GetStreams.g.verified.cs @@ -50,7 +50,7 @@ public partial class StreamsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.g.verified.cs index 121e580754..23aab90018 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.StreamsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class StreamsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the StreamsClient. @@ -21,10 +23,13 @@ public sealed partial class StreamsClient : global::System.IDisposable /// public StreamsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SubscriptionsClient.CheckUserSubscription.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SubscriptionsClient.CheckUserSubscription.g.verified.cs index 20ec013675..eab9c48128 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SubscriptionsClient.CheckUserSubscription.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SubscriptionsClient.CheckUserSubscription.g.verified.cs @@ -31,7 +31,7 @@ public partial class SubscriptionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SubscriptionsClient.GetBroadcasterSubscriptions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SubscriptionsClient.GetBroadcasterSubscriptions.g.verified.cs index a76571fb3a..3a3e3e84be 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SubscriptionsClient.GetBroadcasterSubscriptions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SubscriptionsClient.GetBroadcasterSubscriptions.g.verified.cs @@ -38,7 +38,7 @@ public partial class SubscriptionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SubscriptionsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SubscriptionsClient.g.verified.cs index 76d6dea9ac..fa4a9a2864 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SubscriptionsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.SubscriptionsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class SubscriptionsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the SubscriptionsClient. @@ -21,10 +23,13 @@ public sealed partial class SubscriptionsClient : global::System.IDisposable /// public SubscriptionsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TagsClient.GetAllStreamTags.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TagsClient.GetAllStreamTags.g.verified.cs index 674bad8649..a038c697c9 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TagsClient.GetAllStreamTags.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TagsClient.GetAllStreamTags.g.verified.cs @@ -34,7 +34,7 @@ public partial class TagsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TagsClient.GetStreamTags.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TagsClient.GetStreamTags.g.verified.cs index fd550ce3be..8050406d43 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TagsClient.GetStreamTags.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TagsClient.GetStreamTags.g.verified.cs @@ -29,7 +29,7 @@ public partial class TagsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TagsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TagsClient.g.verified.cs index 3f056d29d2..cd09c42864 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TagsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TagsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class TagsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the TagsClient. @@ -21,10 +23,13 @@ public sealed partial class TagsClient : global::System.IDisposable /// public TagsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TeamsClient.GetChannelTeams.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TeamsClient.GetChannelTeams.g.verified.cs index 4fea1647fd..f6a729c863 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TeamsClient.GetChannelTeams.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TeamsClient.GetChannelTeams.g.verified.cs @@ -29,7 +29,7 @@ public partial class TeamsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TeamsClient.GetTeams.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TeamsClient.GetTeams.g.verified.cs index 68f6446f6a..e5c4f4d4b3 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TeamsClient.GetTeams.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TeamsClient.GetTeams.g.verified.cs @@ -31,7 +31,7 @@ public partial class TeamsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TeamsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TeamsClient.g.verified.cs index 85c48d3857..ba5d687c61 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TeamsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.TeamsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class TeamsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the TeamsClient. @@ -21,10 +23,13 @@ public sealed partial class TeamsClient : global::System.IDisposable /// public TeamsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.GetUserActiveExtensions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.GetUserActiveExtensions.g.verified.cs index 986436383c..70c4bdc287 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.GetUserActiveExtensions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.GetUserActiveExtensions.g.verified.cs @@ -29,7 +29,7 @@ public partial class UsersClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.GetUserBlockList.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.GetUserBlockList.g.verified.cs index 39134a84e8..fe5e8fc3c6 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.GetUserBlockList.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.GetUserBlockList.g.verified.cs @@ -33,7 +33,7 @@ public partial class UsersClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.GetUserExtensions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.GetUserExtensions.g.verified.cs index 98ad506a30..e6e3d1466f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.GetUserExtensions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.GetUserExtensions.g.verified.cs @@ -27,7 +27,7 @@ public partial class UsersClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.GetUsers.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.GetUsers.g.verified.cs index 360f39c9f8..09c120612c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.GetUsers.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.GetUsers.g.verified.cs @@ -32,7 +32,7 @@ public partial class UsersClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.UpdateUser.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.UpdateUser.g.verified.cs index a41a49bda1..38414ddd76 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.UpdateUser.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.UpdateUser.g.verified.cs @@ -29,7 +29,7 @@ public partial class UsersClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.UpdateUserExtensions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.UpdateUserExtensions.g.verified.cs index 690c41ad36..4695a194df 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.UpdateUserExtensions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.UpdateUserExtensions.g.verified.cs @@ -22,7 +22,7 @@ public partial class UsersClient method: global::System.Net.Http.HttpMethod.Put, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/users/extensions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class UsersClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.g.verified.cs index 138ec1190e..8b2ca56f7f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.UsersClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class UsersClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the UsersClient. @@ -21,10 +23,13 @@ public sealed partial class UsersClient : global::System.IDisposable /// public UsersClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.VideosClient.DeleteVideos.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.VideosClient.DeleteVideos.g.verified.cs index f595fbdc41..ee3b38c07a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.VideosClient.DeleteVideos.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.VideosClient.DeleteVideos.g.verified.cs @@ -30,7 +30,7 @@ public partial class VideosClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.VideosClient.GetVideos.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.VideosClient.GetVideos.g.verified.cs index 625cc1975a..8982afdc45 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.VideosClient.GetVideos.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.VideosClient.GetVideos.g.verified.cs @@ -71,7 +71,7 @@ public partial class VideosClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content) ?? + global::Newtonsoft.Json.JsonConvert.DeserializeObject(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.VideosClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.VideosClient.g.verified.cs index d03db7889c..ca0742a94c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.VideosClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.VideosClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class VideosClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the VideosClient. @@ -21,10 +23,13 @@ public sealed partial class VideosClient : global::System.IDisposable /// public VideosClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.WhispersClient.SendWhisper.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.WhispersClient.SendWhisper.g.verified.cs index 36c4798ce2..96be2c3246 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.WhispersClient.SendWhisper.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.WhispersClient.SendWhisper.g.verified.cs @@ -26,7 +26,7 @@ public partial class WhispersClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/whispers?from_user_id={fromUserId}&to_user_id={toUserId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request), + content: global::Newtonsoft.Json.JsonConvert.SerializeObject(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.WhispersClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.WhispersClient.g.verified.cs index d33418df32..2ec903a745 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.WhispersClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/NewtonsoftJson/_#G.WhispersClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class WhispersClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::Newtonsoft.Json.JsonSerializerSettings _jsonSerializerOptions; + /// /// Creates a new instance of the WhispersClient. @@ -21,10 +23,13 @@ public sealed partial class WhispersClient : global::System.IDisposable /// public WhispersClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::Newtonsoft.Json.JsonSerializerSettings? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::Newtonsoft.Json.JsonSerializerSettings(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AdsClient.GetAdSchedule.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AdsClient.GetAdSchedule.g.verified.cs index 3a0e44d55c..c5c09b0eb3 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AdsClient.GetAdSchedule.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AdsClient.GetAdSchedule.g.verified.cs @@ -29,7 +29,7 @@ public partial class AdsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AdsClient.SnoozeNextAd.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AdsClient.SnoozeNextAd.g.verified.cs index 9b933a507a..686137d2ee 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AdsClient.SnoozeNextAd.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AdsClient.SnoozeNextAd.g.verified.cs @@ -29,7 +29,7 @@ public partial class AdsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AdsClient.StartCommercial.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AdsClient.StartCommercial.g.verified.cs index d2f4b27b40..6ce7a5f224 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AdsClient.StartCommercial.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AdsClient.StartCommercial.g.verified.cs @@ -22,7 +22,7 @@ public partial class AdsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/channels/commercial", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class AdsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AdsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AdsClient.g.verified.cs index ef5e56670a..a62796eea8 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AdsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AdsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class AdsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the AdsClient. @@ -21,10 +23,13 @@ public sealed partial class AdsClient : global::System.IDisposable /// public AdsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AnalyticsClient.GetExtensionAnalytics.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AnalyticsClient.GetExtensionAnalytics.g.verified.cs index b9d148b502..292ee2e88b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AnalyticsClient.GetExtensionAnalytics.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AnalyticsClient.GetExtensionAnalytics.g.verified.cs @@ -39,7 +39,7 @@ public partial class AnalyticsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AnalyticsClient.GetGameAnalytics.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AnalyticsClient.GetGameAnalytics.g.verified.cs index 011ebb88b5..c06725fae1 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AnalyticsClient.GetGameAnalytics.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AnalyticsClient.GetGameAnalytics.g.verified.cs @@ -39,7 +39,7 @@ public partial class AnalyticsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AnalyticsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AnalyticsClient.g.verified.cs index 72f2d00fea..90d76df0e5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AnalyticsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.AnalyticsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class AnalyticsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the AnalyticsClient. @@ -21,10 +23,13 @@ public sealed partial class AnalyticsClient : global::System.IDisposable /// public AnalyticsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.Api.g.verified.cs index 6dbca9402c..8162ad2e78 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.Api.g.verified.cs @@ -20,156 +20,158 @@ namespace G public sealed partial class Api : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// /// - public AdsClient Ads => new AdsClient(_httpClient); + public AdsClient Ads => new AdsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public AnalyticsClient Analytics => new AnalyticsClient(_httpClient); + public AnalyticsClient Analytics => new AnalyticsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public BitsClient Bits => new BitsClient(_httpClient); + public BitsClient Bits => new BitsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public ChannelsClient Channels => new ChannelsClient(_httpClient); + public ChannelsClient Channels => new ChannelsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public ChannelPointsClient ChannelPoints => new ChannelPointsClient(_httpClient); + public ChannelPointsClient ChannelPoints => new ChannelPointsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public CharityClient Charity => new CharityClient(_httpClient); + public CharityClient Charity => new CharityClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public ChatClient Chat => new ChatClient(_httpClient); + public ChatClient Chat => new ChatClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public ClipsClient Clips => new ClipsClient(_httpClient); + public ClipsClient Clips => new ClipsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public ConduitsClient Conduits => new ConduitsClient(_httpClient); + public ConduitsClient Conduits => new ConduitsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public CCLsClient CCLs => new CCLsClient(_httpClient); + public CCLsClient CCLs => new CCLsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public EntitlementsClient Entitlements => new EntitlementsClient(_httpClient); + public EntitlementsClient Entitlements => new EntitlementsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public ExtensionsClient Extensions => new ExtensionsClient(_httpClient); + public ExtensionsClient Extensions => new ExtensionsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public EventSubClient EventSub => new EventSubClient(_httpClient); + public EventSubClient EventSub => new EventSubClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public GamesClient Games => new GamesClient(_httpClient); + public GamesClient Games => new GamesClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public GoalsClient Goals => new GoalsClient(_httpClient); + public GoalsClient Goals => new GoalsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public GuestStarClient GuestStar => new GuestStarClient(_httpClient); + public GuestStarClient GuestStar => new GuestStarClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public HypeTrainClient HypeTrain => new HypeTrainClient(_httpClient); + public HypeTrainClient HypeTrain => new HypeTrainClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public ModerationClient Moderation => new ModerationClient(_httpClient); + public ModerationClient Moderation => new ModerationClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public PollsClient Polls => new PollsClient(_httpClient); + public PollsClient Polls => new PollsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public PredictionsClient Predictions => new PredictionsClient(_httpClient); + public PredictionsClient Predictions => new PredictionsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public RaidsClient Raids => new RaidsClient(_httpClient); + public RaidsClient Raids => new RaidsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public ScheduleClient Schedule => new ScheduleClient(_httpClient); + public ScheduleClient Schedule => new ScheduleClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public SearchClient Search => new SearchClient(_httpClient); + public SearchClient Search => new SearchClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public StreamsClient Streams => new StreamsClient(_httpClient); + public StreamsClient Streams => new StreamsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public SubscriptionsClient Subscriptions => new SubscriptionsClient(_httpClient); + public SubscriptionsClient Subscriptions => new SubscriptionsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public TagsClient Tags => new TagsClient(_httpClient); + public TagsClient Tags => new TagsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public TeamsClient Teams => new TeamsClient(_httpClient); + public TeamsClient Teams => new TeamsClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public UsersClient Users => new UsersClient(_httpClient); + public UsersClient Users => new UsersClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public VideosClient Videos => new VideosClient(_httpClient); + public VideosClient Videos => new VideosClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// /// - public WhispersClient Whispers => new WhispersClient(_httpClient); + public WhispersClient Whispers => new WhispersClient(_httpClient, jsonSerializerOptions: _jsonSerializerOptions); /// /// Creates a new instance of the Api. @@ -180,10 +182,95 @@ public sealed partial class Api : global::System.IDisposable /// public Api( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = + { + new global::OpenApiGenerator.JsonConverters.CheermoteTiersIdJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CheermoteTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ExtensionTransactionProductDataCostTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ExtensionTransactionProductTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ModifyChannelInformationBodyContentClassificationLabelsIdJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CustomRewardRedemptionStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UpdateRedemptionStatusBodyStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChannelEmoteEmoteTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChannelEmoteFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChannelEmoteScaleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChannelEmoteThemeModeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GlobalEmoteFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GlobalEmoteScaleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GlobalEmoteThemeModeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EmoteEmoteTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EmoteFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EmoteScaleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EmoteThemeModeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetUserEmotesResponseDataEmoteTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.SendChatAnnouncementBodyColorJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetConduitShardsResponseDataTransportMethodJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetConduitShardsResponseDataStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UpdateConduitShardsBodyShardsTransportMethodJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UpdateConduitShardsResponseDataTransportMethodJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UpdateConduitShardsResponseDataStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DropsEntitlementFulfillmentStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UpdateDropsEntitlementsBodyFulfillmentStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DropsEntitlementUpdatedStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ExtensionConfigurationSegmentSegmentJsonConverter(), + new global::OpenApiGenerator.JsonConverters.SetExtensionConfigurationSegmentBodySegmentJsonConverter(), + new global::OpenApiGenerator.JsonConverters.SendExtensionPubSubMessageBodyTargetJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ExtensionConfigurationLocationJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ExtensionStateJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ExtensionSubscriptionsSupportLevelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ExtensionBitsProductCostTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UpdateExtensionBitsProductBodyCostTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateEventSubSubscriptionBodyTransportMethodJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateEventSubSubscriptionBodyTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EventSubSubscriptionTransportMethodJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EventSubSubscriptionStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EventSubSubscriptionTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreatorGoalTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetChannelGuestStarSettingsResponseGroupLayoutJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UpdateChannelGuestStarSettingsBodyGroupLayoutJsonConverter(), + new global::OpenApiGenerator.JsonConverters.HypeTrainEventEventDataLastContributionTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.HypeTrainEventEventDataTopContributionsTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ManageHeldAutoModMessagesBodyActionJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PollStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EndPollBodyStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PredictionOutcomeColorJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PredictionStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EndPredictionBodyStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.StreamTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.BroadcasterSubscriptionTierJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UserSubscriptionTierJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UserTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UserBroadcasterTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UserExtensionTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VideoTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetExtensionAnalyticsTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetGameAnalyticsTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetBitsLeaderboardPeriodJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetCustomRewardRedemptionStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetCustomRewardRedemptionSortJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UpdateUserChatColorColorJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetDropsEntitlementsFulfillmentStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetExtensionConfigurationSegmentSegmentJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetEventsubSubscriptionsStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetEventsubSubscriptionsTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetStreamsTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.BlockUserSourceContextJsonConverter(), + new global::OpenApiGenerator.JsonConverters.BlockUserReasonJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetVideosPeriodJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetVideosSortJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetVideosTypeJsonConverter(), + } + }; } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.BitsClient.GetBitsLeaderboard.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.BitsClient.GetBitsLeaderboard.g.verified.cs index 49fc733e72..7099a1e0cf 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.BitsClient.GetBitsLeaderboard.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.BitsClient.GetBitsLeaderboard.g.verified.cs @@ -35,7 +35,7 @@ public partial class BitsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.BitsClient.GetCheermotes.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.BitsClient.GetCheermotes.g.verified.cs index 3970a2d0fb..b7e5afd51f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.BitsClient.GetCheermotes.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.BitsClient.GetCheermotes.g.verified.cs @@ -29,7 +29,7 @@ public partial class BitsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.BitsClient.GetExtensionTransactions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.BitsClient.GetExtensionTransactions.g.verified.cs index 5251f988e3..a3113a573e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.BitsClient.GetExtensionTransactions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.BitsClient.GetExtensionTransactions.g.verified.cs @@ -36,7 +36,7 @@ public partial class BitsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.BitsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.BitsClient.g.verified.cs index 87433ce4b7..830209b222 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.BitsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.BitsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class BitsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the BitsClient. @@ -21,10 +23,13 @@ public sealed partial class BitsClient : global::System.IDisposable /// public BitsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CCLsClient.GetContentClassificationLabels.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CCLsClient.GetContentClassificationLabels.g.verified.cs index 3c163297b2..44e46dc70d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CCLsClient.GetContentClassificationLabels.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CCLsClient.GetContentClassificationLabels.g.verified.cs @@ -29,7 +29,7 @@ public partial class CCLsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CCLsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CCLsClient.g.verified.cs index 79ba7ecc62..01a854456e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CCLsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CCLsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class CCLsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the CCLsClient. @@ -21,10 +23,13 @@ public sealed partial class CCLsClient : global::System.IDisposable /// public CCLsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.CreateCustomRewards.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.CreateCustomRewards.g.verified.cs index fc0c64d130..ac03af153c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.CreateCustomRewards.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.CreateCustomRewards.g.verified.cs @@ -24,7 +24,7 @@ public partial class ChannelPointsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/channel_points/custom_rewards?broadcaster_id={broadcasterId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class ChannelPointsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.GetCustomReward.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.GetCustomReward.g.verified.cs index 8fee73986e..c50216dc47 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.GetCustomReward.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.GetCustomReward.g.verified.cs @@ -34,7 +34,7 @@ public partial class ChannelPointsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.GetCustomRewardRedemption.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.GetCustomRewardRedemption.g.verified.cs index e05358099f..dc589cc0b4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.GetCustomRewardRedemption.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.GetCustomRewardRedemption.g.verified.cs @@ -42,7 +42,7 @@ public partial class ChannelPointsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.UpdateCustomReward.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.UpdateCustomReward.g.verified.cs index 80900a25db..2061c96f68 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.UpdateCustomReward.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.UpdateCustomReward.g.verified.cs @@ -26,7 +26,7 @@ public partial class ChannelPointsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/channel_points/custom_rewards?broadcaster_id={broadcasterId}&id={id}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class ChannelPointsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.UpdateRedemptionStatus.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.UpdateRedemptionStatus.g.verified.cs index ed60f271f3..370db26f93 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.UpdateRedemptionStatus.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.UpdateRedemptionStatus.g.verified.cs @@ -29,7 +29,7 @@ public partial class ChannelPointsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/channel_points/custom_rewards/redemptions?{string.Join("&", id.Select(static x => $"id={x}"))}&broadcaster_id={broadcasterId}&reward_id={rewardId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -42,7 +42,7 @@ public partial class ChannelPointsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.g.verified.cs index 30d61df3a7..4984551272 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelPointsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class ChannelPointsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the ChannelPointsClient. @@ -21,10 +23,13 @@ public sealed partial class ChannelPointsClient : global::System.IDisposable /// public ChannelPointsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.GetChannelEditors.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.GetChannelEditors.g.verified.cs index 92839c0bd8..1f0ae36ee6 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.GetChannelEditors.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.GetChannelEditors.g.verified.cs @@ -29,7 +29,7 @@ public partial class ChannelsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.GetChannelFollowers.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.GetChannelFollowers.g.verified.cs index 9941958949..3626a4b706 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.GetChannelFollowers.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.GetChannelFollowers.g.verified.cs @@ -35,7 +35,7 @@ public partial class ChannelsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.GetChannelInformation.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.GetChannelInformation.g.verified.cs index 09294cd8d8..2ff755aec8 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.GetChannelInformation.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.GetChannelInformation.g.verified.cs @@ -30,7 +30,7 @@ public partial class ChannelsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.GetFollowedChannels.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.GetFollowedChannels.g.verified.cs index ae7bd082d6..db4f85e5ca 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.GetFollowedChannels.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.GetFollowedChannels.g.verified.cs @@ -35,7 +35,7 @@ public partial class ChannelsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.ModifyChannelInformation.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.ModifyChannelInformation.g.verified.cs index 4c50799582..9f4807d812 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.ModifyChannelInformation.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.ModifyChannelInformation.g.verified.cs @@ -24,7 +24,7 @@ public partial class ChannelsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/channels?broadcaster_id={broadcasterId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.g.verified.cs index 03a2c9568c..3b2d9fa9fe 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChannelsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class ChannelsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the ChannelsClient. @@ -21,10 +23,13 @@ public sealed partial class ChannelsClient : global::System.IDisposable /// public ChannelsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CharityClient.GetCharityCampaign.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CharityClient.GetCharityCampaign.g.verified.cs index 1ce0e337f2..ede9170124 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CharityClient.GetCharityCampaign.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CharityClient.GetCharityCampaign.g.verified.cs @@ -29,7 +29,7 @@ public partial class CharityClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CharityClient.GetCharityCampaignDonations.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CharityClient.GetCharityCampaignDonations.g.verified.cs index 6a56634f59..58bc731d8f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CharityClient.GetCharityCampaignDonations.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CharityClient.GetCharityCampaignDonations.g.verified.cs @@ -33,7 +33,7 @@ public partial class CharityClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CharityClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CharityClient.g.verified.cs index a47dade843..11f6b2cc18 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CharityClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.CharityClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class CharityClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the CharityClient. @@ -21,10 +23,13 @@ public sealed partial class CharityClient : global::System.IDisposable /// public CharityClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetChannelChatBadges.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetChannelChatBadges.g.verified.cs index 7582f549b5..49adbb3998 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetChannelChatBadges.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetChannelChatBadges.g.verified.cs @@ -29,7 +29,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetChannelEmotes.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetChannelEmotes.g.verified.cs index 7c4789de18..dad86cf3d2 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetChannelEmotes.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetChannelEmotes.g.verified.cs @@ -29,7 +29,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetChatSettings.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetChatSettings.g.verified.cs index c2df20b0b6..ba193b2c78 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetChatSettings.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetChatSettings.g.verified.cs @@ -31,7 +31,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetChatters.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetChatters.g.verified.cs index c198585943..ee14c30396 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetChatters.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetChatters.g.verified.cs @@ -35,7 +35,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetEmoteSets.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetEmoteSets.g.verified.cs index f720df1e4a..2d4104678f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetEmoteSets.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetEmoteSets.g.verified.cs @@ -30,7 +30,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetGlobalChatBadges.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetGlobalChatBadges.g.verified.cs index 9daffe4fd5..bf86acb906 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetGlobalChatBadges.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetGlobalChatBadges.g.verified.cs @@ -27,7 +27,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetGlobalEmotes.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetGlobalEmotes.g.verified.cs index 2b28732495..9aca9f1db9 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetGlobalEmotes.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetGlobalEmotes.g.verified.cs @@ -27,7 +27,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetUserChatColor.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetUserChatColor.g.verified.cs index 755da4ec26..440fbce5fe 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetUserChatColor.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetUserChatColor.g.verified.cs @@ -30,7 +30,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetUserEmotes.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetUserEmotes.g.verified.cs index 2e6c06fd26..ec805e7fd6 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetUserEmotes.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.GetUserEmotes.g.verified.cs @@ -33,7 +33,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.SendChatAnnouncement.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.SendChatAnnouncement.g.verified.cs index 00c14d8a66..c79a1aa225 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.SendChatAnnouncement.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.SendChatAnnouncement.g.verified.cs @@ -26,7 +26,7 @@ public partial class ChatClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/chat/announcements?broadcaster_id={broadcasterId}&moderator_id={moderatorId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.SendChatMessage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.SendChatMessage.g.verified.cs index fce68154ab..9146c2c428 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.SendChatMessage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.SendChatMessage.g.verified.cs @@ -22,7 +22,7 @@ public partial class ChatClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/chat/messages", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.UpdateChatSettings.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.UpdateChatSettings.g.verified.cs index d2ff97e43a..ae007aba83 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.UpdateChatSettings.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.UpdateChatSettings.g.verified.cs @@ -26,7 +26,7 @@ public partial class ChatClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/chat/settings?broadcaster_id={broadcasterId}&moderator_id={moderatorId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class ChatClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.g.verified.cs index 590012bb60..edd9ff28ea 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ChatClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class ChatClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the ChatClient. @@ -21,10 +23,13 @@ public sealed partial class ChatClient : global::System.IDisposable /// public ChatClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ClipsClient.CreateClip.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ClipsClient.CreateClip.g.verified.cs index b2c229fd05..e950c05d0f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ClipsClient.CreateClip.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ClipsClient.CreateClip.g.verified.cs @@ -31,7 +31,7 @@ public partial class ClipsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ClipsClient.GetClips.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ClipsClient.GetClips.g.verified.cs index c04e3d395c..7645504744 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ClipsClient.GetClips.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ClipsClient.GetClips.g.verified.cs @@ -46,7 +46,7 @@ public partial class ClipsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ClipsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ClipsClient.g.verified.cs index f7f53768ba..6d227c720b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ClipsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ClipsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class ClipsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the ClipsClient. @@ -21,10 +23,13 @@ public sealed partial class ClipsClient : global::System.IDisposable /// public ClipsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.CreateConduits.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.CreateConduits.g.verified.cs index 4fe2f6b801..d6b34a6dbc 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.CreateConduits.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.CreateConduits.g.verified.cs @@ -22,7 +22,7 @@ public partial class ConduitsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/eventsub/conduits", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ConduitsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.GetConduitShards.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.GetConduitShards.g.verified.cs index 6b9811915f..4c2dad279f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.GetConduitShards.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.GetConduitShards.g.verified.cs @@ -33,7 +33,7 @@ public partial class ConduitsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.GetConduits.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.GetConduits.g.verified.cs index 00a986a4b8..565ca6b313 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.GetConduits.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.GetConduits.g.verified.cs @@ -27,7 +27,7 @@ public partial class ConduitsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.UpdateConduitShards.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.UpdateConduitShards.g.verified.cs index f56e490d36..46bdc5d95c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.UpdateConduitShards.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.UpdateConduitShards.g.verified.cs @@ -22,7 +22,7 @@ public partial class ConduitsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/eventsub/conduits/shards", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ConduitsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.UpdateConduits.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.UpdateConduits.g.verified.cs index e60b880737..f63c961330 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.UpdateConduits.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.UpdateConduits.g.verified.cs @@ -22,7 +22,7 @@ public partial class ConduitsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/eventsub/conduits", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ConduitsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.g.verified.cs index b76e678622..2e77dcac8a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ConduitsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class ConduitsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the ConduitsClient. @@ -21,10 +23,13 @@ public sealed partial class ConduitsClient : global::System.IDisposable /// public ConduitsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EntitlementsClient.GetDropsEntitlements.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EntitlementsClient.GetDropsEntitlements.g.verified.cs index c803f278fe..62b8ffe933 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EntitlementsClient.GetDropsEntitlements.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EntitlementsClient.GetDropsEntitlements.g.verified.cs @@ -40,7 +40,7 @@ public partial class EntitlementsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EntitlementsClient.UpdateDropsEntitlements.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EntitlementsClient.UpdateDropsEntitlements.g.verified.cs index 1c372e0112..8ac2ae7e1d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EntitlementsClient.UpdateDropsEntitlements.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EntitlementsClient.UpdateDropsEntitlements.g.verified.cs @@ -22,7 +22,7 @@ public partial class EntitlementsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/entitlements/drops", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class EntitlementsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EntitlementsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EntitlementsClient.g.verified.cs index 5be704b743..8556356940 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EntitlementsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EntitlementsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class EntitlementsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the EntitlementsClient. @@ -21,10 +23,13 @@ public sealed partial class EntitlementsClient : global::System.IDisposable /// public EntitlementsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EventSubClient.CreateEventsubSubscription.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EventSubClient.CreateEventsubSubscription.g.verified.cs index 8d0969037d..317298a3b7 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EventSubClient.CreateEventsubSubscription.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EventSubClient.CreateEventsubSubscription.g.verified.cs @@ -22,7 +22,7 @@ public partial class EventSubClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/eventsub/subscriptions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class EventSubClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EventSubClient.GetEventsubSubscriptions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EventSubClient.GetEventsubSubscriptions.g.verified.cs index 97f45d43ba..7fcd097822 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EventSubClient.GetEventsubSubscriptions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EventSubClient.GetEventsubSubscriptions.g.verified.cs @@ -35,7 +35,7 @@ public partial class EventSubClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EventSubClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EventSubClient.g.verified.cs index e1665fac02..8fcba21f50 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EventSubClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.EventSubClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class EventSubClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the EventSubClient. @@ -21,10 +23,13 @@ public sealed partial class EventSubClient : global::System.IDisposable /// public EventSubClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.CreateExtensionSecret.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.CreateExtensionSecret.g.verified.cs index 6f8bb189ed..a63ef73c20 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.CreateExtensionSecret.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.CreateExtensionSecret.g.verified.cs @@ -31,7 +31,7 @@ public partial class ExtensionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensionBitsProducts.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensionBitsProducts.g.verified.cs index 703b3b10b8..25bdf85ae1 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensionBitsProducts.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensionBitsProducts.g.verified.cs @@ -29,7 +29,7 @@ public partial class ExtensionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensionConfigurationSegment.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensionConfigurationSegment.g.verified.cs index be87580c0f..9a1f3cb5a6 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensionConfigurationSegment.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensionConfigurationSegment.g.verified.cs @@ -33,7 +33,7 @@ public partial class ExtensionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensionLiveChannels.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensionLiveChannels.g.verified.cs index e632dffca0..91017bc6d6 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensionLiveChannels.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensionLiveChannels.g.verified.cs @@ -33,7 +33,7 @@ public partial class ExtensionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensionSecrets.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensionSecrets.g.verified.cs index f3401b031d..c8594a6008 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensionSecrets.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensionSecrets.g.verified.cs @@ -27,7 +27,7 @@ public partial class ExtensionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensions.g.verified.cs index e3b2a0c397..bec991ba60 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetExtensions.g.verified.cs @@ -31,7 +31,7 @@ public partial class ExtensionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetReleasedExtensions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetReleasedExtensions.g.verified.cs index 8799677165..bc6a4f87b9 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetReleasedExtensions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.GetReleasedExtensions.g.verified.cs @@ -31,7 +31,7 @@ public partial class ExtensionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.SendExtensionChatMessage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.SendExtensionChatMessage.g.verified.cs index b754fc19f5..4df8d6aa71 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.SendExtensionChatMessage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.SendExtensionChatMessage.g.verified.cs @@ -24,7 +24,7 @@ public partial class ExtensionsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/extensions/chat?broadcaster_id={broadcasterId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.SendExtensionPubsubMessage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.SendExtensionPubsubMessage.g.verified.cs index f00d0b1721..99be46255a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.SendExtensionPubsubMessage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.SendExtensionPubsubMessage.g.verified.cs @@ -22,7 +22,7 @@ public partial class ExtensionsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/extensions/pubsub", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.SetExtensionConfigurationSegment.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.SetExtensionConfigurationSegment.g.verified.cs index 704beb9d1a..7f3c08c9d9 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.SetExtensionConfigurationSegment.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.SetExtensionConfigurationSegment.g.verified.cs @@ -22,7 +22,7 @@ public partial class ExtensionsClient method: global::System.Net.Http.HttpMethod.Put, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/extensions/configurations", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.SetExtensionRequiredConfiguration.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.SetExtensionRequiredConfiguration.g.verified.cs index 725b298922..ee43eb031f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.SetExtensionRequiredConfiguration.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.SetExtensionRequiredConfiguration.g.verified.cs @@ -24,7 +24,7 @@ public partial class ExtensionsClient method: global::System.Net.Http.HttpMethod.Put, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/extensions/required_configuration?broadcaster_id={broadcasterId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.UpdateExtensionBitsProduct.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.UpdateExtensionBitsProduct.g.verified.cs index 0e5913c9c9..2ee21d17e2 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.UpdateExtensionBitsProduct.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.UpdateExtensionBitsProduct.g.verified.cs @@ -22,7 +22,7 @@ public partial class ExtensionsClient method: global::System.Net.Http.HttpMethod.Put, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/bits/extensions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class ExtensionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.g.verified.cs index 2f05ae1328..ab13263900 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ExtensionsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class ExtensionsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the ExtensionsClient. @@ -21,10 +23,13 @@ public sealed partial class ExtensionsClient : global::System.IDisposable /// public ExtensionsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GamesClient.GetGames.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GamesClient.GetGames.g.verified.cs index e9746a5269..37143be2b4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GamesClient.GetGames.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GamesClient.GetGames.g.verified.cs @@ -34,7 +34,7 @@ public partial class GamesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GamesClient.GetTopGames.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GamesClient.GetTopGames.g.verified.cs index 327706c0d6..60d198de9a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GamesClient.GetTopGames.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GamesClient.GetTopGames.g.verified.cs @@ -33,7 +33,7 @@ public partial class GamesClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GamesClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GamesClient.g.verified.cs index 3e954b0164..3f5742b8d0 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GamesClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GamesClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class GamesClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the GamesClient. @@ -21,10 +23,13 @@ public sealed partial class GamesClient : global::System.IDisposable /// public GamesClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GoalsClient.GetCreatorGoals.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GoalsClient.GetCreatorGoals.g.verified.cs index 563fce236f..dac56c1cc6 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GoalsClient.GetCreatorGoals.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GoalsClient.GetCreatorGoals.g.verified.cs @@ -29,7 +29,7 @@ public partial class GoalsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GoalsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GoalsClient.g.verified.cs index 0746b4a64f..b34bc52f17 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GoalsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GoalsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class GoalsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the GoalsClient. @@ -21,10 +23,13 @@ public sealed partial class GoalsClient : global::System.IDisposable /// public GoalsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.CreateGuestStarSession.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.CreateGuestStarSession.g.verified.cs index b9b4b9469f..713d1b4485 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.CreateGuestStarSession.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.CreateGuestStarSession.g.verified.cs @@ -29,7 +29,7 @@ public partial class GuestStarClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.GetChannelGuestStarSettings.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.GetChannelGuestStarSettings.g.verified.cs index 11987805dc..b6d845924a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.GetChannelGuestStarSettings.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.GetChannelGuestStarSettings.g.verified.cs @@ -31,7 +31,7 @@ public partial class GuestStarClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.GetGuestStarInvites.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.GetGuestStarInvites.g.verified.cs index 8f4ff07782..e58c25baa9 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.GetGuestStarInvites.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.GetGuestStarInvites.g.verified.cs @@ -33,7 +33,7 @@ public partial class GuestStarClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.GetGuestStarSession.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.GetGuestStarSession.g.verified.cs index eb1755cb40..e39bf3d288 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.GetGuestStarSession.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.GetGuestStarSession.g.verified.cs @@ -31,7 +31,7 @@ public partial class GuestStarClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.UpdateChannelGuestStarSettings.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.UpdateChannelGuestStarSettings.g.verified.cs index bd884b711e..58743850b6 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.UpdateChannelGuestStarSettings.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.UpdateChannelGuestStarSettings.g.verified.cs @@ -24,7 +24,7 @@ public partial class GuestStarClient method: global::System.Net.Http.HttpMethod.Put, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/guest_star/channel_settings?broadcaster_id={broadcasterId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.g.verified.cs index 6e9e5a9ddd..989c12225c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.GuestStarClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class GuestStarClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the GuestStarClient. @@ -21,10 +23,13 @@ public sealed partial class GuestStarClient : global::System.IDisposable /// public GuestStarClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.HypeTrainClient.GetHypeTrainEvents.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.HypeTrainClient.GetHypeTrainEvents.g.verified.cs index 9fd11fc12b..8afe317d10 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.HypeTrainClient.GetHypeTrainEvents.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.HypeTrainClient.GetHypeTrainEvents.g.verified.cs @@ -33,7 +33,7 @@ public partial class HypeTrainClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.HypeTrainClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.HypeTrainClient.g.verified.cs index 004bad6924..8c7d9fe644 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.HypeTrainClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.HypeTrainClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class HypeTrainClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the HypeTrainClient. @@ -21,10 +23,13 @@ public sealed partial class HypeTrainClient : global::System.IDisposable /// public HypeTrainClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.AddBlockedTerm.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.AddBlockedTerm.g.verified.cs index 0c1057de17..15f743a130 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.AddBlockedTerm.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.AddBlockedTerm.g.verified.cs @@ -26,7 +26,7 @@ public partial class ModerationClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/moderation/blocked_terms?broadcaster_id={broadcasterId}&moderator_id={moderatorId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.BanUser.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.BanUser.g.verified.cs index 254f0543ec..67e3a7e167 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.BanUser.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.BanUser.g.verified.cs @@ -26,7 +26,7 @@ public partial class ModerationClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/moderation/bans?broadcaster_id={broadcasterId}&moderator_id={moderatorId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.CheckAutomodStatus.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.CheckAutomodStatus.g.verified.cs index 20954341e9..df2f76a4a2 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.CheckAutomodStatus.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.CheckAutomodStatus.g.verified.cs @@ -24,7 +24,7 @@ public partial class ModerationClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/moderation/enforcements/status?broadcaster_id={broadcasterId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetAutomodSettings.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetAutomodSettings.g.verified.cs index e73aa61824..5916449dec 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetAutomodSettings.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetAutomodSettings.g.verified.cs @@ -31,7 +31,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetBannedUsers.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetBannedUsers.g.verified.cs index a38aa88282..5a825e5d5d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetBannedUsers.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetBannedUsers.g.verified.cs @@ -38,7 +38,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetBlockedTerms.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetBlockedTerms.g.verified.cs index f186b9b828..b6b55df7ef 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetBlockedTerms.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetBlockedTerms.g.verified.cs @@ -35,7 +35,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetModeratedChannels.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetModeratedChannels.g.verified.cs index 0435cd9aa6..4526d00f13 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetModeratedChannels.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetModeratedChannels.g.verified.cs @@ -33,7 +33,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetModerators.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetModerators.g.verified.cs index ad109e5461..5fe7ca9adc 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetModerators.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetModerators.g.verified.cs @@ -36,7 +36,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetShieldModeStatus.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetShieldModeStatus.g.verified.cs index f96f8b752d..d1eb6e6ca3 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetShieldModeStatus.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetShieldModeStatus.g.verified.cs @@ -31,7 +31,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetUnbanRequests.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetUnbanRequests.g.verified.cs index 7273687a14..ceedf375e0 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetUnbanRequests.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetUnbanRequests.g.verified.cs @@ -39,7 +39,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetVips.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetVips.g.verified.cs index 174ba54466..1f0e6479fc 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetVips.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.GetVips.g.verified.cs @@ -36,7 +36,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.ManageHeldAutomodMessages.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.ManageHeldAutomodMessages.g.verified.cs index 4079175dfd..d4c82ffee9 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.ManageHeldAutomodMessages.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.ManageHeldAutomodMessages.g.verified.cs @@ -22,7 +22,7 @@ public partial class ModerationClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/moderation/automod/message", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.ResolveUnbanRequests.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.ResolveUnbanRequests.g.verified.cs index d70487fc35..e13ae03095 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.ResolveUnbanRequests.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.ResolveUnbanRequests.g.verified.cs @@ -37,7 +37,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.UpdateAutomodSettings.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.UpdateAutomodSettings.g.verified.cs index 28367e4790..fa93efad3f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.UpdateAutomodSettings.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.UpdateAutomodSettings.g.verified.cs @@ -26,7 +26,7 @@ public partial class ModerationClient method: global::System.Net.Http.HttpMethod.Put, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/moderation/automod/settings?broadcaster_id={broadcasterId}&moderator_id={moderatorId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.UpdateShieldModeStatus.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.UpdateShieldModeStatus.g.verified.cs index aa1bd961f4..b68e07676d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.UpdateShieldModeStatus.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.UpdateShieldModeStatus.g.verified.cs @@ -26,7 +26,7 @@ public partial class ModerationClient method: global::System.Net.Http.HttpMethod.Put, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/moderation/shield_mode?broadcaster_id={broadcasterId}&moderator_id={moderatorId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class ModerationClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.g.verified.cs index cf4cfa92d0..0e997b0919 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ModerationClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class ModerationClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the ModerationClient. @@ -21,10 +23,13 @@ public sealed partial class ModerationClient : global::System.IDisposable /// public ModerationClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PollsClient.CreatePoll.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PollsClient.CreatePoll.g.verified.cs index 5bee170805..abbbf60e55 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PollsClient.CreatePoll.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PollsClient.CreatePoll.g.verified.cs @@ -22,7 +22,7 @@ public partial class PollsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/polls", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class PollsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PollsClient.EndPoll.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PollsClient.EndPoll.g.verified.cs index ebe24302ab..2a14381151 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PollsClient.EndPoll.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PollsClient.EndPoll.g.verified.cs @@ -22,7 +22,7 @@ public partial class PollsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/polls", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class PollsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PollsClient.GetPolls.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PollsClient.GetPolls.g.verified.cs index 9fc33c99d9..4a2a3b6d26 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PollsClient.GetPolls.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PollsClient.GetPolls.g.verified.cs @@ -36,7 +36,7 @@ public partial class PollsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PollsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PollsClient.g.verified.cs index 90b33519de..785caa7e19 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PollsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PollsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class PollsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the PollsClient. @@ -21,10 +23,13 @@ public sealed partial class PollsClient : global::System.IDisposable /// public PollsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PredictionsClient.CreatePrediction.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PredictionsClient.CreatePrediction.g.verified.cs index fd392b2300..da16e1aa07 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PredictionsClient.CreatePrediction.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PredictionsClient.CreatePrediction.g.verified.cs @@ -22,7 +22,7 @@ public partial class PredictionsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/predictions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class PredictionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PredictionsClient.EndPrediction.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PredictionsClient.EndPrediction.g.verified.cs index daa7df5c0a..3c07696ea8 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PredictionsClient.EndPrediction.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PredictionsClient.EndPrediction.g.verified.cs @@ -22,7 +22,7 @@ public partial class PredictionsClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/predictions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class PredictionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PredictionsClient.GetPredictions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PredictionsClient.GetPredictions.g.verified.cs index 2af9a286ed..62827e4c33 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PredictionsClient.GetPredictions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PredictionsClient.GetPredictions.g.verified.cs @@ -36,7 +36,7 @@ public partial class PredictionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PredictionsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PredictionsClient.g.verified.cs index 7c3c0c733e..551626a1cd 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PredictionsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.PredictionsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class PredictionsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the PredictionsClient. @@ -21,10 +23,13 @@ public sealed partial class PredictionsClient : global::System.IDisposable /// public PredictionsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.RaidsClient.StartARaid.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.RaidsClient.StartARaid.g.verified.cs index 11c02bdf86..de62a57d3f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.RaidsClient.StartARaid.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.RaidsClient.StartARaid.g.verified.cs @@ -31,7 +31,7 @@ public partial class RaidsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.RaidsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.RaidsClient.g.verified.cs index b2d641de49..f6dba4b848 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.RaidsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.RaidsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class RaidsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the RaidsClient. @@ -21,10 +23,13 @@ public sealed partial class RaidsClient : global::System.IDisposable /// public RaidsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ScheduleClient.CreateChannelStreamScheduleSegment.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ScheduleClient.CreateChannelStreamScheduleSegment.g.verified.cs index 2668b09e2a..d4ea1945c0 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ScheduleClient.CreateChannelStreamScheduleSegment.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ScheduleClient.CreateChannelStreamScheduleSegment.g.verified.cs @@ -24,7 +24,7 @@ public partial class ScheduleClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/schedule/segment?broadcaster_id={broadcasterId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -37,7 +37,7 @@ public partial class ScheduleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ScheduleClient.GetChannelStreamSchedule.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ScheduleClient.GetChannelStreamSchedule.g.verified.cs index e80fabee93..9589b30723 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ScheduleClient.GetChannelStreamSchedule.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ScheduleClient.GetChannelStreamSchedule.g.verified.cs @@ -40,7 +40,7 @@ public partial class ScheduleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ScheduleClient.UpdateChannelStreamScheduleSegment.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ScheduleClient.UpdateChannelStreamScheduleSegment.g.verified.cs index 305cbfb2a9..67eff38cea 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ScheduleClient.UpdateChannelStreamScheduleSegment.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ScheduleClient.UpdateChannelStreamScheduleSegment.g.verified.cs @@ -26,7 +26,7 @@ public partial class ScheduleClient method: global::System.Net.Http.HttpMethod.Patch, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/schedule/segment?broadcaster_id={broadcasterId}&id={id}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -39,7 +39,7 @@ public partial class ScheduleClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ScheduleClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ScheduleClient.g.verified.cs index 33cd6d9693..e5a1c1b5a9 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ScheduleClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.ScheduleClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class ScheduleClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the ScheduleClient. @@ -21,10 +23,13 @@ public sealed partial class ScheduleClient : global::System.IDisposable /// public ScheduleClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SearchClient.SearchCategories.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SearchClient.SearchCategories.g.verified.cs index ce417cfd9a..a5d28936c8 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SearchClient.SearchCategories.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SearchClient.SearchCategories.g.verified.cs @@ -33,7 +33,7 @@ public partial class SearchClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SearchClient.SearchChannels.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SearchClient.SearchChannels.g.verified.cs index 10c80527d2..c0de4bdc15 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SearchClient.SearchChannels.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SearchClient.SearchChannels.g.verified.cs @@ -35,7 +35,7 @@ public partial class SearchClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SearchClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SearchClient.g.verified.cs index 758d751420..0845f4fda0 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SearchClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SearchClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class SearchClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the SearchClient. @@ -21,10 +23,13 @@ public sealed partial class SearchClient : global::System.IDisposable /// public SearchClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.CreateStreamMarker.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.CreateStreamMarker.g.verified.cs index 27b718e4e5..bfe1defcc9 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.CreateStreamMarker.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.CreateStreamMarker.g.verified.cs @@ -22,7 +22,7 @@ public partial class StreamsClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/streams/markers", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class StreamsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.GetFollowedStreams.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.GetFollowedStreams.g.verified.cs index 139a619644..2c5e113606 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.GetFollowedStreams.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.GetFollowedStreams.g.verified.cs @@ -33,7 +33,7 @@ public partial class StreamsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.GetStreamKey.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.GetStreamKey.g.verified.cs index 542284b34d..32299a66ca 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.GetStreamKey.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.GetStreamKey.g.verified.cs @@ -29,7 +29,7 @@ public partial class StreamsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.GetStreamMarkers.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.GetStreamMarkers.g.verified.cs index 31df737dcd..76ce7b1143 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.GetStreamMarkers.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.GetStreamMarkers.g.verified.cs @@ -37,7 +37,7 @@ public partial class StreamsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.GetStreams.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.GetStreams.g.verified.cs index 9de8993127..0d5efe579c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.GetStreams.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.GetStreams.g.verified.cs @@ -44,7 +44,7 @@ public partial class StreamsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.g.verified.cs index 121e580754..de5978fcba 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.StreamsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class StreamsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the StreamsClient. @@ -21,10 +23,13 @@ public sealed partial class StreamsClient : global::System.IDisposable /// public StreamsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SubscriptionsClient.CheckUserSubscription.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SubscriptionsClient.CheckUserSubscription.g.verified.cs index 790561381d..ad3a2a11a8 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SubscriptionsClient.CheckUserSubscription.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SubscriptionsClient.CheckUserSubscription.g.verified.cs @@ -31,7 +31,7 @@ public partial class SubscriptionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SubscriptionsClient.GetBroadcasterSubscriptions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SubscriptionsClient.GetBroadcasterSubscriptions.g.verified.cs index 29834d81e9..aa43d1687e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SubscriptionsClient.GetBroadcasterSubscriptions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SubscriptionsClient.GetBroadcasterSubscriptions.g.verified.cs @@ -38,7 +38,7 @@ public partial class SubscriptionsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SubscriptionsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SubscriptionsClient.g.verified.cs index 76d6dea9ac..dc4ceaa12f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SubscriptionsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.SubscriptionsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class SubscriptionsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the SubscriptionsClient. @@ -21,10 +23,13 @@ public sealed partial class SubscriptionsClient : global::System.IDisposable /// public SubscriptionsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TagsClient.GetAllStreamTags.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TagsClient.GetAllStreamTags.g.verified.cs index 386e5f110d..d41611dffd 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TagsClient.GetAllStreamTags.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TagsClient.GetAllStreamTags.g.verified.cs @@ -34,7 +34,7 @@ public partial class TagsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TagsClient.GetStreamTags.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TagsClient.GetStreamTags.g.verified.cs index 2c95db8e7c..eff4fc27f7 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TagsClient.GetStreamTags.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TagsClient.GetStreamTags.g.verified.cs @@ -29,7 +29,7 @@ public partial class TagsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TagsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TagsClient.g.verified.cs index 3f056d29d2..324fc7a14f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TagsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TagsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class TagsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the TagsClient. @@ -21,10 +23,13 @@ public sealed partial class TagsClient : global::System.IDisposable /// public TagsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TeamsClient.GetChannelTeams.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TeamsClient.GetChannelTeams.g.verified.cs index ce43563de4..75f317a0ce 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TeamsClient.GetChannelTeams.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TeamsClient.GetChannelTeams.g.verified.cs @@ -29,7 +29,7 @@ public partial class TeamsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TeamsClient.GetTeams.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TeamsClient.GetTeams.g.verified.cs index 33cf16887b..16a5e65a5d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TeamsClient.GetTeams.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TeamsClient.GetTeams.g.verified.cs @@ -31,7 +31,7 @@ public partial class TeamsClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TeamsClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TeamsClient.g.verified.cs index 85c48d3857..5685a337a1 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TeamsClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.TeamsClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class TeamsClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the TeamsClient. @@ -21,10 +23,13 @@ public sealed partial class TeamsClient : global::System.IDisposable /// public TeamsClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.GetUserActiveExtensions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.GetUserActiveExtensions.g.verified.cs index bee94fecd7..dd6413041e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.GetUserActiveExtensions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.GetUserActiveExtensions.g.verified.cs @@ -29,7 +29,7 @@ public partial class UsersClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.GetUserBlockList.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.GetUserBlockList.g.verified.cs index 9c5fe72751..c82253613c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.GetUserBlockList.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.GetUserBlockList.g.verified.cs @@ -33,7 +33,7 @@ public partial class UsersClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.GetUserExtensions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.GetUserExtensions.g.verified.cs index 1ac1ff3274..406e69bb83 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.GetUserExtensions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.GetUserExtensions.g.verified.cs @@ -27,7 +27,7 @@ public partial class UsersClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.GetUsers.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.GetUsers.g.verified.cs index 90543bd501..9871588a38 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.GetUsers.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.GetUsers.g.verified.cs @@ -32,7 +32,7 @@ public partial class UsersClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.UpdateUser.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.UpdateUser.g.verified.cs index d63b1ef2cf..d0077d5a82 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.UpdateUser.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.UpdateUser.g.verified.cs @@ -29,7 +29,7 @@ public partial class UsersClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.UpdateUserExtensions.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.UpdateUserExtensions.g.verified.cs index a95f858aad..3a824a9bad 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.UpdateUserExtensions.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.UpdateUserExtensions.g.verified.cs @@ -22,7 +22,7 @@ public partial class UsersClient method: global::System.Net.Http.HttpMethod.Put, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + "/users/extensions", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); @@ -35,7 +35,7 @@ public partial class UsersClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.g.verified.cs index 138ec1190e..dbb3ad4878 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.UsersClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class UsersClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the UsersClient. @@ -21,10 +23,13 @@ public sealed partial class UsersClient : global::System.IDisposable /// public UsersClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.VideosClient.DeleteVideos.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.VideosClient.DeleteVideos.g.verified.cs index 55b6d68409..eb4b4faf58 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.VideosClient.DeleteVideos.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.VideosClient.DeleteVideos.g.verified.cs @@ -30,7 +30,7 @@ public partial class VideosClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.VideosClient.GetVideos.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.VideosClient.GetVideos.g.verified.cs index 1a3a959400..4ed6a5059d 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.VideosClient.GetVideos.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.VideosClient.GetVideos.g.verified.cs @@ -48,7 +48,7 @@ public partial class VideosClient var __content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); return - global::System.Text.Json.JsonSerializer.Deserialize(__content) ?? + global::System.Text.Json.JsonSerializer.Deserialize(__content, _jsonSerializerOptions) ?? throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.VideosClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.VideosClient.g.verified.cs index d03db7889c..cad1b9416a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.VideosClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.VideosClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class VideosClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the VideosClient. @@ -21,10 +23,13 @@ public sealed partial class VideosClient : global::System.IDisposable /// public VideosClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.WhispersClient.SendWhisper.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.WhispersClient.SendWhisper.g.verified.cs index 9bf8a4cef7..d6ef6cf12a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.WhispersClient.SendWhisper.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.WhispersClient.SendWhisper.g.verified.cs @@ -26,7 +26,7 @@ public partial class WhispersClient method: global::System.Net.Http.HttpMethod.Post, requestUri: new global::System.Uri(_httpClient.BaseAddress?.AbsoluteUri + $"/whispers?from_user_id={fromUserId}&to_user_id={toUserId}", global::System.UriKind.RelativeOrAbsolute)); httpRequest.Content = new global::System.Net.Http.StringContent( - content: global::System.Text.Json.JsonSerializer.Serialize(request), + content: global::System.Text.Json.JsonSerializer.Serialize(request, _jsonSerializerOptions), encoding: global::System.Text.Encoding.UTF8, mediaType: "application/json"); diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.WhispersClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.WhispersClient.g.verified.cs index d33418df32..19cb7f3db4 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.WhispersClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.WhispersClient.g.verified.cs @@ -11,6 +11,8 @@ namespace G public sealed partial class WhispersClient : global::System.IDisposable { private readonly global::System.Net.Http.HttpClient _httpClient; + private readonly global::System.Text.Json.JsonSerializerOptions _jsonSerializerOptions; + /// /// Creates a new instance of the WhispersClient. @@ -21,10 +23,13 @@ public sealed partial class WhispersClient : global::System.IDisposable /// public WhispersClient( global::System.Net.Http.HttpClient? httpClient = null, - global::System.Uri? baseUri = null) + global::System.Uri? baseUri = null, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null + ) { _httpClient = httpClient ?? new global::System.Net.Http.HttpClient(); _httpClient.BaseAddress ??= baseUri ?? new global::System.Uri("https://api.twitch.tv/helix"); + _jsonSerializerOptions = _jsonSerializerOptions ?? new global::System.Text.Json.JsonSerializerOptions(); } /// diff --git a/src/tests/OpenApiGenerator.UnitTests/JsonTests.Enum.AnyOf.cs b/src/tests/OpenApiGenerator.UnitTests/JsonTests.Enum.AnyOf.cs index 1f72666e6f..e132eeb802 100644 --- a/src/tests/OpenApiGenerator.UnitTests/JsonTests.Enum.AnyOf.cs +++ b/src/tests/OpenApiGenerator.UnitTests/JsonTests.Enum.AnyOf.cs @@ -10,42 +10,68 @@ public partial class JsonTests public void Enum2_AnyOfStringAndEnum_SystemTextJson_String() { const string json = "{\"status\":\"pulling 797b70c4edf8\",\"digest\":\"sha256:797b70c4edf85907fe0a49eb85811256f65fa0f7bf52166b147fd16be2be4662\",\"total\":45949216}"; - var response = JsonSerializer.Deserialize(json); response.Should().NotBeNull(); response!.Status.Value1.Should().Be(null); - response!.Status.Value2.Should().Be("pulling 797b70c4edf8"); - response!.Status.Object.Should().Be("pulling 797b70c4edf8"); + response.Status.Value2.Should().Be("pulling 797b70c4edf8"); + response.Status.Object.Should().Be("pulling 797b70c4edf8"); + + var response2 = JsonSerializer.Deserialize(json, TestSourceGenerationContext.Default.TestEnumClassAnyOf); + response2.Should().NotBeNull(); + response2!.Status.Value1.Should().Be(default); // TODO: Should be nullable + response2.Status.Value2.Should().Be("pulling 797b70c4edf8"); + response2.Status.Object.Should().Be("pulling 797b70c4edf8"); var responseReverted = JsonSerializer.Deserialize(json); responseReverted.Should().NotBeNull(); responseReverted!.Status.Value2.Should().Be(null); - responseReverted!.Status.Value1.Should().Be("pulling 797b70c4edf8"); - response!.Status.Object.Should().Be("pulling 797b70c4edf8"); + responseReverted.Status.Value1.Should().Be("pulling 797b70c4edf8"); + responseReverted.Status.Object.Should().Be("pulling 797b70c4edf8"); + + var responseReverted2 = JsonSerializer.Deserialize(json, TestSourceGenerationContext.Default.TestEnumClassAnyOfReverted); + responseReverted2.Should().NotBeNull(); + responseReverted2!.Status.Value2.Should().Be(default); // TODO: Should be nullable + responseReverted2.Status.Value1.Should().Be("pulling 797b70c4edf8"); + responseReverted2.Status.Object.Should().Be(default(TestEnum)); // TODO: Should be nullable } [TestMethod] public void Enum2_AnyOfStringAndEnum_SystemTextJson_Enum() { const string json = "{\"status\":\"pulling manifest\",\"digest\":\"sha256:797b70c4edf85907fe0a49eb85811256f65fa0f7bf52166b147fd16be2be4662\",\"total\":45949216}"; - - var response = JsonSerializer.Deserialize(json, new JsonSerializerOptions + var options = new global::System.Text.Json.JsonSerializerOptions { - Converters = { new AnyOfConverterFactorySystemTextJson(), new TestEnumJsonStringEnumConverter() } - }); + PropertyNameCaseInsensitive = true, + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = + { + new TestEnumJsonStringEnumConverter(), + } + }; + + var response = JsonSerializer.Deserialize(json, options); response.Should().NotBeNull(); response!.Status.Value1.Should().Be(TestEnum.PullingManifest); - response!.Status.Value2.Should().Be("pulling manifest"); - response!.Status.Object.Should().Be("pulling manifest"); + response.Status.Value2.Should().Be("pulling manifest"); + response.Status.Object.Should().Be("pulling manifest"); - var responseReverted = JsonSerializer.Deserialize(json, new JsonSerializerOptions - { - Converters = { new AnyOfConverterFactorySystemTextJson(), new TestEnumJsonStringEnumConverter() } - }); + var response2 = JsonSerializer.Deserialize(json, TestSourceGenerationContext.Default.TestEnumClassAnyOf); + response2.Should().NotBeNull(); + response2!.Status.Value1.Should().Be(TestEnum.PullingManifest); + response2.Status.Value2.Should().Be("pulling manifest"); + response2.Status.Object.Should().Be("pulling manifest"); + + var responseReverted = JsonSerializer.Deserialize(json, TestSourceGenerationContext.Default.TestEnumClassAnyOfReverted); responseReverted.Should().NotBeNull(); responseReverted!.Status.Value2.Should().Be(TestEnum.PullingManifest); - responseReverted!.Status.Value1.Should().Be("pulling manifest"); - responseReverted!.Status.Object.Should().Be(TestEnum.PullingManifest); + responseReverted.Status.Value1.Should().Be("pulling manifest"); + responseReverted.Status.Object.Should().Be(TestEnum.PullingManifest); + + var responseReverted2 = JsonSerializer.Deserialize(json, options); + responseReverted2.Should().NotBeNull(); + responseReverted2!.Status.Value2.Should().Be(TestEnum.PullingManifest); + responseReverted2.Status.Value1.Should().Be("pulling manifest"); + responseReverted2.Status.Object.Should().Be(TestEnum.PullingManifest); } } diff --git a/src/tests/OpenApiGenerator.UnitTests/JsonTests.Enum.New.cs b/src/tests/OpenApiGenerator.UnitTests/JsonTests.Enum.New.cs index bc8aef92a8..811122ce2b 100644 --- a/src/tests/OpenApiGenerator.UnitTests/JsonTests.Enum.New.cs +++ b/src/tests/OpenApiGenerator.UnitTests/JsonTests.Enum.New.cs @@ -38,6 +38,13 @@ public void Enum2_SystemTextJson_SourceGenerationContext() // } } -[JsonSourceGenerationOptions(DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)] +[JsonSourceGenerationOptions( + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, + Converters = + [ + typeof(TestEnumJsonStringEnumConverter) + ])] [JsonSerializable(typeof(TestEnumClass))] +[JsonSerializable(typeof(TestEnumClassAnyOf))] +[JsonSerializable(typeof(TestEnumClassAnyOfReverted))] internal sealed partial class TestSourceGenerationContext : JsonSerializerContext; diff --git a/src/tests/OpenApiGenerator.UnitTests/Snapshots/LangSmith/Methods/_.verified.txt b/src/tests/OpenApiGenerator.UnitTests/Snapshots/LangSmith/Methods/_.verified.txt index 42eb85621c..985d88c243 100644 --- a/src/tests/OpenApiGenerator.UnitTests/Snapshots/LangSmith/Methods/_.verified.txt +++ b/src/tests/OpenApiGenerator.UnitTests/Snapshots/LangSmith/Methods/_.verified.txt @@ -233,6 +233,7 @@ ConverterType: } ], + Converters: null, MethodName: UpdateRunRunsRunIdPatchAsync, NotAsyncMethodName: UpdateRunRunsRunIdPatch, FileNameWithoutExtension: G.Api.UpdateRunRunsRunIdPatch @@ -815,12 +816,13 @@ ConverterType: } ], + Converters: null, MethodName: CreateRunRunsPostAsync, NotAsyncMethodName: CreateRunRunsPost, FileNameWithoutExtension: G.Api.CreateRunRunsPost }, { - Id: Constructors, + Id: MainConstructor, Namespace: G, ClassName: Api, BaseUrl: , @@ -857,8 +859,12 @@ }, AdditionalModels: null, AdditionalTypes: null, - MethodName: ConstructorsAsync, - NotAsyncMethodName: Constructors, + Converters: [ + global::OpenApiGenerator.JsonConverters.RunCreateSchemaExtendedRunTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunCreateSchemaRunTypeJsonConverter + ], + MethodName: MainConstructorAsync, + NotAsyncMethodName: MainConstructor, FileNameWithoutExtension: G.Api } ] \ No newline at end of file diff --git a/src/tests/OpenApiGenerator.UnitTests/Snapshots/Ollama/Methods/_.verified.txt b/src/tests/OpenApiGenerator.UnitTests/Snapshots/Ollama/Methods/_.verified.txt index e9e7a60de7..490df2cfac 100644 --- a/src/tests/OpenApiGenerator.UnitTests/Snapshots/Ollama/Methods/_.verified.txt +++ b/src/tests/OpenApiGenerator.UnitTests/Snapshots/Ollama/Methods/_.verified.txt @@ -428,6 +428,7 @@ How long (in minutes) to keep the model loaded in memory. ConverterType: } ], + Converters: null, MethodName: GenerateCompletionAsync, NotAsyncMethodName: GenerateCompletion, FileNameWithoutExtension: G.CompletionsClient.GenerateCompletion @@ -730,6 +731,7 @@ How long (in minutes) to keep the model loaded in memory. ConverterType: } ], + Converters: null, MethodName: GenerateChatCompletionAsync, NotAsyncMethodName: GenerateChatCompletion, FileNameWithoutExtension: G.ChatClient.GenerateChatCompletion @@ -950,6 +952,7 @@ How long (in minutes) to keep the model loaded in memory. ConverterType: } ], + Converters: null, MethodName: GenerateEmbeddingAsync, NotAsyncMethodName: GenerateEmbedding, FileNameWithoutExtension: G.EmbeddingsClient.GenerateEmbedding @@ -1161,6 +1164,7 @@ If `false` the response will be returned as a single response object, otherwise ConverterType: } ], + Converters: null, MethodName: CreateModelAsync, NotAsyncMethodName: CreateModel, FileNameWithoutExtension: G.ModelsClient.CreateModel @@ -1220,6 +1224,7 @@ If `false` the response will be returned as a single response object, otherwise ConverterType: } ], + Converters: null, MethodName: ListModelsAsync, NotAsyncMethodName: ListModels, FileNameWithoutExtension: G.ModelsClient.ListModels @@ -1337,6 +1342,7 @@ Model names follow a `model:tag` format. Some examples are `orca-mini:3b-q4_1` a ConverterType: } ], + Converters: null, MethodName: ShowModelInfoAsync, NotAsyncMethodName: ShowModelInfo, FileNameWithoutExtension: G.ModelsClient.ShowModelInfo @@ -1450,6 +1456,7 @@ Name of the new model. ConverterType: } ], + Converters: null, MethodName: CopyModelAsync, NotAsyncMethodName: CopyModel, FileNameWithoutExtension: G.ModelsClient.CopyModel @@ -1539,6 +1546,7 @@ Model names follow a `model:tag` format. Some examples are `orca-mini:3b-q4_1` a ConverterType: } ], + Converters: null, MethodName: DeleteModelAsync, NotAsyncMethodName: DeleteModel, FileNameWithoutExtension: G.ModelsClient.DeleteModel @@ -1760,6 +1768,7 @@ If `false` the response will be returned as a single response object, otherwise ConverterType: } ], + Converters: null, MethodName: PullModelAsync, NotAsyncMethodName: PullModel, FileNameWithoutExtension: G.ModelsClient.PullModel @@ -1978,6 +1987,7 @@ If `false` the response will be returned as a single response object, otherwise ConverterType: } ], + Converters: null, MethodName: PushModelAsync, NotAsyncMethodName: PushModel, FileNameWithoutExtension: G.ModelsClient.PushModel @@ -2048,6 +2058,7 @@ If `false` the response will be returned as a single response object, otherwise }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: CheckBlobAsync, NotAsyncMethodName: CheckBlob, FileNameWithoutExtension: G.ModelsClient.CheckBlob @@ -2131,12 +2142,13 @@ If `false` the response will be returned as a single response object, otherwise ConverterType: } ], + Converters: null, MethodName: CreateBlobAsync, NotAsyncMethodName: CreateBlob, FileNameWithoutExtension: G.ModelsClient.CreateBlob }, { - Id: Constructors, + Id: MainConstructor, Namespace: G, ClassName: Api, BaseUrl: http://localhost:11434/api, @@ -2266,8 +2278,16 @@ If `false` the response will be returned as a single response object, otherwise }, AdditionalModels: null, AdditionalTypes: null, - MethodName: ConstructorsAsync, - NotAsyncMethodName: Constructors, + Converters: [ + global::OpenApiGenerator.JsonConverters.GenerateCompletionRequestFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.GenerateChatCompletionRequestFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateModelResponseStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.PullModelResponseStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.PushModelResponseStatusJsonConverter + ], + MethodName: MainConstructorAsync, + NotAsyncMethodName: MainConstructor, FileNameWithoutExtension: G.Api }, { @@ -2308,6 +2328,7 @@ If `false` the response will be returned as a single response object, otherwise }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ConstructorsAsync, NotAsyncMethodName: Constructors, FileNameWithoutExtension: G.CompletionsClient @@ -2350,6 +2371,7 @@ If `false` the response will be returned as a single response object, otherwise }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ConstructorsAsync, NotAsyncMethodName: Constructors, FileNameWithoutExtension: G.ChatClient @@ -2392,6 +2414,7 @@ If `false` the response will be returned as a single response object, otherwise }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ConstructorsAsync, NotAsyncMethodName: Constructors, FileNameWithoutExtension: G.EmbeddingsClient @@ -2434,6 +2457,7 @@ If `false` the response will be returned as a single response object, otherwise }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ConstructorsAsync, NotAsyncMethodName: Constructors, FileNameWithoutExtension: G.ModelsClient diff --git a/src/tests/OpenApiGenerator.UnitTests/Snapshots/OpenAi/Methods/_.verified.txt b/src/tests/OpenApiGenerator.UnitTests/Snapshots/OpenAi/Methods/_.verified.txt index 56c66f9ab9..fe07095b6f 100644 --- a/src/tests/OpenApiGenerator.UnitTests/Snapshots/OpenAi/Methods/_.verified.txt +++ b/src/tests/OpenApiGenerator.UnitTests/Snapshots/OpenAi/Methods/_.verified.txt @@ -704,6 +704,7 @@ A list of functions the model may generate JSON inputs for. ConverterType: } ], + Converters: null, MethodName: CreateChatCompletionAsync, NotAsyncMethodName: CreateChatCompletion, FileNameWithoutExtension: G.ChatClient.CreateChatCompletion @@ -1342,6 +1343,7 @@ A unique identifier representing your end-user, which can help OpenAI to monitor ConverterType: } ], + Converters: null, MethodName: CreateCompletionAsync, NotAsyncMethodName: CreateCompletion, FileNameWithoutExtension: G.CompletionsClient.CreateCompletion @@ -1679,6 +1681,7 @@ A unique identifier representing your end-user, which can help OpenAI to monitor ConverterType: } ], + Converters: null, MethodName: CreateImageAsync, NotAsyncMethodName: CreateImage, FileNameWithoutExtension: G.ImagesClient.CreateImage @@ -1992,6 +1995,7 @@ A unique identifier representing your end-user, which can help OpenAI to monitor ConverterType: } ], + Converters: null, MethodName: CreateImageEditAsync, NotAsyncMethodName: CreateImageEdit, FileNameWithoutExtension: G.ImagesClient.CreateImageEdit @@ -2253,6 +2257,7 @@ A unique identifier representing your end-user, which can help OpenAI to monitor ConverterType: } ], + Converters: null, MethodName: CreateImageVariationAsync, NotAsyncMethodName: CreateImageVariation, FileNameWithoutExtension: G.ImagesClient.CreateImageVariation @@ -2482,6 +2487,7 @@ A unique identifier representing your end-user, which can help OpenAI to monitor ConverterType: } ], + Converters: null, MethodName: CreateEmbeddingAsync, NotAsyncMethodName: CreateEmbedding, FileNameWithoutExtension: G.EmbeddingsClient.CreateEmbedding @@ -2715,6 +2721,7 @@ The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is ConverterType: } ], + Converters: null, MethodName: CreateSpeechAsync, NotAsyncMethodName: CreateSpeech, FileNameWithoutExtension: G.AudioClient.CreateSpeech @@ -2968,6 +2975,7 @@ The sampling temperature, between 0 and 1. Higher values like 0.8 will make the ConverterType: OneOfJsonConverterFactory2 } ], + Converters: null, MethodName: CreateTranscriptionAsync, NotAsyncMethodName: CreateTranscription, FileNameWithoutExtension: G.AudioClient.CreateTranscription @@ -3182,6 +3190,7 @@ The sampling temperature, between 0 and 1. Higher values like 0.8 will make the ConverterType: OneOfJsonConverterFactory2 } ], + Converters: null, MethodName: CreateTranslationAsync, NotAsyncMethodName: CreateTranslation, FileNameWithoutExtension: G.AudioClient.CreateTranslation @@ -3270,6 +3279,7 @@ The sampling temperature, between 0 and 1. Higher values like 0.8 will make the ConverterType: } ], + Converters: null, MethodName: ListFilesAsync, NotAsyncMethodName: ListFiles, FileNameWithoutExtension: G.FilesClient.ListFiles @@ -3423,6 +3433,7 @@ Use "assistants" for [Assistants](/docs/api-reference/assistants) and [Message]( ConverterType: } ], + Converters: null, MethodName: CreateFileAsync, NotAsyncMethodName: CreateFile, FileNameWithoutExtension: G.FilesClient.CreateFile @@ -3514,6 +3525,7 @@ Use "assistants" for [Assistants](/docs/api-reference/assistants) and [Message]( ConverterType: } ], + Converters: null, MethodName: DeleteFileAsync, NotAsyncMethodName: DeleteFile, FileNameWithoutExtension: G.FilesClient.DeleteFile @@ -3614,6 +3626,7 @@ Use "assistants" for [Assistants](/docs/api-reference/assistants) and [Message]( ConverterType: } ], + Converters: null, MethodName: RetrieveFileAsync, NotAsyncMethodName: RetrieveFile, FileNameWithoutExtension: G.FilesClient.RetrieveFile @@ -3696,6 +3709,7 @@ Use "assistants" for [Assistants](/docs/api-reference/assistants) and [Message]( ConverterType: } ], + Converters: null, MethodName: DownloadFileAsync, NotAsyncMethodName: DownloadFile, FileNameWithoutExtension: G.FilesClient.DownloadFile @@ -4013,6 +4027,7 @@ If a seed is not specified, one will be generated for you. ConverterType: } ], + Converters: null, MethodName: CreateFineTuningJobAsync, NotAsyncMethodName: CreateFineTuningJob, FileNameWithoutExtension: G.FineTuningClient.CreateFineTuningJob @@ -4131,6 +4146,7 @@ If a seed is not specified, one will be generated for you. ConverterType: } ], + Converters: null, MethodName: ListPaginatedFineTuningJobsAsync, NotAsyncMethodName: ListPaginatedFineTuningJobs, FileNameWithoutExtension: G.FineTuningClient.ListPaginatedFineTuningJobs @@ -4250,6 +4266,7 @@ If a seed is not specified, one will be generated for you. ConverterType: } ], + Converters: null, MethodName: RetrieveFineTuningJobAsync, NotAsyncMethodName: RetrieveFineTuningJob, FileNameWithoutExtension: G.FineTuningClient.RetrieveFineTuningJob @@ -4393,6 +4410,7 @@ If a seed is not specified, one will be generated for you. ConverterType: } ], + Converters: null, MethodName: ListFineTuningEventsAsync, NotAsyncMethodName: ListFineTuningEvents, FileNameWithoutExtension: G.FineTuningClient.ListFineTuningEvents @@ -4513,6 +4531,7 @@ If a seed is not specified, one will be generated for you. ConverterType: } ], + Converters: null, MethodName: CancelFineTuningJobAsync, NotAsyncMethodName: CancelFineTuningJob, FileNameWithoutExtension: G.FineTuningClient.CancelFineTuningJob @@ -4662,6 +4681,7 @@ If a seed is not specified, one will be generated for you. ConverterType: } ], + Converters: null, MethodName: ListFineTuningJobCheckpointsAsync, NotAsyncMethodName: ListFineTuningJobCheckpoints, FileNameWithoutExtension: G.FineTuningClient.ListFineTuningJobCheckpoints @@ -4723,6 +4743,7 @@ If a seed is not specified, one will be generated for you. ConverterType: } ], + Converters: null, MethodName: ListModelsAsync, NotAsyncMethodName: ListModels, FileNameWithoutExtension: G.ModelsClient.ListModels @@ -4816,6 +4837,7 @@ If a seed is not specified, one will be generated for you. ConverterType: } ], + Converters: null, MethodName: RetrieveModelAsync, NotAsyncMethodName: RetrieveModel, FileNameWithoutExtension: G.ModelsClient.RetrieveModel @@ -4908,6 +4930,7 @@ If a seed is not specified, one will be generated for you. ConverterType: } ], + Converters: null, MethodName: DeleteModelAsync, NotAsyncMethodName: DeleteModel, FileNameWithoutExtension: G.ModelsClient.DeleteModel @@ -5046,6 +5069,7 @@ The default is `text-moderation-latest` which will be automatically upgraded ove ConverterType: } ], + Converters: null, MethodName: CreateModerationAsync, NotAsyncMethodName: CreateModeration, FileNameWithoutExtension: G.ModerationsClient.CreateModeration @@ -5228,6 +5252,7 @@ The default is `text-moderation-latest` which will be automatically upgraded ove ConverterType: } ], + Converters: null, MethodName: ListAssistantsAsync, NotAsyncMethodName: ListAssistants, FileNameWithoutExtension: G.AssistantsClient.ListAssistants @@ -5615,6 +5640,7 @@ Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the m ConverterType: } ], + Converters: null, MethodName: CreateAssistantAsync, NotAsyncMethodName: CreateAssistant, FileNameWithoutExtension: G.AssistantsClient.CreateAssistant @@ -5725,6 +5751,7 @@ Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the m ConverterType: } ], + Converters: null, MethodName: GetAssistantAsync, NotAsyncMethodName: GetAssistant, FileNameWithoutExtension: G.AssistantsClient.GetAssistant @@ -6137,6 +6164,7 @@ Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the m ConverterType: } ], + Converters: null, MethodName: ModifyAssistantAsync, NotAsyncMethodName: ModifyAssistant, FileNameWithoutExtension: G.AssistantsClient.ModifyAssistant @@ -6228,6 +6256,7 @@ Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the m ConverterType: } ], + Converters: null, MethodName: DeleteAssistantAsync, NotAsyncMethodName: DeleteAssistant, FileNameWithoutExtension: G.AssistantsClient.DeleteAssistant @@ -6391,6 +6420,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: CreateThreadAsync, NotAsyncMethodName: CreateThread, FileNameWithoutExtension: G.AssistantsClient.CreateThread @@ -6485,6 +6515,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: GetThreadAsync, NotAsyncMethodName: GetThread, FileNameWithoutExtension: G.AssistantsClient.GetThread @@ -6649,6 +6680,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: ModifyThreadAsync, NotAsyncMethodName: ModifyThread, FileNameWithoutExtension: G.AssistantsClient.ModifyThread @@ -6740,6 +6772,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: DeleteThreadAsync, NotAsyncMethodName: DeleteThread, FileNameWithoutExtension: G.AssistantsClient.DeleteThread @@ -6974,6 +7007,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: ListMessagesAsync, NotAsyncMethodName: ListMessages, FileNameWithoutExtension: G.AssistantsClient.ListMessages @@ -7215,6 +7249,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: CreateMessageAsync, NotAsyncMethodName: CreateMessage, FileNameWithoutExtension: G.AssistantsClient.CreateMessage @@ -7353,6 +7388,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: GetMessageAsync, NotAsyncMethodName: GetMessage, FileNameWithoutExtension: G.AssistantsClient.GetMessage @@ -7534,6 +7570,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: ModifyMessageAsync, NotAsyncMethodName: ModifyMessage, FileNameWithoutExtension: G.AssistantsClient.ModifyMessage @@ -7651,6 +7688,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: DeleteMessageAsync, NotAsyncMethodName: DeleteMessage, FileNameWithoutExtension: G.AssistantsClient.DeleteMessage @@ -8198,6 +8236,7 @@ Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the m ConverterType: } ], + Converters: null, MethodName: CreateThreadAndRunAsync, NotAsyncMethodName: CreateThreadAndRun, FileNameWithoutExtension: G.AssistantsClient.CreateThreadAndRun @@ -8406,6 +8445,7 @@ Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the m ConverterType: } ], + Converters: null, MethodName: ListRunsAsync, NotAsyncMethodName: ListRuns, FileNameWithoutExtension: G.AssistantsClient.ListRuns @@ -8973,6 +9013,7 @@ Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the m ConverterType: } ], + Converters: null, MethodName: CreateRunAsync, NotAsyncMethodName: CreateRun, FileNameWithoutExtension: G.AssistantsClient.CreateRun @@ -9135,6 +9176,7 @@ Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the m ConverterType: } ], + Converters: null, MethodName: GetRunAsync, NotAsyncMethodName: GetRun, FileNameWithoutExtension: G.AssistantsClient.GetRun @@ -9340,6 +9382,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: ModifyRunAsync, NotAsyncMethodName: ModifyRun, FileNameWithoutExtension: G.AssistantsClient.ModifyRun @@ -9569,6 +9612,7 @@ If `true`, returns a stream of events that happen during the Run as server-sent ConverterType: } ], + Converters: null, MethodName: SubmitToolOuputsToRunAsync, NotAsyncMethodName: SubmitToolOuputsToRun, FileNameWithoutExtension: G.AssistantsClient.SubmitToolOuputsToRun @@ -9732,6 +9776,7 @@ If `true`, returns a stream of events that happen during the Run as server-sent ConverterType: } ], + Converters: null, MethodName: CancelRunAsync, NotAsyncMethodName: CancelRun, FileNameWithoutExtension: G.AssistantsClient.CancelRun @@ -9966,6 +10011,7 @@ If `true`, returns a stream of events that happen during the Run as server-sent ConverterType: } ], + Converters: null, MethodName: ListRunStepsAsync, NotAsyncMethodName: ListRunSteps, FileNameWithoutExtension: G.AssistantsClient.ListRunSteps @@ -10134,6 +10180,7 @@ If `true`, returns a stream of events that happen during the Run as server-sent ConverterType: } ], + Converters: null, MethodName: GetRunStepAsync, NotAsyncMethodName: GetRunStep, FileNameWithoutExtension: G.AssistantsClient.GetRunStep @@ -10316,6 +10363,7 @@ If `true`, returns a stream of events that happen during the Run as server-sent ConverterType: } ], + Converters: null, MethodName: ListVectorStoresAsync, NotAsyncMethodName: ListVectorStores, FileNameWithoutExtension: G.VectorStoresClient.ListVectorStores @@ -10517,6 +10565,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: CreateVectorStoreAsync, NotAsyncMethodName: CreateVectorStore, FileNameWithoutExtension: G.VectorStoresClient.CreateVectorStore @@ -10623,6 +10672,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: GetVectorStoreAsync, NotAsyncMethodName: GetVectorStore, FileNameWithoutExtension: G.VectorStoresClient.GetVectorStore @@ -10825,6 +10875,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: ModifyVectorStoreAsync, NotAsyncMethodName: ModifyVectorStore, FileNameWithoutExtension: G.VectorStoresClient.ModifyVectorStore @@ -10916,6 +10967,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: DeleteVectorStoreAsync, NotAsyncMethodName: DeleteVectorStore, FileNameWithoutExtension: G.VectorStoresClient.DeleteVectorStore @@ -11160,6 +11212,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: ListVectorStoreFilesAsync, NotAsyncMethodName: ListVectorStoreFiles, FileNameWithoutExtension: G.VectorStoresClient.ListVectorStoreFiles @@ -11299,6 +11352,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: CreateVectorStoreFileAsync, NotAsyncMethodName: CreateVectorStoreFile, FileNameWithoutExtension: G.VectorStoresClient.CreateVectorStoreFile @@ -11425,6 +11479,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: GetVectorStoreFileAsync, NotAsyncMethodName: GetVectorStoreFile, FileNameWithoutExtension: G.VectorStoresClient.GetVectorStoreFile @@ -11542,6 +11597,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: DeleteVectorStoreFileAsync, NotAsyncMethodName: DeleteVectorStoreFile, FileNameWithoutExtension: G.VectorStoresClient.DeleteVectorStoreFile @@ -11679,6 +11735,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: CreateVectorStoreFileBatchAsync, NotAsyncMethodName: CreateVectorStoreFileBatch, FileNameWithoutExtension: G.VectorStoresClient.CreateVectorStoreFileBatch @@ -11803,6 +11860,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: GetVectorStoreFileBatchAsync, NotAsyncMethodName: GetVectorStoreFileBatch, FileNameWithoutExtension: G.VectorStoresClient.GetVectorStoreFileBatch @@ -11926,6 +11984,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: CancelVectorStoreFileBatchAsync, NotAsyncMethodName: CancelVectorStoreFileBatch, FileNameWithoutExtension: G.VectorStoresClient.CancelVectorStoreFileBatch @@ -12196,6 +12255,7 @@ Set of 16 key-value pairs that can be attached to an object. This can be useful ConverterType: } ], + Converters: null, MethodName: ListFilesInVectorStoreBatchAsync, NotAsyncMethodName: ListFilesInVectorStoreBatch, FileNameWithoutExtension: G.VectorStoresClient.ListFilesInVectorStoreBatch @@ -12416,6 +12476,7 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re ConverterType: } ], + Converters: null, MethodName: CreateBatchAsync, NotAsyncMethodName: CreateBatch, FileNameWithoutExtension: G.BatchClient.CreateBatch @@ -12538,6 +12599,7 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re ConverterType: } ], + Converters: null, MethodName: ListBatchesAsync, NotAsyncMethodName: ListBatches, FileNameWithoutExtension: G.BatchClient.ListBatches @@ -12662,6 +12724,7 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re ConverterType: } ], + Converters: null, MethodName: RetrieveBatchAsync, NotAsyncMethodName: RetrieveBatch, FileNameWithoutExtension: G.BatchClient.RetrieveBatch @@ -12787,6 +12850,7 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re ConverterType: } ], + Converters: null, MethodName: CancelBatchAsync, NotAsyncMethodName: CancelBatch, FileNameWithoutExtension: G.BatchClient.CancelBatch @@ -12829,12 +12893,13 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: AuthorizeUsingBearerAsync, NotAsyncMethodName: AuthorizeUsingBearer, FileNameWithoutExtension: G.Api.Authorization }, { - Id: Constructors, + Id: MainConstructor, Namespace: G, ClassName: Api, BaseUrl: https://api.openai.com/v1, @@ -13148,8 +13213,180 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re }, AdditionalModels: null, AdditionalTypes: null, - MethodName: ConstructorsAsync, - NotAsyncMethodName: Constructors, + Converters: [ + global::OpenApiGenerator.JsonConverters.ListModelsResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateCompletionRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateCompletionResponseChoicesFinishReasonJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateCompletionResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartImageImageUrlDetailJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartImageTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartTextTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionRequestSystemMessageRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionRequestUserMessageRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionRequestAssistantMessageRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionRequestToolMessageRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionRequestFunctionMessageRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionToolTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionNamedToolChoiceTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionMessageToolCallTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionMessageToolCallChunkTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionResponseMessageRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionStreamResponseDeltaRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestResponseFormatTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestToolChoiceJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestFunctionCallJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionResponseChoicesFinishReasonJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionFunctionResponseChoicesFinishReasonJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionFunctionResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.ListPaginatedFineTuningJobsResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionStreamResponseChoicesFinishReasonJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionStreamResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageRequestQualityJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageRequestResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageRequestSizeJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageRequestStyleJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageEditRequestSizeJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageEditRequestResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageEditRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestSizeJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateModerationRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.ListFilesResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateFileRequestPurposeJsonConverter, + global::OpenApiGenerator.JsonConverters.DeleteFileResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersBatchSizeJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersNEpochsJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestIntegrationsTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.ListFineTuningJobEventsResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.ListFineTuningJobCheckpointsResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateEmbeddingRequestEncodingFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateEmbeddingRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateEmbeddingResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateTranscriptionRequestResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateTranscriptionRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateTranslationRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateSpeechRequestVoiceJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateSpeechRequestResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateSpeechRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.ModelObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.OpenAIFileObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.OpenAIFilePurposeJsonConverter, + global::OpenApiGenerator.JsonConverters.OpenAIFileStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.EmbeddingObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.FineTuningJobHyperparametersNEpochsJsonConverter, + global::OpenApiGenerator.JsonConverters.FineTuningJobObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.FineTuningJobStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.FineTuningIntegrationTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.FineTuningJobEventLevelJsonConverter, + global::OpenApiGenerator.JsonConverters.FineTuningJobEventObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.FineTuningJobCheckpointObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.AssistantsApiResponseFormatTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.AssistantObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.AssistantObjectResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateAssistantRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateAssistantRequestResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.ModifyAssistantRequestResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.DeleteAssistantResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.AssistantToolsCodeTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.AssistantToolsFileSearchTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.AssistantToolsFunctionTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.TruncationObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.AssistantsNamedToolChoiceTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunObjectRequiredActionTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunObjectLastErrorCodeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunObjectIncompleteDetailsReasonJsonConverter, + global::OpenApiGenerator.JsonConverters.RunObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.RunObjectStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.RunObjectToolChoiceJsonConverter, + global::OpenApiGenerator.JsonConverters.RunObjectResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateRunRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateRunRequestToolChoiceJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateRunRequestResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.RunToolCallObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestToolChoiceJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.ThreadObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.DeleteThreadResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageObjectIncompleteDetailsReasonJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageObjectStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageObjectRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageDeltaObjectDeltaRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageDeltaObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateMessageRequestRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.DeleteMessageResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageContentImageFileObjectImageFileDetailJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageContentImageFileObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageFileObjectImageFileDetailJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageFileObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageContentImageUrlObjectImageUrlDetailJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageContentImageUrlObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageUrlObjectImageUrlDetailJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageUrlObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageContentTextObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageRequestContentTextObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageContentTextAnnotationsFileCitationObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageContentTextAnnotationsFilePathObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextAnnotationsFileCitationObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextAnnotationsFilePathObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepObjectLastErrorCodeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepObjectStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDeltaObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDetailsMessageCreationObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsMessageCreationObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeOutputLogsObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeOutputImageObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsFileSearchObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsFunctionObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.VectorStoreExpirationAfterAnchorJsonConverter, + global::OpenApiGenerator.JsonConverters.VectorStoreObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.VectorStoreObjectStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.DeleteVectorStoreResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectLastErrorCodeJsonConverter, + global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.DeleteVectorStoreFileResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.VectorStoreFileBatchObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.VectorStoreFileBatchObjectStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.ErrorEventEventJsonConverter, + global::OpenApiGenerator.JsonConverters.DoneEventEventJsonConverter, + global::OpenApiGenerator.JsonConverters.DoneEventDataJsonConverter, + global::OpenApiGenerator.JsonConverters.BatchObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.BatchStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.BatchRequestInputMethodJsonConverter, + global::OpenApiGenerator.JsonConverters.ListBatchesResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.ListAssistantsOrderJsonConverter, + global::OpenApiGenerator.JsonConverters.ListMessagesOrderJsonConverter, + global::OpenApiGenerator.JsonConverters.ListRunsOrderJsonConverter, + global::OpenApiGenerator.JsonConverters.ListRunStepsOrderJsonConverter, + global::OpenApiGenerator.JsonConverters.ListVectorStoresOrderJsonConverter, + global::OpenApiGenerator.JsonConverters.ListVectorStoreFilesOrderJsonConverter, + global::OpenApiGenerator.JsonConverters.ListVectorStoreFilesFilterJsonConverter, + global::OpenApiGenerator.JsonConverters.ListFilesInVectorStoreBatchOrderJsonConverter, + global::OpenApiGenerator.JsonConverters.ListFilesInVectorStoreBatchFilterJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateBatchRequestEndpointJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateBatchRequestCompletionWindowJsonConverter + ], + MethodName: MainConstructorAsync, + NotAsyncMethodName: MainConstructor, FileNameWithoutExtension: G.Api }, { @@ -13190,6 +13427,7 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ConstructorsAsync, NotAsyncMethodName: Constructors, FileNameWithoutExtension: G.AssistantsClient @@ -13232,6 +13470,7 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ConstructorsAsync, NotAsyncMethodName: Constructors, FileNameWithoutExtension: G.AudioClient @@ -13274,6 +13513,7 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ConstructorsAsync, NotAsyncMethodName: Constructors, FileNameWithoutExtension: G.ChatClient @@ -13316,6 +13556,7 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ConstructorsAsync, NotAsyncMethodName: Constructors, FileNameWithoutExtension: G.CompletionsClient @@ -13358,6 +13599,7 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ConstructorsAsync, NotAsyncMethodName: Constructors, FileNameWithoutExtension: G.EmbeddingsClient @@ -13400,6 +13642,7 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ConstructorsAsync, NotAsyncMethodName: Constructors, FileNameWithoutExtension: G.FineTuningClient @@ -13442,6 +13685,7 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ConstructorsAsync, NotAsyncMethodName: Constructors, FileNameWithoutExtension: G.BatchClient @@ -13484,6 +13728,7 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ConstructorsAsync, NotAsyncMethodName: Constructors, FileNameWithoutExtension: G.FilesClient @@ -13526,6 +13771,7 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ConstructorsAsync, NotAsyncMethodName: Constructors, FileNameWithoutExtension: G.ImagesClient @@ -13568,6 +13814,7 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ConstructorsAsync, NotAsyncMethodName: Constructors, FileNameWithoutExtension: G.ModelsClient @@ -13610,6 +13857,7 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ConstructorsAsync, NotAsyncMethodName: Constructors, FileNameWithoutExtension: G.ModerationsClient @@ -13652,6 +13900,7 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ConstructorsAsync, NotAsyncMethodName: Constructors, FileNameWithoutExtension: G.VectorStoresClient diff --git a/src/tests/OpenApiGenerator.UnitTests/Snapshots/Replicate/Methods/_.verified.txt b/src/tests/OpenApiGenerator.UnitTests/Snapshots/Replicate/Methods/_.verified.txt index f8ff7e134e..e6fc0a8c62 100644 --- a/src/tests/OpenApiGenerator.UnitTests/Snapshots/Replicate/Methods/_.verified.txt +++ b/src/tests/OpenApiGenerator.UnitTests/Snapshots/Replicate/Methods/_.verified.txt @@ -50,6 +50,7 @@ ConverterType: } ], + Converters: null, MethodName: GetAccountAsync, NotAsyncMethodName: GetAccount, FileNameWithoutExtension: G.Api.GetAccount @@ -92,6 +93,7 @@ }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ListCollectionsAsync, NotAsyncMethodName: ListCollections, FileNameWithoutExtension: G.Api.ListCollections @@ -161,6 +163,7 @@ }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: GetCollectionsAsync, NotAsyncMethodName: GetCollections, FileNameWithoutExtension: G.Api.GetCollections @@ -216,6 +219,7 @@ ConverterType: } ], + Converters: null, MethodName: ListDeploymentsAsync, NotAsyncMethodName: ListDeployments, FileNameWithoutExtension: G.Api.ListDeployments @@ -423,6 +427,7 @@ ConverterType: } ], + Converters: null, MethodName: CreateDeploymentsAsync, NotAsyncMethodName: CreateDeployments, FileNameWithoutExtension: G.Api.CreateDeployments @@ -519,6 +524,7 @@ }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: DeleteDeploymentsAsync, NotAsyncMethodName: DeleteDeployments, FileNameWithoutExtension: G.Api.DeleteDeployments @@ -627,6 +633,7 @@ ConverterType: } ], + Converters: null, MethodName: GetDeploymentsAsync, NotAsyncMethodName: GetDeployments, FileNameWithoutExtension: G.Api.GetDeployments @@ -840,6 +847,7 @@ ConverterType: } ], + Converters: null, MethodName: UpdateDeploymentsAsync, NotAsyncMethodName: UpdateDeployments, FileNameWithoutExtension: G.Api.UpdateDeployments @@ -1094,6 +1102,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 ConverterType: } ], + Converters: null, MethodName: CreatePredictionsDeploymentsAsync, NotAsyncMethodName: CreatePredictionsDeployments, FileNameWithoutExtension: G.Api.CreatePredictionsDeployments @@ -1149,6 +1158,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 ConverterType: } ], + Converters: null, MethodName: ListHardwareAsync, NotAsyncMethodName: ListHardware, FileNameWithoutExtension: G.Api.ListHardware @@ -1191,6 +1201,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ListModelsAsync, NotAsyncMethodName: ListModels, FileNameWithoutExtension: G.Api.ListModels @@ -1461,6 +1472,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 ConverterType: } ], + Converters: null, MethodName: CreateModelsAsync, NotAsyncMethodName: CreateModels, FileNameWithoutExtension: G.Api.CreateModels @@ -1557,6 +1569,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: DeleteModelsAsync, NotAsyncMethodName: DeleteModels, FileNameWithoutExtension: G.Api.DeleteModels @@ -1652,6 +1665,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: GetModelsAsync, NotAsyncMethodName: GetModels, FileNameWithoutExtension: G.Api.GetModels @@ -1906,6 +1920,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 ConverterType: } ], + Converters: null, MethodName: CreatePredictionsModelsAsync, NotAsyncMethodName: CreatePredictionsModels, FileNameWithoutExtension: G.Api.CreatePredictionsModels @@ -2001,6 +2016,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ListVersionsModelsAsync, NotAsyncMethodName: ListVersionsModels, FileNameWithoutExtension: G.Api.ListVersionsModels @@ -2123,6 +2139,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: DeleteVersionsModelsAsync, NotAsyncMethodName: DeleteVersionsModels, FileNameWithoutExtension: G.Api.DeleteVersionsModels @@ -2244,6 +2261,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: GetVersionsModelsAsync, NotAsyncMethodName: GetVersionsModels, FileNameWithoutExtension: G.Api.GetVersionsModels @@ -2507,6 +2525,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 ConverterType: } ], + Converters: null, MethodName: CreateTrainingsAsync, NotAsyncMethodName: CreateTrainings, FileNameWithoutExtension: G.Api.CreateTrainings @@ -2549,6 +2568,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ListPredictionsAsync, NotAsyncMethodName: ListPredictions, FileNameWithoutExtension: G.Api.ListPredictions @@ -2777,6 +2797,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 ConverterType: } ], + Converters: null, MethodName: CreatePredictionsAsync, NotAsyncMethodName: CreatePredictions, FileNameWithoutExtension: G.Api.CreatePredictions @@ -2846,6 +2867,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: GetPredictionsAsync, NotAsyncMethodName: GetPredictions, FileNameWithoutExtension: G.Api.GetPredictions @@ -2916,6 +2938,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: CancelPredictionsAsync, NotAsyncMethodName: CancelPredictions, FileNameWithoutExtension: G.Api.CancelPredictions @@ -2958,6 +2981,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: ListTrainingsAsync, NotAsyncMethodName: ListTrainings, FileNameWithoutExtension: G.Api.ListTrainings @@ -3027,6 +3051,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: GetTrainingsAsync, NotAsyncMethodName: GetTrainings, FileNameWithoutExtension: G.Api.GetTrainings @@ -3097,6 +3122,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: CancelTrainingsAsync, NotAsyncMethodName: CancelTrainings, FileNameWithoutExtension: G.Api.CancelTrainings @@ -3152,6 +3178,7 @@ Requests for event types `output` and `logs` will be sent at most once every 500 ConverterType: } ], + Converters: null, MethodName: GetSecretDefaultWebhooksAsync, NotAsyncMethodName: GetSecretDefaultWebhooks, FileNameWithoutExtension: G.Api.GetSecretDefaultWebhooks @@ -3194,12 +3221,13 @@ Requests for event types `output` and `logs` will be sent at most once every 500 }, AdditionalModels: null, AdditionalTypes: null, + Converters: null, MethodName: AuthorizeUsingBearerAsync, NotAsyncMethodName: AuthorizeUsingBearer, FileNameWithoutExtension: G.Api.Authorization }, { - Id: Constructors, + Id: MainConstructor, Namespace: G, ClassName: Api, BaseUrl: https://api.replicate.com/v1, @@ -3236,8 +3264,19 @@ Requests for event types `output` and `logs` will be sent at most once every 500 }, AdditionalModels: null, AdditionalTypes: null, - MethodName: ConstructorsAsync, - NotAsyncMethodName: Constructors, + Converters: [ + global::OpenApiGenerator.JsonConverters.PredictionRequestWebhookEventsFilterJsonConverter, + global::OpenApiGenerator.JsonConverters.TrainingRequestWebhookEventsFilterJsonConverter, + global::OpenApiGenerator.JsonConverters.VersionPredictionRequestWebhookEventsFilterJsonConverter, + global::OpenApiGenerator.JsonConverters.GetAccountResponseTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateDeploymentsResponseCurrentReleaseCreatedByTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.GetDeploymentsResponseCurrentReleaseCreatedByTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateModelsRequestVisibilityJsonConverter + ], + MethodName: MainConstructorAsync, + NotAsyncMethodName: MainConstructor, FileNameWithoutExtension: G.Api } ] \ No newline at end of file diff --git a/src/tests/OpenApiGenerator.UnitTests/Snapshots/SpecialCases/Methods/_.verified.txt b/src/tests/OpenApiGenerator.UnitTests/Snapshots/SpecialCases/Methods/_.verified.txt index 9a4fdee7e9..03060e4298 100644 --- a/src/tests/OpenApiGenerator.UnitTests/Snapshots/SpecialCases/Methods/_.verified.txt +++ b/src/tests/OpenApiGenerator.UnitTests/Snapshots/SpecialCases/Methods/_.verified.txt @@ -92,6 +92,7 @@ ConverterType: } ], + Converters: null, MethodName: ListPetsAsync, NotAsyncMethodName: ListPets, FileNameWithoutExtension: G.Api.ListPets @@ -154,6 +155,7 @@ ConverterType: } ], + Converters: null, MethodName: CreatePetsAsync, NotAsyncMethodName: CreatePets, FileNameWithoutExtension: G.Api.CreatePets @@ -265,12 +267,13 @@ ConverterType: } ], + Converters: null, MethodName: ShowPetByIdAsync, NotAsyncMethodName: ShowPetById, FileNameWithoutExtension: G.Api.ShowPetById }, { - Id: Constructors, + Id: MainConstructor, Namespace: G, ClassName: Api, BaseUrl: http://petstore.swagger.io/v1, @@ -307,8 +310,9 @@ }, AdditionalModels: null, AdditionalTypes: null, - MethodName: ConstructorsAsync, - NotAsyncMethodName: Constructors, + Converters: null, + MethodName: MainConstructorAsync, + NotAsyncMethodName: MainConstructor, FileNameWithoutExtension: G.Api } ] \ No newline at end of file