diff --git a/src/libs/OpenApiGenerator.Core/Generation/Data.cs b/src/libs/OpenApiGenerator.Core/Generation/Data.cs
index 4a28169d01..03c6de5b5d 100644
--- a/src/libs/OpenApiGenerator.Core/Generation/Data.cs
+++ b/src/libs/OpenApiGenerator.Core/Generation/Data.cs
@@ -264,7 +264,10 @@ .. includedTags.Select(x => PropertyData.Default with
{
Converters = models
.Where(x => x.Style == ModelStyle.Enumeration && x.JsonSerializerType != JsonSerializerType.NewtonsoftJson)
- .Select(x => $"global::OpenApiGenerator.JsonConverters.{x.ClassName}JsonConverter")
+ .SelectMany(x => new [] {
+ $"global::OpenApiGenerator.JsonConverters.{x.ClassName}JsonConverter",
+ $"global::OpenApiGenerator.JsonConverters.{x.ClassName}NullableJsonConverter"
+ })
.ToImmutableArray(),
};
}
@@ -323,6 +326,21 @@ public static FileWithName GetSourceCodeForEnumJsonConverter(
Name: $"JsonConverters.{data.ClassName}.g.cs",
Text: Sources.GenerateEnumJsonConverter(data, cancellationToken: cancellationToken));
}
+
+ public static FileWithName GetSourceCodeForEnumNullableJsonConverter(
+ ModelData data,
+ CancellationToken cancellationToken = default)
+ {
+ if (data.Style != ModelStyle.Enumeration ||
+ data.JsonSerializerType == JsonSerializerType.NewtonsoftJson)
+ {
+ return FileWithName.Empty;
+ }
+
+ return new FileWithName(
+ Name: $"JsonConverters.{data.ClassName}Nullable.g.cs",
+ Text: Sources.GenerateEnumNullableJsonConverter(data, cancellationToken: cancellationToken));
+ }
public static FileWithName GetSourceCodeForAnyOfJsonConverterFactory(
AnyOfData anyOf,
diff --git a/src/libs/OpenApiGenerator.Core/Generation/Sources.JsonConverters.Enum.cs b/src/libs/OpenApiGenerator.Core/Generation/Sources.JsonConverters.Enum.cs
index 663d3493b6..5899010503 100644
--- a/src/libs/OpenApiGenerator.Core/Generation/Sources.JsonConverters.Enum.cs
+++ b/src/libs/OpenApiGenerator.Core/Generation/Sources.JsonConverters.Enum.cs
@@ -63,6 +63,74 @@ public override void Write(
}}
}}
}}
+";
+ }
+
+ public static string GenerateEnumNullableJsonConverter(
+ ModelData model,
+ CancellationToken cancellationToken = default)
+ {
+ if (model.JsonSerializerType == JsonSerializerType.NewtonsoftJson)
+ {
+ return string.Empty;
+ }
+
+ return $@"#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{{
+ ///
+ public sealed class {model.ClassName}NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<{model.GlobalClassName}?>
+ {{
+ ///
+ public override {model.GlobalClassName}? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {{
+ switch (reader.TokenType)
+ {{
+ case global::System.Text.Json.JsonTokenType.String:
+ {{
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {{
+ return {model.GlobalClassName}Extensions.ToEnum(stringValue);
+ }}
+
+ break;
+ }}
+ case global::System.Text.Json.JsonTokenType.Number:
+ {{
+ var numValue = reader.GetInt32();
+ return ({model.GlobalClassName})numValue;
+ }}
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }}
+
+ return default;
+ }}
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ {model.GlobalClassName}? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {{
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {{
+ writer.WriteNullValue();
+ }}
+ else
+ {{
+ writer.WriteStringValue({model.GlobalClassName}Extensions.ToValueString(value.Value));
+ }}
+ }}
+ }}
+}}
";
}
}
\ No newline at end of file
diff --git a/src/libs/OpenApiGenerator.Helpers/JsonEnumConverter/TestEnumNullableJsonStringEnumConverter.cs b/src/libs/OpenApiGenerator.Helpers/JsonEnumConverter/TestEnumNullableJsonStringEnumConverter.cs
new file mode 100644
index 0000000000..f85d1d40a4
--- /dev/null
+++ b/src/libs/OpenApiGenerator.Helpers/JsonEnumConverter/TestEnumNullableJsonStringEnumConverter.cs
@@ -0,0 +1,49 @@
+namespace OpenApiGenerator.JsonConverters;
+
+public sealed class TestEnumNullableJsonStringEnumConverter : global::System.Text.Json.Serialization.JsonConverter
+{
+ public override TestEnum? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return TestEnumExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ return (TestEnum)reader.GetInt32();
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ TestEnum? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(value.Value.ToValueString());
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/OpenApiGenerator/SdkGenerator.cs b/src/libs/OpenApiGenerator/SdkGenerator.cs
index 6c65360051..33d6639c80 100644
--- a/src/libs/OpenApiGenerator/SdkGenerator.cs
+++ b/src/libs/OpenApiGenerator/SdkGenerator.cs
@@ -45,6 +45,10 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
.SelectMany(static (x, _) => x.Models)
.SelectAndReportExceptions(GetEnumJsonConverterSourceCode, context, Id)
.AddSource(context);
+ data
+ .SelectMany(static (x, _) => x.Models)
+ .SelectAndReportExceptions(GetEnumNullableJsonConverterSourceCode, context, Id)
+ .AddSource(context);
data
.SelectMany(static (x, _) => x.AnyOfs)
@@ -122,6 +126,17 @@ private static FileWithName GetEnumJsonConverterSourceCode(
Text: fileWithName.Text);
}
+ private static FileWithName GetEnumNullableJsonConverterSourceCode(
+ ModelData model,
+ CancellationToken cancellationToken = default)
+ {
+ var fileWithName = Data.GetSourceCodeForEnumNullableJsonConverter(model, cancellationToken);
+
+ return new FileWithName(
+ Name: fileWithName.Name,
+ Text: fileWithName.Text);
+ }
+
private static FileWithName GetAnyOfJsonConverterFactorySourceCode(
AnyOfData anyOf,
CancellationToken cancellationToken = default)
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 0ce44ab827..7b76406932 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
@@ -42,25 +42,45 @@ public Api(
Converters =
{
new global::OpenApiGenerator.JsonConverters.RepositorySquashMergeCommitTitleJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RepositorySquashMergeCommitTitleNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RepositorySquashMergeCommitMessageJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RepositorySquashMergeCommitMessageNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RepositoryMergeCommitTitleJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RepositoryMergeCommitTitleNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RepositoryMergeCommitMessageJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RepositoryMergeCommitMessageNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisAdvancedSecurityStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisAdvancedSecurityStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisDependabotSecurityUpdatesStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisDependabotSecurityUpdatesStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisSecretScanningStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisSecretScanningStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisSecretScanningPushProtectionStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisSecretScanningPushProtectionStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ImportStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ImportStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.PagesHttpsCertificateStateJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.PagesHttpsCertificateStateNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.PageStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.PageStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.PageProtectedDomainStateJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.PageProtectedDomainStateNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.PageBuildTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.PageBuildTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MigrationsListForOrgExcludeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MigrationsListForOrgExcludeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MigrationsStartForOrgRequestExcludeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MigrationsStartForOrgRequestExcludeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MigrationsGetStatusForOrgExcludeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MigrationsGetStatusForOrgExcludeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MigrationsStartImportRequestVcsJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MigrationsStartImportRequestVcsNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MigrationsUpdateImportRequestVcsJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MigrationsUpdateImportRequestVcsNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MigrationsSetLfsPreferenceRequestUseLfsJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MigrationsSetLfsPreferenceRequestUseLfsNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MigrationsStartForAuthenticatedUserRequestExcludeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MigrationsStartForAuthenticatedUserRequestExcludeNullableJsonConverter(),
}
};
}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.ImportStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.ImportStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..be6ddfd9e7
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.ImportStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ImportStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ImportStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ImportStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ImportStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ImportStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ImportStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ImportStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsGetStatusForOrgExcludeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsGetStatusForOrgExcludeNullable.g.verified.cs
new file mode 100644
index 0000000000..e04ee5c964
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsGetStatusForOrgExcludeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MigrationsGetStatusForOrgExcludeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MigrationsGetStatusForOrgExcludeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MigrationsGetStatusForOrgExclude? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MigrationsGetStatusForOrgExcludeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MigrationsGetStatusForOrgExclude)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MigrationsGetStatusForOrgExclude? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MigrationsGetStatusForOrgExcludeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsListForOrgExcludeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsListForOrgExcludeNullable.g.verified.cs
new file mode 100644
index 0000000000..18f0a5ffbb
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsListForOrgExcludeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MigrationsListForOrgExcludeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MigrationsListForOrgExcludeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MigrationsListForOrgExclude? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MigrationsListForOrgExcludeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MigrationsListForOrgExclude)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MigrationsListForOrgExclude? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MigrationsListForOrgExcludeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsSetLfsPreferenceRequestUseLfsNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsSetLfsPreferenceRequestUseLfsNullable.g.verified.cs
new file mode 100644
index 0000000000..d7932cc407
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsSetLfsPreferenceRequestUseLfsNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MigrationsSetLfsPreferenceRequestUseLfsNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MigrationsSetLfsPreferenceRequestUseLfsNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MigrationsSetLfsPreferenceRequestUseLfs? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MigrationsSetLfsPreferenceRequestUseLfsExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MigrationsSetLfsPreferenceRequestUseLfs)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MigrationsSetLfsPreferenceRequestUseLfs? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MigrationsSetLfsPreferenceRequestUseLfsExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartForAuthenticatedUserRequestExcludeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartForAuthenticatedUserRequestExcludeNullable.g.verified.cs
new file mode 100644
index 0000000000..26b2f31781
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartForAuthenticatedUserRequestExcludeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MigrationsStartForAuthenticatedUserRequestExcludeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MigrationsStartForAuthenticatedUserRequestExcludeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MigrationsStartForAuthenticatedUserRequestExclude? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MigrationsStartForAuthenticatedUserRequestExcludeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MigrationsStartForAuthenticatedUserRequestExclude)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MigrationsStartForAuthenticatedUserRequestExclude? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MigrationsStartForAuthenticatedUserRequestExcludeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartForOrgRequestExcludeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartForOrgRequestExcludeNullable.g.verified.cs
new file mode 100644
index 0000000000..f21eaf05b9
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartForOrgRequestExcludeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MigrationsStartForOrgRequestExcludeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MigrationsStartForOrgRequestExcludeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MigrationsStartForOrgRequestExclude? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MigrationsStartForOrgRequestExcludeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MigrationsStartForOrgRequestExclude)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MigrationsStartForOrgRequestExclude? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MigrationsStartForOrgRequestExcludeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartImportRequestVcsNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartImportRequestVcsNullable.g.verified.cs
new file mode 100644
index 0000000000..64a2370529
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartImportRequestVcsNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MigrationsStartImportRequestVcsNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MigrationsStartImportRequestVcsNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MigrationsStartImportRequestVcs? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MigrationsStartImportRequestVcsExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MigrationsStartImportRequestVcs)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MigrationsStartImportRequestVcs? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MigrationsStartImportRequestVcsExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsUpdateImportRequestVcsNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsUpdateImportRequestVcsNullable.g.verified.cs
new file mode 100644
index 0000000000..5d7241235b
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsUpdateImportRequestVcsNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MigrationsUpdateImportRequestVcsNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MigrationsUpdateImportRequestVcsNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MigrationsUpdateImportRequestVcs? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MigrationsUpdateImportRequestVcsExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MigrationsUpdateImportRequestVcs)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MigrationsUpdateImportRequestVcs? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MigrationsUpdateImportRequestVcsExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageBuildTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageBuildTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..df8cf2136a
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageBuildTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.PageBuildTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class PageBuildTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.PageBuildType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.PageBuildTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.PageBuildType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.PageBuildType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.PageBuildTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageProtectedDomainStateNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageProtectedDomainStateNullable.g.verified.cs
new file mode 100644
index 0000000000..57a653b83b
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageProtectedDomainStateNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.PageProtectedDomainStateNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class PageProtectedDomainStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.PageProtectedDomainState? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.PageProtectedDomainStateExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.PageProtectedDomainState)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.PageProtectedDomainState? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.PageProtectedDomainStateExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..36de463d38
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.PageStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class PageStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.PageStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.PageStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.PageStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.PageStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.PageStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PagesHttpsCertificateStateNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PagesHttpsCertificateStateNullable.g.verified.cs
new file mode 100644
index 0000000000..d9712acf8c
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PagesHttpsCertificateStateNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.PagesHttpsCertificateStateNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class PagesHttpsCertificateStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.PagesHttpsCertificateState? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.PagesHttpsCertificateStateExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.PagesHttpsCertificateState)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.PagesHttpsCertificateState? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.PagesHttpsCertificateStateExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositoryMergeCommitMessageNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositoryMergeCommitMessageNullable.g.verified.cs
new file mode 100644
index 0000000000..e8cb314b3d
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositoryMergeCommitMessageNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RepositoryMergeCommitMessageNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RepositoryMergeCommitMessageNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RepositoryMergeCommitMessage? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RepositoryMergeCommitMessageExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RepositoryMergeCommitMessage)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RepositoryMergeCommitMessage? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RepositoryMergeCommitMessageExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositoryMergeCommitTitleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositoryMergeCommitTitleNullable.g.verified.cs
new file mode 100644
index 0000000000..77f568e9f7
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositoryMergeCommitTitleNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RepositoryMergeCommitTitleNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RepositoryMergeCommitTitleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RepositoryMergeCommitTitle? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RepositoryMergeCommitTitleExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RepositoryMergeCommitTitle)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RepositoryMergeCommitTitle? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RepositoryMergeCommitTitleExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositorySquashMergeCommitMessageNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositorySquashMergeCommitMessageNullable.g.verified.cs
new file mode 100644
index 0000000000..4c201595fe
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositorySquashMergeCommitMessageNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RepositorySquashMergeCommitMessageNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RepositorySquashMergeCommitMessageNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RepositorySquashMergeCommitMessage? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RepositorySquashMergeCommitMessageExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RepositorySquashMergeCommitMessage)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RepositorySquashMergeCommitMessage? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RepositorySquashMergeCommitMessageExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositorySquashMergeCommitTitleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositorySquashMergeCommitTitleNullable.g.verified.cs
new file mode 100644
index 0000000000..6f3957c292
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositorySquashMergeCommitTitleNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RepositorySquashMergeCommitTitleNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RepositorySquashMergeCommitTitleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RepositorySquashMergeCommitTitle? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RepositorySquashMergeCommitTitleExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RepositorySquashMergeCommitTitle)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RepositorySquashMergeCommitTitle? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RepositorySquashMergeCommitTitleExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisAdvancedSecurityStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisAdvancedSecurityStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..c909cf90fa
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisAdvancedSecurityStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.SecurityAndAnalysisAdvancedSecurityStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class SecurityAndAnalysisAdvancedSecurityStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.SecurityAndAnalysisAdvancedSecurityStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.SecurityAndAnalysisAdvancedSecurityStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.SecurityAndAnalysisAdvancedSecurityStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.SecurityAndAnalysisAdvancedSecurityStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.SecurityAndAnalysisAdvancedSecurityStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisDependabotSecurityUpdatesStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisDependabotSecurityUpdatesStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..4ad5faa165
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisDependabotSecurityUpdatesStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.SecurityAndAnalysisDependabotSecurityUpdatesStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class SecurityAndAnalysisDependabotSecurityUpdatesStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.SecurityAndAnalysisDependabotSecurityUpdatesStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.SecurityAndAnalysisDependabotSecurityUpdatesStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.SecurityAndAnalysisDependabotSecurityUpdatesStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.SecurityAndAnalysisDependabotSecurityUpdatesStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.SecurityAndAnalysisDependabotSecurityUpdatesStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisSecretScanningPushProtectionStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisSecretScanningPushProtectionStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..e240be1aef
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisSecretScanningPushProtectionStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.SecurityAndAnalysisSecretScanningPushProtectionStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class SecurityAndAnalysisSecretScanningPushProtectionStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.SecurityAndAnalysisSecretScanningPushProtectionStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.SecurityAndAnalysisSecretScanningPushProtectionStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.SecurityAndAnalysisSecretScanningPushProtectionStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.SecurityAndAnalysisSecretScanningPushProtectionStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.SecurityAndAnalysisSecretScanningPushProtectionStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisSecretScanningStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisSecretScanningStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..864fd76993
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisSecretScanningStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.SecurityAndAnalysisSecretScanningStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class SecurityAndAnalysisSecretScanningStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.SecurityAndAnalysisSecretScanningStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.SecurityAndAnalysisSecretScanningStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.SecurityAndAnalysisSecretScanningStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.SecurityAndAnalysisSecretScanningStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.SecurityAndAnalysisSecretScanningStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
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 84822078dc..add477815b 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
@@ -72,7 +72,9 @@ public Api(
Converters =
{
new global::OpenApiGenerator.JsonConverters.AsnResponseTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.AsnResponseTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CompanyTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CompanyTypeNullableJsonConverter(),
}
};
}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#JsonConverters.AsnResponseTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#JsonConverters.AsnResponseTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..d69c619bf2
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#JsonConverters.AsnResponseTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.AsnResponseTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class AsnResponseTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.AsnResponseType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.AsnResponseTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.AsnResponseType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.AsnResponseType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.AsnResponseTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#JsonConverters.CompanyTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#JsonConverters.CompanyTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..737b6214a1
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#JsonConverters.CompanyTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CompanyTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CompanyTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CompanyType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CompanyTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CompanyType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CompanyType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CompanyTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
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 8c06801234..1f9893f40e 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
@@ -37,7 +37,9 @@ public Api(
Converters =
{
new global::OpenApiGenerator.JsonConverters.RunCreateSchemaExtendedRunTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunCreateSchemaExtendedRunTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunCreateSchemaRunTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunCreateSchemaRunTypeNullableJsonConverter(),
}
};
}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#JsonConverters.RunCreateSchemaExtendedRunTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#JsonConverters.RunCreateSchemaExtendedRunTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..ea5b716189
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#JsonConverters.RunCreateSchemaExtendedRunTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunCreateSchemaExtendedRunTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunCreateSchemaExtendedRunTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunCreateSchemaExtendedRunType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunCreateSchemaExtendedRunTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunCreateSchemaExtendedRunType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunCreateSchemaExtendedRunType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunCreateSchemaExtendedRunTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#JsonConverters.RunCreateSchemaRunTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#JsonConverters.RunCreateSchemaRunTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..386041298c
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#JsonConverters.RunCreateSchemaRunTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunCreateSchemaRunTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunCreateSchemaRunTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunCreateSchemaRunType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunCreateSchemaRunTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunCreateSchemaRunType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunCreateSchemaRunType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunCreateSchemaRunTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
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 e07319c241..d97e74149c 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
@@ -57,11 +57,17 @@ public Api(
Converters =
{
new global::OpenApiGenerator.JsonConverters.GenerateCompletionRequestFormatJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GenerateCompletionRequestFormatNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GenerateChatCompletionRequestFormatJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GenerateChatCompletionRequestFormatNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageRoleJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageRoleNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateModelResponseStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateModelResponseStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.PullModelResponseStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.PullModelResponseStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.PushModelResponseStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.PushModelResponseStatusNullableJsonConverter(),
}
};
}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.CreateModelResponseStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.CreateModelResponseStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..80c6dd56f6
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.CreateModelResponseStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateModelResponseStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateModelResponseStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateModelResponseStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateModelResponseStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateModelResponseStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateModelResponseStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateModelResponseStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.GenerateChatCompletionRequestFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.GenerateChatCompletionRequestFormatNullable.g.verified.cs
new file mode 100644
index 0000000000..6ca8b6f2f8
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.GenerateChatCompletionRequestFormatNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.GenerateChatCompletionRequestFormatNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class GenerateChatCompletionRequestFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.GenerateChatCompletionRequestFormat? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.GenerateChatCompletionRequestFormatExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.GenerateChatCompletionRequestFormat)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.GenerateChatCompletionRequestFormat? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.GenerateChatCompletionRequestFormatExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.GenerateCompletionRequestFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.GenerateCompletionRequestFormatNullable.g.verified.cs
new file mode 100644
index 0000000000..8d66b2527f
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.GenerateCompletionRequestFormatNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.GenerateCompletionRequestFormatNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class GenerateCompletionRequestFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.GenerateCompletionRequestFormat? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.GenerateCompletionRequestFormatExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.GenerateCompletionRequestFormat)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.GenerateCompletionRequestFormat? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.GenerateCompletionRequestFormatExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.MessageRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.MessageRoleNullable.g.verified.cs
new file mode 100644
index 0000000000..fcbc62b113
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.MessageRoleNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageRoleNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageRole? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageRoleExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageRole)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageRole? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageRoleExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.PullModelResponseStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.PullModelResponseStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..3f26ad91d2
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.PullModelResponseStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.PullModelResponseStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class PullModelResponseStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.PullModelResponseStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.PullModelResponseStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.PullModelResponseStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.PullModelResponseStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.PullModelResponseStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.PushModelResponseStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.PushModelResponseStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..f02750605f
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.PushModelResponseStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.PushModelResponseStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class PushModelResponseStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.PushModelResponseStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.PushModelResponseStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.PushModelResponseStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.PushModelResponseStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.PushModelResponseStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
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 be7d0e5cb0..260fc61fb6 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
@@ -97,175 +97,345 @@ public OpenAiClient(
Converters =
{
new global::OpenApiGenerator.JsonConverters.ListModelsResponseObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ListModelsResponseObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateCompletionRequestModelJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateCompletionRequestModelNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateCompletionResponseChoicesFinishReasonJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateCompletionResponseChoicesFinishReasonNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateCompletionResponseObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateCompletionResponseObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartImageImageUrlDetailJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartImageImageUrlDetailNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartImageTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartImageTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartTextTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartTextTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestSystemMessageRoleJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestSystemMessageRoleNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestUserMessageRoleJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestUserMessageRoleNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestAssistantMessageRoleJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestAssistantMessageRoleNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestToolMessageRoleJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestToolMessageRoleNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestFunctionMessageRoleJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestFunctionMessageRoleNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ChatCompletionToolTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ChatCompletionToolTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ChatCompletionNamedToolChoiceTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ChatCompletionNamedToolChoiceTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ChatCompletionMessageToolCallTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ChatCompletionMessageToolCallTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ChatCompletionMessageToolCallChunkTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ChatCompletionMessageToolCallChunkTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ChatCompletionResponseMessageRoleJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ChatCompletionResponseMessageRoleNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ChatCompletionStreamResponseDeltaRoleJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ChatCompletionStreamResponseDeltaRoleNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestResponseFormatTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestResponseFormatTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestModelJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestModelNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestToolChoiceJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestToolChoiceNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestFunctionCallJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestFunctionCallNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateChatCompletionResponseChoicesFinishReasonJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateChatCompletionResponseChoicesFinishReasonNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateChatCompletionResponseObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateChatCompletionResponseObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateChatCompletionFunctionResponseChoicesFinishReasonJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateChatCompletionFunctionResponseChoicesFinishReasonNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateChatCompletionFunctionResponseObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateChatCompletionFunctionResponseObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ListPaginatedFineTuningJobsResponseObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ListPaginatedFineTuningJobsResponseObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateChatCompletionStreamResponseChoicesFinishReasonJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateChatCompletionStreamResponseChoicesFinishReasonNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateChatCompletionStreamResponseObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateChatCompletionStreamResponseObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateImageRequestQualityJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateImageRequestQualityNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateImageRequestResponseFormatJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateImageRequestResponseFormatNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateImageRequestSizeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateImageRequestSizeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateImageRequestStyleJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateImageRequestStyleNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateImageRequestModelJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateImageRequestModelNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateImageEditRequestSizeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateImageEditRequestSizeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateImageEditRequestResponseFormatJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateImageEditRequestResponseFormatNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateImageEditRequestModelJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateImageEditRequestModelNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestResponseFormatJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestResponseFormatNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestSizeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestSizeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestModelJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestModelNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateModerationRequestModelJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateModerationRequestModelNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ListFilesResponseObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ListFilesResponseObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateFileRequestPurposeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateFileRequestPurposeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.DeleteFileResponseObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.DeleteFileResponseObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersBatchSizeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersBatchSizeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersNEpochsJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersNEpochsNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestIntegrationsTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestIntegrationsTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestModelJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestModelNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ListFineTuningJobEventsResponseObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ListFineTuningJobEventsResponseObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ListFineTuningJobCheckpointsResponseObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ListFineTuningJobCheckpointsResponseObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateEmbeddingRequestEncodingFormatJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateEmbeddingRequestEncodingFormatNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateEmbeddingRequestModelJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateEmbeddingRequestModelNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateEmbeddingResponseObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateEmbeddingResponseObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateTranscriptionRequestResponseFormatJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateTranscriptionRequestResponseFormatNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateTranscriptionRequestModelJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateTranscriptionRequestModelNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateTranslationRequestModelJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateTranslationRequestModelNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateSpeechRequestVoiceJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateSpeechRequestVoiceNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateSpeechRequestResponseFormatJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateSpeechRequestResponseFormatNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateSpeechRequestModelJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateSpeechRequestModelNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ModelObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ModelObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.OpenAIFileObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.OpenAIFileObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.OpenAIFilePurposeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.OpenAIFilePurposeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.OpenAIFileStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.OpenAIFileStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.EmbeddingObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.EmbeddingObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.FineTuningJobHyperparametersNEpochsJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.FineTuningJobHyperparametersNEpochsNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.FineTuningJobObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.FineTuningJobObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.FineTuningJobStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.FineTuningJobStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.FineTuningIntegrationTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.FineTuningIntegrationTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.FineTuningJobEventLevelJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.FineTuningJobEventLevelNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.FineTuningJobEventObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.FineTuningJobEventObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.FineTuningJobCheckpointObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.FineTuningJobCheckpointObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.AssistantsApiResponseFormatTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.AssistantsApiResponseFormatTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.AssistantObjectObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.AssistantObjectObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.AssistantObjectResponseFormatJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.AssistantObjectResponseFormatNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateAssistantRequestModelJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateAssistantRequestModelNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateAssistantRequestResponseFormatJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateAssistantRequestResponseFormatNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ModifyAssistantRequestResponseFormatJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ModifyAssistantRequestResponseFormatNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.DeleteAssistantResponseObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.DeleteAssistantResponseObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.AssistantToolsCodeTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.AssistantToolsCodeTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.AssistantToolsFileSearchTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.AssistantToolsFileSearchTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.AssistantToolsFunctionTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.AssistantToolsFunctionTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.TruncationObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.TruncationObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.AssistantsNamedToolChoiceTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.AssistantsNamedToolChoiceTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunObjectRequiredActionTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunObjectRequiredActionTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunObjectLastErrorCodeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunObjectLastErrorCodeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunObjectIncompleteDetailsReasonJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunObjectIncompleteDetailsReasonNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunObjectObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunObjectObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunObjectStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunObjectStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunObjectToolChoiceJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunObjectToolChoiceNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunObjectResponseFormatJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunObjectResponseFormatNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateRunRequestModelJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateRunRequestModelNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateRunRequestToolChoiceJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateRunRequestToolChoiceNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateRunRequestResponseFormatJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateRunRequestResponseFormatNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunToolCallObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunToolCallObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestModelJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestModelNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestToolChoiceJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestToolChoiceNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestResponseFormatJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestResponseFormatNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ThreadObjectObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ThreadObjectObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.DeleteThreadResponseObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.DeleteThreadResponseObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageObjectIncompleteDetailsReasonJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageObjectIncompleteDetailsReasonNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageObjectObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageObjectObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageObjectStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageObjectStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageObjectRoleJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageObjectRoleNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageDeltaObjectDeltaRoleJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageDeltaObjectDeltaRoleNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageDeltaObjectObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageDeltaObjectObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateMessageRequestRoleJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateMessageRequestRoleNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.DeleteMessageResponseObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.DeleteMessageResponseObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageContentImageFileObjectImageFileDetailJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageContentImageFileObjectImageFileDetailNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageContentImageFileObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageContentImageFileObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageFileObjectImageFileDetailJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageFileObjectImageFileDetailNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageFileObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageFileObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageContentImageUrlObjectImageUrlDetailJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageContentImageUrlObjectImageUrlDetailNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageContentImageUrlObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageContentImageUrlObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageUrlObjectImageUrlDetailJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageUrlObjectImageUrlDetailNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageUrlObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageUrlObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageContentTextObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageContentTextObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageRequestContentTextObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageRequestContentTextObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageContentTextAnnotationsFileCitationObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageContentTextAnnotationsFileCitationObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageContentTextAnnotationsFilePathObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageContentTextAnnotationsFilePathObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextAnnotationsFileCitationObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextAnnotationsFileCitationObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextAnnotationsFilePathObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextAnnotationsFilePathObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepObjectLastErrorCodeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepObjectLastErrorCodeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepObjectObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepObjectObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepObjectStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepObjectStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepDeltaObjectObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepDeltaObjectObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepDetailsMessageCreationObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepDetailsMessageCreationObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsMessageCreationObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsMessageCreationObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeOutputLogsObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeOutputLogsObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeOutputImageObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeOutputImageObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsFileSearchObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsFileSearchObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsFunctionObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsFunctionObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.VectorStoreExpirationAfterAnchorJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.VectorStoreExpirationAfterAnchorNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.VectorStoreObjectObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.VectorStoreObjectObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.VectorStoreObjectStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.VectorStoreObjectStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.DeleteVectorStoreResponseObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.DeleteVectorStoreResponseObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectLastErrorCodeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectLastErrorCodeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.DeleteVectorStoreFileResponseObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.DeleteVectorStoreFileResponseObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.VectorStoreFileBatchObjectObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.VectorStoreFileBatchObjectObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.VectorStoreFileBatchObjectStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.VectorStoreFileBatchObjectStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ErrorEventEventJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ErrorEventEventNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.DoneEventEventJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.DoneEventEventNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.DoneEventDataJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.DoneEventDataNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.BatchObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.BatchObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.BatchStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.BatchStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.BatchRequestInputMethodJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.BatchRequestInputMethodNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ListBatchesResponseObjectJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ListBatchesResponseObjectNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ListAssistantsOrderJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ListAssistantsOrderNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ListMessagesOrderJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ListMessagesOrderNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ListRunsOrderJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ListRunsOrderNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ListRunStepsOrderJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ListRunStepsOrderNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ListVectorStoresOrderJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ListVectorStoresOrderNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ListVectorStoreFilesOrderJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ListVectorStoreFilesOrderNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ListVectorStoreFilesFilterJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ListVectorStoreFilesFilterNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ListFilesInVectorStoreBatchOrderJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ListFilesInVectorStoreBatchOrderNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ListFilesInVectorStoreBatchFilterJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ListFilesInVectorStoreBatchFilterNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateBatchRequestEndpointJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateBatchRequestEndpointNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateBatchRequestCompletionWindowJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateBatchRequestCompletionWindowNullableJsonConverter(),
}
};
}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantObjectObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..6cfb04fb88
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantObjectObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.AssistantObjectObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class AssistantObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.AssistantObjectObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.AssistantObjectObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.AssistantObjectObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.AssistantObjectObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.AssistantObjectObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantObjectResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantObjectResponseFormatNullable.g.verified.cs
new file mode 100644
index 0000000000..6cd4987a78
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantObjectResponseFormatNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.AssistantObjectResponseFormatNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class AssistantObjectResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.AssistantObjectResponseFormat? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.AssistantObjectResponseFormatExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.AssistantObjectResponseFormat)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.AssistantObjectResponseFormat? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.AssistantObjectResponseFormatExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsCodeTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsCodeTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..e734d3b709
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsCodeTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.AssistantToolsCodeTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class AssistantToolsCodeTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.AssistantToolsCodeType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.AssistantToolsCodeTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.AssistantToolsCodeType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.AssistantToolsCodeType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.AssistantToolsCodeTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsFileSearchTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsFileSearchTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..539de41947
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsFileSearchTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.AssistantToolsFileSearchTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class AssistantToolsFileSearchTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.AssistantToolsFileSearchType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.AssistantToolsFileSearchTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.AssistantToolsFileSearchType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.AssistantToolsFileSearchType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.AssistantToolsFileSearchTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsFunctionTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsFunctionTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..c528b1570e
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsFunctionTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.AssistantToolsFunctionTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class AssistantToolsFunctionTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.AssistantToolsFunctionType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.AssistantToolsFunctionTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.AssistantToolsFunctionType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.AssistantToolsFunctionType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.AssistantToolsFunctionTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantsApiResponseFormatTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantsApiResponseFormatTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..f0893acb90
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantsApiResponseFormatTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.AssistantsApiResponseFormatTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class AssistantsApiResponseFormatTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.AssistantsApiResponseFormatType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.AssistantsApiResponseFormatTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.AssistantsApiResponseFormatType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.AssistantsApiResponseFormatType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.AssistantsApiResponseFormatTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantsNamedToolChoiceTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantsNamedToolChoiceTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..d6420732e4
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantsNamedToolChoiceTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.AssistantsNamedToolChoiceTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class AssistantsNamedToolChoiceTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.AssistantsNamedToolChoiceType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.AssistantsNamedToolChoiceTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.AssistantsNamedToolChoiceType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.AssistantsNamedToolChoiceType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.AssistantsNamedToolChoiceTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..4ad7ee3b6a
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.BatchObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class BatchObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.BatchObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.BatchObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.BatchObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.BatchObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.BatchObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchRequestInputMethodNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchRequestInputMethodNullable.g.verified.cs
new file mode 100644
index 0000000000..58cc17e59a
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchRequestInputMethodNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.BatchRequestInputMethodNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class BatchRequestInputMethodNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.BatchRequestInputMethod? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.BatchRequestInputMethodExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.BatchRequestInputMethod)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.BatchRequestInputMethod? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.BatchRequestInputMethodExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..a03b3782f8
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.BatchStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class BatchStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.BatchStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.BatchStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.BatchStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.BatchStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.BatchStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionMessageToolCallChunkTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionMessageToolCallChunkTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..25f20e9cf5
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionMessageToolCallChunkTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ChatCompletionMessageToolCallChunkTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionMessageToolCallChunkTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ChatCompletionMessageToolCallChunkType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ChatCompletionMessageToolCallChunkTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ChatCompletionMessageToolCallChunkType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ChatCompletionMessageToolCallChunkType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ChatCompletionMessageToolCallChunkTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionMessageToolCallTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionMessageToolCallTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..45ce8dc060
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionMessageToolCallTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ChatCompletionMessageToolCallTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionMessageToolCallTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ChatCompletionMessageToolCallType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ChatCompletionMessageToolCallTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ChatCompletionMessageToolCallType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ChatCompletionMessageToolCallType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ChatCompletionMessageToolCallTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionNamedToolChoiceTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionNamedToolChoiceTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..bc4da94024
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionNamedToolChoiceTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ChatCompletionNamedToolChoiceTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionNamedToolChoiceTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ChatCompletionNamedToolChoiceType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ChatCompletionNamedToolChoiceTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ChatCompletionNamedToolChoiceType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ChatCompletionNamedToolChoiceType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ChatCompletionNamedToolChoiceTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestAssistantMessageRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestAssistantMessageRoleNullable.g.verified.cs
new file mode 100644
index 0000000000..df2dd3f9ce
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestAssistantMessageRoleNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ChatCompletionRequestAssistantMessageRoleNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionRequestAssistantMessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ChatCompletionRequestAssistantMessageRole? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ChatCompletionRequestAssistantMessageRoleExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ChatCompletionRequestAssistantMessageRole)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ChatCompletionRequestAssistantMessageRole? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ChatCompletionRequestAssistantMessageRoleExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestFunctionMessageRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestFunctionMessageRoleNullable.g.verified.cs
new file mode 100644
index 0000000000..4aa361e9ee
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestFunctionMessageRoleNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ChatCompletionRequestFunctionMessageRoleNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionRequestFunctionMessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ChatCompletionRequestFunctionMessageRole? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ChatCompletionRequestFunctionMessageRoleExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ChatCompletionRequestFunctionMessageRole)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ChatCompletionRequestFunctionMessageRole? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ChatCompletionRequestFunctionMessageRoleExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartImageImageUrlDetailNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartImageImageUrlDetailNullable.g.verified.cs
new file mode 100644
index 0000000000..9f1de5143d
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartImageImageUrlDetailNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ChatCompletionRequestMessageContentPartImageImageUrlDetailNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionRequestMessageContentPartImageImageUrlDetailNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ChatCompletionRequestMessageContentPartImageImageUrlDetail? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ChatCompletionRequestMessageContentPartImageImageUrlDetailExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ChatCompletionRequestMessageContentPartImageImageUrlDetail)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ChatCompletionRequestMessageContentPartImageImageUrlDetail? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ChatCompletionRequestMessageContentPartImageImageUrlDetailExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartImageTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartImageTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..0497ed924b
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartImageTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ChatCompletionRequestMessageContentPartImageTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionRequestMessageContentPartImageTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ChatCompletionRequestMessageContentPartImageType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ChatCompletionRequestMessageContentPartImageTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ChatCompletionRequestMessageContentPartImageType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ChatCompletionRequestMessageContentPartImageType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ChatCompletionRequestMessageContentPartImageTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartTextTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartTextTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..8672cad063
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartTextTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ChatCompletionRequestMessageContentPartTextTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionRequestMessageContentPartTextTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ChatCompletionRequestMessageContentPartTextType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ChatCompletionRequestMessageContentPartTextTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ChatCompletionRequestMessageContentPartTextType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ChatCompletionRequestMessageContentPartTextType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ChatCompletionRequestMessageContentPartTextTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestSystemMessageRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestSystemMessageRoleNullable.g.verified.cs
new file mode 100644
index 0000000000..3d5c1abdd7
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestSystemMessageRoleNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ChatCompletionRequestSystemMessageRoleNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionRequestSystemMessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ChatCompletionRequestSystemMessageRole? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ChatCompletionRequestSystemMessageRoleExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ChatCompletionRequestSystemMessageRole)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ChatCompletionRequestSystemMessageRole? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ChatCompletionRequestSystemMessageRoleExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestToolMessageRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestToolMessageRoleNullable.g.verified.cs
new file mode 100644
index 0000000000..fef7bea3d8
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestToolMessageRoleNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ChatCompletionRequestToolMessageRoleNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionRequestToolMessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ChatCompletionRequestToolMessageRole? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ChatCompletionRequestToolMessageRoleExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ChatCompletionRequestToolMessageRole)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ChatCompletionRequestToolMessageRole? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ChatCompletionRequestToolMessageRoleExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestUserMessageRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestUserMessageRoleNullable.g.verified.cs
new file mode 100644
index 0000000000..14c5722377
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestUserMessageRoleNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ChatCompletionRequestUserMessageRoleNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionRequestUserMessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ChatCompletionRequestUserMessageRole? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ChatCompletionRequestUserMessageRoleExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ChatCompletionRequestUserMessageRole)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ChatCompletionRequestUserMessageRole? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ChatCompletionRequestUserMessageRoleExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionResponseMessageRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionResponseMessageRoleNullable.g.verified.cs
new file mode 100644
index 0000000000..d784c9fefa
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionResponseMessageRoleNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ChatCompletionResponseMessageRoleNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionResponseMessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ChatCompletionResponseMessageRole? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ChatCompletionResponseMessageRoleExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ChatCompletionResponseMessageRole)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ChatCompletionResponseMessageRole? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ChatCompletionResponseMessageRoleExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionStreamResponseDeltaRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionStreamResponseDeltaRoleNullable.g.verified.cs
new file mode 100644
index 0000000000..8b50f3682e
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionStreamResponseDeltaRoleNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ChatCompletionStreamResponseDeltaRoleNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionStreamResponseDeltaRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ChatCompletionStreamResponseDeltaRole? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ChatCompletionStreamResponseDeltaRoleExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ChatCompletionStreamResponseDeltaRole)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ChatCompletionStreamResponseDeltaRole? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ChatCompletionStreamResponseDeltaRoleExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionToolTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionToolTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..bdf8bb0e1e
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionToolTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ChatCompletionToolTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionToolTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ChatCompletionToolType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ChatCompletionToolTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ChatCompletionToolType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ChatCompletionToolType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ChatCompletionToolTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateAssistantRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateAssistantRequestModelNullable.g.verified.cs
new file mode 100644
index 0000000000..360194892c
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateAssistantRequestModelNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateAssistantRequestModelNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateAssistantRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateAssistantRequestModel? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateAssistantRequestModelExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateAssistantRequestModel)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateAssistantRequestModel? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateAssistantRequestModelExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateAssistantRequestResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateAssistantRequestResponseFormatNullable.g.verified.cs
new file mode 100644
index 0000000000..a7d34b0303
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateAssistantRequestResponseFormatNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateAssistantRequestResponseFormatNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateAssistantRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateAssistantRequestResponseFormat? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateAssistantRequestResponseFormatExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateAssistantRequestResponseFormat)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateAssistantRequestResponseFormat? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateAssistantRequestResponseFormatExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateBatchRequestCompletionWindowNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateBatchRequestCompletionWindowNullable.g.verified.cs
new file mode 100644
index 0000000000..05a6debef2
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateBatchRequestCompletionWindowNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateBatchRequestCompletionWindowNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateBatchRequestCompletionWindowNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateBatchRequestCompletionWindow? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateBatchRequestCompletionWindowExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateBatchRequestCompletionWindow)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateBatchRequestCompletionWindow? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateBatchRequestCompletionWindowExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateBatchRequestEndpointNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateBatchRequestEndpointNullable.g.verified.cs
new file mode 100644
index 0000000000..8aaa104817
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateBatchRequestEndpointNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateBatchRequestEndpointNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateBatchRequestEndpointNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateBatchRequestEndpoint? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateBatchRequestEndpointExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateBatchRequestEndpoint)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateBatchRequestEndpoint? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateBatchRequestEndpointExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionFunctionResponseChoicesFinishReasonNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionFunctionResponseChoicesFinishReasonNullable.g.verified.cs
new file mode 100644
index 0000000000..d3de6fbafa
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionFunctionResponseChoicesFinishReasonNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateChatCompletionFunctionResponseChoicesFinishReasonNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateChatCompletionFunctionResponseChoicesFinishReasonNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateChatCompletionFunctionResponseChoicesFinishReason? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateChatCompletionFunctionResponseChoicesFinishReasonExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateChatCompletionFunctionResponseChoicesFinishReason)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateChatCompletionFunctionResponseChoicesFinishReason? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateChatCompletionFunctionResponseChoicesFinishReasonExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionFunctionResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionFunctionResponseObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..3dc0f832d7
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionFunctionResponseObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateChatCompletionFunctionResponseObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateChatCompletionFunctionResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateChatCompletionFunctionResponseObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateChatCompletionFunctionResponseObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateChatCompletionFunctionResponseObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateChatCompletionFunctionResponseObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateChatCompletionFunctionResponseObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestFunctionCallNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestFunctionCallNullable.g.verified.cs
new file mode 100644
index 0000000000..8cd4cb5c98
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestFunctionCallNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateChatCompletionRequestFunctionCallNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateChatCompletionRequestFunctionCallNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateChatCompletionRequestFunctionCall? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateChatCompletionRequestFunctionCallExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateChatCompletionRequestFunctionCall)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateChatCompletionRequestFunctionCall? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateChatCompletionRequestFunctionCallExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestModelNullable.g.verified.cs
new file mode 100644
index 0000000000..126e99fbc7
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestModelNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateChatCompletionRequestModelNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateChatCompletionRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateChatCompletionRequestModel? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateChatCompletionRequestModelExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateChatCompletionRequestModel)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateChatCompletionRequestModel? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateChatCompletionRequestModelExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestResponseFormatTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestResponseFormatTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..9a21e59014
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestResponseFormatTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateChatCompletionRequestResponseFormatTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateChatCompletionRequestResponseFormatTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateChatCompletionRequestResponseFormatType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateChatCompletionRequestResponseFormatTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateChatCompletionRequestResponseFormatType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateChatCompletionRequestResponseFormatType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateChatCompletionRequestResponseFormatTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestToolChoiceNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestToolChoiceNullable.g.verified.cs
new file mode 100644
index 0000000000..1098720645
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestToolChoiceNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateChatCompletionRequestToolChoiceNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateChatCompletionRequestToolChoiceNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateChatCompletionRequestToolChoice? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateChatCompletionRequestToolChoiceExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateChatCompletionRequestToolChoice)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateChatCompletionRequestToolChoice? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateChatCompletionRequestToolChoiceExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionResponseChoicesFinishReasonNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionResponseChoicesFinishReasonNullable.g.verified.cs
new file mode 100644
index 0000000000..cc7e306bdd
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionResponseChoicesFinishReasonNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateChatCompletionResponseChoicesFinishReasonNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateChatCompletionResponseChoicesFinishReasonNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateChatCompletionResponseChoicesFinishReason? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateChatCompletionResponseChoicesFinishReasonExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateChatCompletionResponseChoicesFinishReason)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateChatCompletionResponseChoicesFinishReason? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateChatCompletionResponseChoicesFinishReasonExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionResponseObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..33c555b4a5
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionResponseObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateChatCompletionResponseObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateChatCompletionResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateChatCompletionResponseObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateChatCompletionResponseObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateChatCompletionResponseObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateChatCompletionResponseObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateChatCompletionResponseObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionStreamResponseChoicesFinishReasonNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionStreamResponseChoicesFinishReasonNullable.g.verified.cs
new file mode 100644
index 0000000000..05a024ed94
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionStreamResponseChoicesFinishReasonNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateChatCompletionStreamResponseChoicesFinishReasonNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateChatCompletionStreamResponseChoicesFinishReasonNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateChatCompletionStreamResponseChoicesFinishReason? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateChatCompletionStreamResponseChoicesFinishReasonExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateChatCompletionStreamResponseChoicesFinishReason)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateChatCompletionStreamResponseChoicesFinishReason? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateChatCompletionStreamResponseChoicesFinishReasonExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionStreamResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionStreamResponseObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..4cff1f55c3
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionStreamResponseObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateChatCompletionStreamResponseObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateChatCompletionStreamResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateChatCompletionStreamResponseObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateChatCompletionStreamResponseObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateChatCompletionStreamResponseObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateChatCompletionStreamResponseObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateChatCompletionStreamResponseObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionRequestModelNullable.g.verified.cs
new file mode 100644
index 0000000000..4193e5151f
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionRequestModelNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateCompletionRequestModelNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateCompletionRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateCompletionRequestModel? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateCompletionRequestModelExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateCompletionRequestModel)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateCompletionRequestModel? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateCompletionRequestModelExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionResponseChoicesFinishReasonNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionResponseChoicesFinishReasonNullable.g.verified.cs
new file mode 100644
index 0000000000..33cccbcf11
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionResponseChoicesFinishReasonNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateCompletionResponseChoicesFinishReasonNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateCompletionResponseChoicesFinishReasonNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateCompletionResponseChoicesFinishReason? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateCompletionResponseChoicesFinishReasonExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateCompletionResponseChoicesFinishReason)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateCompletionResponseChoicesFinishReason? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateCompletionResponseChoicesFinishReasonExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionResponseObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..e7f7d7766b
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionResponseObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateCompletionResponseObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateCompletionResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateCompletionResponseObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateCompletionResponseObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateCompletionResponseObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateCompletionResponseObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateCompletionResponseObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingRequestEncodingFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingRequestEncodingFormatNullable.g.verified.cs
new file mode 100644
index 0000000000..a66dc09ea6
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingRequestEncodingFormatNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateEmbeddingRequestEncodingFormatNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateEmbeddingRequestEncodingFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateEmbeddingRequestEncodingFormat? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateEmbeddingRequestEncodingFormatExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateEmbeddingRequestEncodingFormat)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateEmbeddingRequestEncodingFormat? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateEmbeddingRequestEncodingFormatExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingRequestModelNullable.g.verified.cs
new file mode 100644
index 0000000000..71abe472d9
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingRequestModelNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateEmbeddingRequestModelNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateEmbeddingRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateEmbeddingRequestModel? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateEmbeddingRequestModelExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateEmbeddingRequestModel)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateEmbeddingRequestModel? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateEmbeddingRequestModelExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingResponseObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..fe8607075a
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingResponseObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateEmbeddingResponseObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateEmbeddingResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateEmbeddingResponseObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateEmbeddingResponseObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateEmbeddingResponseObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateEmbeddingResponseObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateEmbeddingResponseObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFileRequestPurposeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFileRequestPurposeNullable.g.verified.cs
new file mode 100644
index 0000000000..ce75311157
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFileRequestPurposeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateFileRequestPurposeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateFileRequestPurposeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateFileRequestPurpose? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateFileRequestPurposeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateFileRequestPurpose)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateFileRequestPurpose? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateFileRequestPurposeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersBatchSizeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersBatchSizeNullable.g.verified.cs
new file mode 100644
index 0000000000..b88d419f43
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersBatchSizeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateFineTuningJobRequestHyperparametersBatchSizeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateFineTuningJobRequestHyperparametersBatchSizeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateFineTuningJobRequestHyperparametersBatchSize? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateFineTuningJobRequestHyperparametersBatchSizeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateFineTuningJobRequestHyperparametersBatchSize)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateFineTuningJobRequestHyperparametersBatchSize? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateFineTuningJobRequestHyperparametersBatchSizeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierNullable.g.verified.cs
new file mode 100644
index 0000000000..758f3cd49d
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateFineTuningJobRequestHyperparametersLearningRateMultiplierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateFineTuningJobRequestHyperparametersLearningRateMultiplier? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateFineTuningJobRequestHyperparametersLearningRateMultiplier)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateFineTuningJobRequestHyperparametersLearningRateMultiplier? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersNEpochsNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersNEpochsNullable.g.verified.cs
new file mode 100644
index 0000000000..433b49a3c5
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersNEpochsNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateFineTuningJobRequestHyperparametersNEpochsNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateFineTuningJobRequestHyperparametersNEpochsNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateFineTuningJobRequestHyperparametersNEpochs? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateFineTuningJobRequestHyperparametersNEpochsExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateFineTuningJobRequestHyperparametersNEpochs)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateFineTuningJobRequestHyperparametersNEpochs? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateFineTuningJobRequestHyperparametersNEpochsExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestIntegrationsTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestIntegrationsTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..812b8f8107
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestIntegrationsTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateFineTuningJobRequestIntegrationsTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateFineTuningJobRequestIntegrationsTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateFineTuningJobRequestIntegrationsType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateFineTuningJobRequestIntegrationsTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateFineTuningJobRequestIntegrationsType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateFineTuningJobRequestIntegrationsType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateFineTuningJobRequestIntegrationsTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestModelNullable.g.verified.cs
new file mode 100644
index 0000000000..c4cfbf1d7a
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestModelNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateFineTuningJobRequestModelNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateFineTuningJobRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateFineTuningJobRequestModel? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateFineTuningJobRequestModelExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateFineTuningJobRequestModel)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateFineTuningJobRequestModel? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateFineTuningJobRequestModelExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestModelNullable.g.verified.cs
new file mode 100644
index 0000000000..f1d180687b
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestModelNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateImageEditRequestModelNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateImageEditRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateImageEditRequestModel? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateImageEditRequestModelExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateImageEditRequestModel)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateImageEditRequestModel? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateImageEditRequestModelExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestResponseFormatNullable.g.verified.cs
new file mode 100644
index 0000000000..750eb85fb2
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestResponseFormatNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateImageEditRequestResponseFormatNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateImageEditRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateImageEditRequestResponseFormat? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateImageEditRequestResponseFormatExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateImageEditRequestResponseFormat)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateImageEditRequestResponseFormat? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateImageEditRequestResponseFormatExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestSizeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestSizeNullable.g.verified.cs
new file mode 100644
index 0000000000..75b608aaf7
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestSizeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateImageEditRequestSizeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateImageEditRequestSizeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateImageEditRequestSize? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateImageEditRequestSizeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateImageEditRequestSize)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateImageEditRequestSize? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateImageEditRequestSizeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestModelNullable.g.verified.cs
new file mode 100644
index 0000000000..a075d4e668
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestModelNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateImageRequestModelNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateImageRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateImageRequestModel? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateImageRequestModelExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateImageRequestModel)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateImageRequestModel? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateImageRequestModelExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestQualityNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestQualityNullable.g.verified.cs
new file mode 100644
index 0000000000..167ce18894
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestQualityNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateImageRequestQualityNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateImageRequestQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateImageRequestQuality? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateImageRequestQualityExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateImageRequestQuality)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateImageRequestQuality? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateImageRequestQualityExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestResponseFormatNullable.g.verified.cs
new file mode 100644
index 0000000000..c9d1a85e65
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestResponseFormatNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateImageRequestResponseFormatNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateImageRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateImageRequestResponseFormat? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateImageRequestResponseFormatExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateImageRequestResponseFormat)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateImageRequestResponseFormat? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateImageRequestResponseFormatExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestSizeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestSizeNullable.g.verified.cs
new file mode 100644
index 0000000000..3379e2c1b0
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestSizeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateImageRequestSizeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateImageRequestSizeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateImageRequestSize? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateImageRequestSizeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateImageRequestSize)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateImageRequestSize? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateImageRequestSizeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestStyleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestStyleNullable.g.verified.cs
new file mode 100644
index 0000000000..d11f04c17a
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestStyleNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateImageRequestStyleNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateImageRequestStyleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateImageRequestStyle? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateImageRequestStyleExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateImageRequestStyle)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateImageRequestStyle? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateImageRequestStyleExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestModelNullable.g.verified.cs
new file mode 100644
index 0000000000..707646facf
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestModelNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateImageVariationRequestModelNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateImageVariationRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateImageVariationRequestModel? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateImageVariationRequestModelExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateImageVariationRequestModel)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateImageVariationRequestModel? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateImageVariationRequestModelExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestResponseFormatNullable.g.verified.cs
new file mode 100644
index 0000000000..abf7588e76
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestResponseFormatNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateImageVariationRequestResponseFormatNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateImageVariationRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateImageVariationRequestResponseFormat? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateImageVariationRequestResponseFormatExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateImageVariationRequestResponseFormat)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateImageVariationRequestResponseFormat? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateImageVariationRequestResponseFormatExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestSizeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestSizeNullable.g.verified.cs
new file mode 100644
index 0000000000..b2a03fe7f9
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestSizeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateImageVariationRequestSizeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateImageVariationRequestSizeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateImageVariationRequestSize? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateImageVariationRequestSizeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateImageVariationRequestSize)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateImageVariationRequestSize? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateImageVariationRequestSizeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateMessageRequestRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateMessageRequestRoleNullable.g.verified.cs
new file mode 100644
index 0000000000..7478154b49
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateMessageRequestRoleNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateMessageRequestRoleNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateMessageRequestRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateMessageRequestRole? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateMessageRequestRoleExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateMessageRequestRole)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateMessageRequestRole? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateMessageRequestRoleExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateModerationRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateModerationRequestModelNullable.g.verified.cs
new file mode 100644
index 0000000000..c21bfb583e
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateModerationRequestModelNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateModerationRequestModelNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateModerationRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateModerationRequestModel? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateModerationRequestModelExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateModerationRequestModel)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateModerationRequestModel? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateModerationRequestModelExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestModelNullable.g.verified.cs
new file mode 100644
index 0000000000..98bebf1631
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestModelNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateRunRequestModelNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateRunRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateRunRequestModel? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateRunRequestModelExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateRunRequestModel)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateRunRequestModel? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateRunRequestModelExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestResponseFormatNullable.g.verified.cs
new file mode 100644
index 0000000000..703fb13288
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestResponseFormatNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateRunRequestResponseFormatNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateRunRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateRunRequestResponseFormat? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateRunRequestResponseFormatExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateRunRequestResponseFormat)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateRunRequestResponseFormat? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateRunRequestResponseFormatExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestToolChoiceNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestToolChoiceNullable.g.verified.cs
new file mode 100644
index 0000000000..b6171b5715
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestToolChoiceNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateRunRequestToolChoiceNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateRunRequestToolChoiceNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateRunRequestToolChoice? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateRunRequestToolChoiceExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateRunRequestToolChoice)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateRunRequestToolChoice? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateRunRequestToolChoiceExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestModelNullable.g.verified.cs
new file mode 100644
index 0000000000..039cf24893
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestModelNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateSpeechRequestModelNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateSpeechRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateSpeechRequestModel? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateSpeechRequestModelExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateSpeechRequestModel)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateSpeechRequestModel? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateSpeechRequestModelExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestResponseFormatNullable.g.verified.cs
new file mode 100644
index 0000000000..0433b4d186
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestResponseFormatNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateSpeechRequestResponseFormatNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateSpeechRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateSpeechRequestResponseFormat? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateSpeechRequestResponseFormatExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateSpeechRequestResponseFormat)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateSpeechRequestResponseFormat? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateSpeechRequestResponseFormatExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestVoiceNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestVoiceNullable.g.verified.cs
new file mode 100644
index 0000000000..9c5172f17f
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestVoiceNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateSpeechRequestVoiceNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateSpeechRequestVoiceNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateSpeechRequestVoice? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateSpeechRequestVoiceExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateSpeechRequestVoice)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateSpeechRequestVoice? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateSpeechRequestVoiceExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestModelNullable.g.verified.cs
new file mode 100644
index 0000000000..90b9b1e0db
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestModelNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateThreadAndRunRequestModelNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateThreadAndRunRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateThreadAndRunRequestModel? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateThreadAndRunRequestModelExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateThreadAndRunRequestModel)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateThreadAndRunRequestModel? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateThreadAndRunRequestModelExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestResponseFormatNullable.g.verified.cs
new file mode 100644
index 0000000000..c8e54faf29
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestResponseFormatNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateThreadAndRunRequestResponseFormatNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateThreadAndRunRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateThreadAndRunRequestResponseFormat? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateThreadAndRunRequestResponseFormatExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateThreadAndRunRequestResponseFormat)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateThreadAndRunRequestResponseFormat? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateThreadAndRunRequestResponseFormatExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestToolChoiceNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestToolChoiceNullable.g.verified.cs
new file mode 100644
index 0000000000..cf9656f40d
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestToolChoiceNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateThreadAndRunRequestToolChoiceNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateThreadAndRunRequestToolChoiceNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateThreadAndRunRequestToolChoice? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateThreadAndRunRequestToolChoiceExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateThreadAndRunRequestToolChoice)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateThreadAndRunRequestToolChoice? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateThreadAndRunRequestToolChoiceExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranscriptionRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranscriptionRequestModelNullable.g.verified.cs
new file mode 100644
index 0000000000..ec41643c8a
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranscriptionRequestModelNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateTranscriptionRequestModelNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateTranscriptionRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateTranscriptionRequestModel? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateTranscriptionRequestModelExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateTranscriptionRequestModel)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateTranscriptionRequestModel? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateTranscriptionRequestModelExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranscriptionRequestResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranscriptionRequestResponseFormatNullable.g.verified.cs
new file mode 100644
index 0000000000..2fea5eaeff
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranscriptionRequestResponseFormatNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateTranscriptionRequestResponseFormatNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateTranscriptionRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateTranscriptionRequestResponseFormat? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateTranscriptionRequestResponseFormatExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateTranscriptionRequestResponseFormat)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateTranscriptionRequestResponseFormat? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateTranscriptionRequestResponseFormatExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranslationRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranslationRequestModelNullable.g.verified.cs
new file mode 100644
index 0000000000..972f9c2b93
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranslationRequestModelNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateTranslationRequestModelNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateTranslationRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateTranslationRequestModel? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateTranslationRequestModelExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateTranslationRequestModel)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateTranslationRequestModel? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateTranslationRequestModelExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteAssistantResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteAssistantResponseObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..ef5f42aeec
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteAssistantResponseObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.DeleteAssistantResponseObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class DeleteAssistantResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.DeleteAssistantResponseObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.DeleteAssistantResponseObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.DeleteAssistantResponseObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.DeleteAssistantResponseObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.DeleteAssistantResponseObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteFileResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteFileResponseObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..0b524f6d89
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteFileResponseObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.DeleteFileResponseObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class DeleteFileResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.DeleteFileResponseObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.DeleteFileResponseObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.DeleteFileResponseObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.DeleteFileResponseObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.DeleteFileResponseObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteMessageResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteMessageResponseObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..914a76bfcc
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteMessageResponseObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.DeleteMessageResponseObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class DeleteMessageResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.DeleteMessageResponseObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.DeleteMessageResponseObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.DeleteMessageResponseObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.DeleteMessageResponseObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.DeleteMessageResponseObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteThreadResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteThreadResponseObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..858c1e9512
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteThreadResponseObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.DeleteThreadResponseObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class DeleteThreadResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.DeleteThreadResponseObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.DeleteThreadResponseObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.DeleteThreadResponseObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.DeleteThreadResponseObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.DeleteThreadResponseObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteVectorStoreFileResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteVectorStoreFileResponseObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..9021051526
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteVectorStoreFileResponseObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.DeleteVectorStoreFileResponseObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class DeleteVectorStoreFileResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.DeleteVectorStoreFileResponseObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.DeleteVectorStoreFileResponseObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.DeleteVectorStoreFileResponseObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.DeleteVectorStoreFileResponseObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.DeleteVectorStoreFileResponseObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteVectorStoreResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteVectorStoreResponseObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..4490e328d2
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteVectorStoreResponseObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.DeleteVectorStoreResponseObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class DeleteVectorStoreResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.DeleteVectorStoreResponseObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.DeleteVectorStoreResponseObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.DeleteVectorStoreResponseObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.DeleteVectorStoreResponseObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.DeleteVectorStoreResponseObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DoneEventDataNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DoneEventDataNullable.g.verified.cs
new file mode 100644
index 0000000000..081b410688
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DoneEventDataNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.DoneEventDataNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class DoneEventDataNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.DoneEventData? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.DoneEventDataExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.DoneEventData)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.DoneEventData? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.DoneEventDataExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DoneEventEventNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DoneEventEventNullable.g.verified.cs
new file mode 100644
index 0000000000..f335ff1bda
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DoneEventEventNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.DoneEventEventNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class DoneEventEventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.DoneEventEvent? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.DoneEventEventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.DoneEventEvent)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.DoneEventEvent? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.DoneEventEventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.EmbeddingObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.EmbeddingObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..c5f6b43f43
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.EmbeddingObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.EmbeddingObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class EmbeddingObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.EmbeddingObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.EmbeddingObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.EmbeddingObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.EmbeddingObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.EmbeddingObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ErrorEventEventNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ErrorEventEventNullable.g.verified.cs
new file mode 100644
index 0000000000..4f2bbf8817
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ErrorEventEventNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ErrorEventEventNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ErrorEventEventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ErrorEventEvent? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ErrorEventEventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ErrorEventEvent)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ErrorEventEvent? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ErrorEventEventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningIntegrationTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningIntegrationTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..924381d9ef
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningIntegrationTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.FineTuningIntegrationTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class FineTuningIntegrationTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.FineTuningIntegrationType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.FineTuningIntegrationTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.FineTuningIntegrationType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.FineTuningIntegrationType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.FineTuningIntegrationTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobCheckpointObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobCheckpointObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..56b8afbbf8
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobCheckpointObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.FineTuningJobCheckpointObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class FineTuningJobCheckpointObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.FineTuningJobCheckpointObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.FineTuningJobCheckpointObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.FineTuningJobCheckpointObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.FineTuningJobCheckpointObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.FineTuningJobCheckpointObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobEventLevelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobEventLevelNullable.g.verified.cs
new file mode 100644
index 0000000000..6eb2d5c67e
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobEventLevelNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.FineTuningJobEventLevelNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class FineTuningJobEventLevelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.FineTuningJobEventLevel? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.FineTuningJobEventLevelExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.FineTuningJobEventLevel)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.FineTuningJobEventLevel? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.FineTuningJobEventLevelExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobEventObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobEventObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..323c45cd5f
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobEventObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.FineTuningJobEventObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class FineTuningJobEventObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.FineTuningJobEventObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.FineTuningJobEventObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.FineTuningJobEventObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.FineTuningJobEventObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.FineTuningJobEventObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobHyperparametersNEpochsNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobHyperparametersNEpochsNullable.g.verified.cs
new file mode 100644
index 0000000000..5cf30765d7
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobHyperparametersNEpochsNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.FineTuningJobHyperparametersNEpochsNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class FineTuningJobHyperparametersNEpochsNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.FineTuningJobHyperparametersNEpochs? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.FineTuningJobHyperparametersNEpochsExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.FineTuningJobHyperparametersNEpochs)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.FineTuningJobHyperparametersNEpochs? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.FineTuningJobHyperparametersNEpochsExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..74b9ff318b
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.FineTuningJobObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class FineTuningJobObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.FineTuningJobObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.FineTuningJobObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.FineTuningJobObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.FineTuningJobObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.FineTuningJobObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..747b1093ce
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.FineTuningJobStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class FineTuningJobStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.FineTuningJobStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.FineTuningJobStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.FineTuningJobStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.FineTuningJobStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.FineTuningJobStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListAssistantsOrderNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListAssistantsOrderNullable.g.verified.cs
new file mode 100644
index 0000000000..792437ba07
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListAssistantsOrderNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ListAssistantsOrderNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ListAssistantsOrderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ListAssistantsOrder? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ListAssistantsOrderExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ListAssistantsOrder)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ListAssistantsOrder? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ListAssistantsOrderExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListBatchesResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListBatchesResponseObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..ec857902f7
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListBatchesResponseObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ListBatchesResponseObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ListBatchesResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ListBatchesResponseObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ListBatchesResponseObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ListBatchesResponseObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ListBatchesResponseObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ListBatchesResponseObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesInVectorStoreBatchFilterNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesInVectorStoreBatchFilterNullable.g.verified.cs
new file mode 100644
index 0000000000..b46d6f2478
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesInVectorStoreBatchFilterNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ListFilesInVectorStoreBatchFilterNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ListFilesInVectorStoreBatchFilterNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ListFilesInVectorStoreBatchFilter? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ListFilesInVectorStoreBatchFilterExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ListFilesInVectorStoreBatchFilter)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ListFilesInVectorStoreBatchFilter? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ListFilesInVectorStoreBatchFilterExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesInVectorStoreBatchOrderNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesInVectorStoreBatchOrderNullable.g.verified.cs
new file mode 100644
index 0000000000..a834ee3675
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesInVectorStoreBatchOrderNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ListFilesInVectorStoreBatchOrderNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ListFilesInVectorStoreBatchOrderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ListFilesInVectorStoreBatchOrder? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ListFilesInVectorStoreBatchOrderExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ListFilesInVectorStoreBatchOrder)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ListFilesInVectorStoreBatchOrder? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ListFilesInVectorStoreBatchOrderExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesResponseObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..a08f630e8a
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesResponseObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ListFilesResponseObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ListFilesResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ListFilesResponseObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ListFilesResponseObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ListFilesResponseObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ListFilesResponseObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ListFilesResponseObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFineTuningJobCheckpointsResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFineTuningJobCheckpointsResponseObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..ad16455aff
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFineTuningJobCheckpointsResponseObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ListFineTuningJobCheckpointsResponseObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ListFineTuningJobCheckpointsResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ListFineTuningJobCheckpointsResponseObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ListFineTuningJobCheckpointsResponseObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ListFineTuningJobCheckpointsResponseObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ListFineTuningJobCheckpointsResponseObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ListFineTuningJobCheckpointsResponseObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFineTuningJobEventsResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFineTuningJobEventsResponseObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..23edb9b401
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFineTuningJobEventsResponseObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ListFineTuningJobEventsResponseObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ListFineTuningJobEventsResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ListFineTuningJobEventsResponseObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ListFineTuningJobEventsResponseObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ListFineTuningJobEventsResponseObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ListFineTuningJobEventsResponseObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ListFineTuningJobEventsResponseObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListMessagesOrderNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListMessagesOrderNullable.g.verified.cs
new file mode 100644
index 0000000000..cf47dc8511
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListMessagesOrderNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ListMessagesOrderNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ListMessagesOrderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ListMessagesOrder? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ListMessagesOrderExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ListMessagesOrder)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ListMessagesOrder? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ListMessagesOrderExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListModelsResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListModelsResponseObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..a52253cf3e
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListModelsResponseObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ListModelsResponseObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ListModelsResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ListModelsResponseObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ListModelsResponseObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ListModelsResponseObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ListModelsResponseObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ListModelsResponseObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListPaginatedFineTuningJobsResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListPaginatedFineTuningJobsResponseObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..65da633086
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListPaginatedFineTuningJobsResponseObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ListPaginatedFineTuningJobsResponseObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ListPaginatedFineTuningJobsResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ListPaginatedFineTuningJobsResponseObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ListPaginatedFineTuningJobsResponseObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ListPaginatedFineTuningJobsResponseObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ListPaginatedFineTuningJobsResponseObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ListPaginatedFineTuningJobsResponseObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListRunStepsOrderNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListRunStepsOrderNullable.g.verified.cs
new file mode 100644
index 0000000000..c22ea276be
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListRunStepsOrderNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ListRunStepsOrderNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ListRunStepsOrderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ListRunStepsOrder? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ListRunStepsOrderExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ListRunStepsOrder)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ListRunStepsOrder? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ListRunStepsOrderExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListRunsOrderNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListRunsOrderNullable.g.verified.cs
new file mode 100644
index 0000000000..9ded09ce61
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListRunsOrderNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ListRunsOrderNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ListRunsOrderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ListRunsOrder? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ListRunsOrderExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ListRunsOrder)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ListRunsOrder? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ListRunsOrderExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoreFilesFilterNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoreFilesFilterNullable.g.verified.cs
new file mode 100644
index 0000000000..57b3f397e9
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoreFilesFilterNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ListVectorStoreFilesFilterNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ListVectorStoreFilesFilterNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ListVectorStoreFilesFilter? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ListVectorStoreFilesFilterExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ListVectorStoreFilesFilter)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ListVectorStoreFilesFilter? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ListVectorStoreFilesFilterExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoreFilesOrderNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoreFilesOrderNullable.g.verified.cs
new file mode 100644
index 0000000000..d9e83a839e
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoreFilesOrderNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ListVectorStoreFilesOrderNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ListVectorStoreFilesOrderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ListVectorStoreFilesOrder? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ListVectorStoreFilesOrderExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ListVectorStoreFilesOrder)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ListVectorStoreFilesOrder? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ListVectorStoreFilesOrderExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoresOrderNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoresOrderNullable.g.verified.cs
new file mode 100644
index 0000000000..7303143f25
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoresOrderNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ListVectorStoresOrderNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ListVectorStoresOrderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ListVectorStoresOrder? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ListVectorStoresOrderExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ListVectorStoresOrder)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ListVectorStoresOrder? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ListVectorStoresOrderExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageFileObjectImageFileDetailNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageFileObjectImageFileDetailNullable.g.verified.cs
new file mode 100644
index 0000000000..7a52750a7f
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageFileObjectImageFileDetailNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageContentImageFileObjectImageFileDetailNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageContentImageFileObjectImageFileDetailNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageContentImageFileObjectImageFileDetail? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageContentImageFileObjectImageFileDetailExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageContentImageFileObjectImageFileDetail)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageContentImageFileObjectImageFileDetail? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageContentImageFileObjectImageFileDetailExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageFileObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageFileObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..3c1361a436
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageFileObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageContentImageFileObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageContentImageFileObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageContentImageFileObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageContentImageFileObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageContentImageFileObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageContentImageFileObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageContentImageFileObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageUrlObjectImageUrlDetailNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageUrlObjectImageUrlDetailNullable.g.verified.cs
new file mode 100644
index 0000000000..7eba0e3a7a
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageUrlObjectImageUrlDetailNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageContentImageUrlObjectImageUrlDetailNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageContentImageUrlObjectImageUrlDetailNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageContentImageUrlObjectImageUrlDetail? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageContentImageUrlObjectImageUrlDetailExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageContentImageUrlObjectImageUrlDetail)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageContentImageUrlObjectImageUrlDetail? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageContentImageUrlObjectImageUrlDetailExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageUrlObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageUrlObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..6397268b19
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageUrlObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageContentImageUrlObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageContentImageUrlObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageContentImageUrlObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageContentImageUrlObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageContentImageUrlObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageContentImageUrlObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageContentImageUrlObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextAnnotationsFileCitationObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextAnnotationsFileCitationObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..f491262757
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextAnnotationsFileCitationObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageContentTextAnnotationsFileCitationObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageContentTextAnnotationsFileCitationObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageContentTextAnnotationsFileCitationObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageContentTextAnnotationsFileCitationObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageContentTextAnnotationsFileCitationObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageContentTextAnnotationsFileCitationObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageContentTextAnnotationsFileCitationObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextAnnotationsFilePathObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextAnnotationsFilePathObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..868f6d6bb2
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextAnnotationsFilePathObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageContentTextAnnotationsFilePathObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageContentTextAnnotationsFilePathObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageContentTextAnnotationsFilePathObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageContentTextAnnotationsFilePathObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageContentTextAnnotationsFilePathObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageContentTextAnnotationsFilePathObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageContentTextAnnotationsFilePathObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..8bededeffa
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageContentTextObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageContentTextObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageContentTextObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageContentTextObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageContentTextObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageContentTextObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageContentTextObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageFileObjectImageFileDetailNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageFileObjectImageFileDetailNullable.g.verified.cs
new file mode 100644
index 0000000000..daf6079848
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageFileObjectImageFileDetailNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageDeltaContentImageFileObjectImageFileDetailNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageDeltaContentImageFileObjectImageFileDetailNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageDeltaContentImageFileObjectImageFileDetail? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageDeltaContentImageFileObjectImageFileDetailExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageDeltaContentImageFileObjectImageFileDetail)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageDeltaContentImageFileObjectImageFileDetail? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageDeltaContentImageFileObjectImageFileDetailExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageFileObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageFileObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..aa842dcb45
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageFileObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageDeltaContentImageFileObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageDeltaContentImageFileObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageDeltaContentImageFileObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageDeltaContentImageFileObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageDeltaContentImageFileObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageDeltaContentImageFileObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageDeltaContentImageFileObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageUrlObjectImageUrlDetailNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageUrlObjectImageUrlDetailNullable.g.verified.cs
new file mode 100644
index 0000000000..08da881a4a
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageUrlObjectImageUrlDetailNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageDeltaContentImageUrlObjectImageUrlDetailNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageDeltaContentImageUrlObjectImageUrlDetailNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageDeltaContentImageUrlObjectImageUrlDetail? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageDeltaContentImageUrlObjectImageUrlDetailExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageDeltaContentImageUrlObjectImageUrlDetail)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageDeltaContentImageUrlObjectImageUrlDetail? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageDeltaContentImageUrlObjectImageUrlDetailExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageUrlObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageUrlObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..72604eecd9
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageUrlObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageDeltaContentImageUrlObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageDeltaContentImageUrlObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageDeltaContentImageUrlObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageDeltaContentImageUrlObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageDeltaContentImageUrlObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageDeltaContentImageUrlObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageDeltaContentImageUrlObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextAnnotationsFileCitationObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextAnnotationsFileCitationObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..a96d445fda
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextAnnotationsFileCitationObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageDeltaContentTextAnnotationsFileCitationObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageDeltaContentTextAnnotationsFileCitationObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageDeltaContentTextAnnotationsFileCitationObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageDeltaContentTextAnnotationsFileCitationObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageDeltaContentTextAnnotationsFileCitationObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageDeltaContentTextAnnotationsFileCitationObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageDeltaContentTextAnnotationsFileCitationObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextAnnotationsFilePathObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextAnnotationsFilePathObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..b687853831
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextAnnotationsFilePathObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageDeltaContentTextAnnotationsFilePathObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageDeltaContentTextAnnotationsFilePathObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageDeltaContentTextAnnotationsFilePathObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageDeltaContentTextAnnotationsFilePathObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageDeltaContentTextAnnotationsFilePathObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageDeltaContentTextAnnotationsFilePathObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageDeltaContentTextAnnotationsFilePathObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..57b63acd8a
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageDeltaContentTextObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageDeltaContentTextObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageDeltaContentTextObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageDeltaContentTextObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageDeltaContentTextObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageDeltaContentTextObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageDeltaContentTextObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaObjectDeltaRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaObjectDeltaRoleNullable.g.verified.cs
new file mode 100644
index 0000000000..1a269f4b62
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaObjectDeltaRoleNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageDeltaObjectDeltaRoleNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageDeltaObjectDeltaRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageDeltaObjectDeltaRole? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageDeltaObjectDeltaRoleExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageDeltaObjectDeltaRole)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageDeltaObjectDeltaRole? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageDeltaObjectDeltaRoleExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaObjectObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..b76adcb1c3
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaObjectObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageDeltaObjectObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageDeltaObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageDeltaObjectObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageDeltaObjectObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageDeltaObjectObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageDeltaObjectObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageDeltaObjectObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectIncompleteDetailsReasonNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectIncompleteDetailsReasonNullable.g.verified.cs
new file mode 100644
index 0000000000..fff45ed4d8
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectIncompleteDetailsReasonNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageObjectIncompleteDetailsReasonNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageObjectIncompleteDetailsReasonNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageObjectIncompleteDetailsReason? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageObjectIncompleteDetailsReasonExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageObjectIncompleteDetailsReason)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageObjectIncompleteDetailsReason? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageObjectIncompleteDetailsReasonExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..4a3a21505c
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageObjectObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageObjectObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageObjectObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageObjectObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageObjectObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageObjectObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectRoleNullable.g.verified.cs
new file mode 100644
index 0000000000..7816cb2ab0
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectRoleNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageObjectRoleNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageObjectRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageObjectRole? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageObjectRoleExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageObjectRole)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageObjectRole? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageObjectRoleExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..08c237fa73
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageObjectStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageObjectStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageObjectStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageObjectStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageObjectStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageObjectStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageObjectStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageRequestContentTextObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageRequestContentTextObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..a9990684a7
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageRequestContentTextObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.MessageRequestContentTextObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class MessageRequestContentTextObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.MessageRequestContentTextObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.MessageRequestContentTextObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.MessageRequestContentTextObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.MessageRequestContentTextObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.MessageRequestContentTextObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ModelObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ModelObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..9b16725281
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ModelObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ModelObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ModelObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ModelObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ModelObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ModelObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ModelObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ModelObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ModifyAssistantRequestResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ModifyAssistantRequestResponseFormatNullable.g.verified.cs
new file mode 100644
index 0000000000..c71c8b046c
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ModifyAssistantRequestResponseFormatNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ModifyAssistantRequestResponseFormatNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ModifyAssistantRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ModifyAssistantRequestResponseFormat? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ModifyAssistantRequestResponseFormatExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ModifyAssistantRequestResponseFormat)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ModifyAssistantRequestResponseFormat? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ModifyAssistantRequestResponseFormatExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFileObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFileObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..eb3688c874
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFileObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.OpenAIFileObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class OpenAIFileObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.OpenAIFileObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.OpenAIFileObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.OpenAIFileObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.OpenAIFileObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.OpenAIFileObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFilePurposeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFilePurposeNullable.g.verified.cs
new file mode 100644
index 0000000000..6f2994e3b8
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFilePurposeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.OpenAIFilePurposeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class OpenAIFilePurposeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.OpenAIFilePurpose? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.OpenAIFilePurposeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.OpenAIFilePurpose)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.OpenAIFilePurpose? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.OpenAIFilePurposeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFileStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFileStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..8a84b0dd18
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFileStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.OpenAIFileStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class OpenAIFileStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.OpenAIFileStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.OpenAIFileStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.OpenAIFileStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.OpenAIFileStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.OpenAIFileStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectIncompleteDetailsReasonNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectIncompleteDetailsReasonNullable.g.verified.cs
new file mode 100644
index 0000000000..8b1b1a49dc
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectIncompleteDetailsReasonNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunObjectIncompleteDetailsReasonNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunObjectIncompleteDetailsReasonNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunObjectIncompleteDetailsReason? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunObjectIncompleteDetailsReasonExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunObjectIncompleteDetailsReason)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunObjectIncompleteDetailsReason? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunObjectIncompleteDetailsReasonExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectLastErrorCodeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectLastErrorCodeNullable.g.verified.cs
new file mode 100644
index 0000000000..e49f913eee
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectLastErrorCodeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunObjectLastErrorCodeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunObjectLastErrorCodeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunObjectLastErrorCode? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunObjectLastErrorCodeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunObjectLastErrorCode)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunObjectLastErrorCode? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunObjectLastErrorCodeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..a96cfcc663
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunObjectObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunObjectObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunObjectObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunObjectObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunObjectObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunObjectObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectRequiredActionTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectRequiredActionTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..982b360a20
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectRequiredActionTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunObjectRequiredActionTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunObjectRequiredActionTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunObjectRequiredActionType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunObjectRequiredActionTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunObjectRequiredActionType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunObjectRequiredActionType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunObjectRequiredActionTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectResponseFormatNullable.g.verified.cs
new file mode 100644
index 0000000000..cc186b315c
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectResponseFormatNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunObjectResponseFormatNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunObjectResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunObjectResponseFormat? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunObjectResponseFormatExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunObjectResponseFormat)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunObjectResponseFormat? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunObjectResponseFormatExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..e6418a10b0
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunObjectStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunObjectStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunObjectStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunObjectStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunObjectStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunObjectStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunObjectStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectToolChoiceNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectToolChoiceNullable.g.verified.cs
new file mode 100644
index 0000000000..b82ed6145a
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectToolChoiceNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunObjectToolChoiceNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunObjectToolChoiceNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunObjectToolChoice? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunObjectToolChoiceExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunObjectToolChoice)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunObjectToolChoice? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunObjectToolChoiceExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaObjectObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..35597a541e
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaObjectObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepDeltaObjectObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepDeltaObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepDeltaObjectObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepDeltaObjectObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepDeltaObjectObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepDeltaObjectObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepDeltaObjectObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsMessageCreationObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsMessageCreationObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..a6ea30d98f
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsMessageCreationObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepDeltaStepDetailsMessageCreationObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepDeltaStepDetailsMessageCreationObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepDeltaStepDetailsMessageCreationObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepDeltaStepDetailsMessageCreationObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepDeltaStepDetailsMessageCreationObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepDeltaStepDetailsMessageCreationObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepDeltaStepDetailsMessageCreationObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..106a5c7280
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepDeltaStepDetailsToolCallsCodeObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepDeltaStepDetailsToolCallsCodeObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepDeltaStepDetailsToolCallsCodeObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepDeltaStepDetailsToolCallsCodeObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepDeltaStepDetailsToolCallsCodeObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepDeltaStepDetailsToolCallsCodeObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepDeltaStepDetailsToolCallsCodeObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..f4306428b4
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..188b94e7bb
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..f9c1de49d1
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepDeltaStepDetailsToolCallsFileSearchObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepDeltaStepDetailsToolCallsFileSearchObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepDeltaStepDetailsToolCallsFileSearchObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..21606a21ce
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepDeltaStepDetailsToolCallsFunctionObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepDeltaStepDetailsToolCallsFunctionObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepDeltaStepDetailsToolCallsFunctionObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepDeltaStepDetailsToolCallsFunctionObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..2c082ce021
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepDeltaStepDetailsToolCallsObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepDeltaStepDetailsToolCallsObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepDeltaStepDetailsToolCallsObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepDeltaStepDetailsToolCallsObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepDeltaStepDetailsToolCallsObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepDeltaStepDetailsToolCallsObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepDeltaStepDetailsToolCallsObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsMessageCreationObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsMessageCreationObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..17acba4a81
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsMessageCreationObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepDetailsMessageCreationObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepDetailsMessageCreationObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepDetailsMessageCreationObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepDetailsMessageCreationObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepDetailsMessageCreationObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepDetailsMessageCreationObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepDetailsMessageCreationObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..87f4b664de
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepDetailsToolCallsCodeObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepDetailsToolCallsCodeObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepDetailsToolCallsCodeObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepDetailsToolCallsCodeObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepDetailsToolCallsCodeObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepDetailsToolCallsCodeObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepDetailsToolCallsCodeObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeOutputImageObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeOutputImageObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..faae6aa848
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeOutputImageObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepDetailsToolCallsCodeOutputImageObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepDetailsToolCallsCodeOutputImageObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepDetailsToolCallsCodeOutputImageObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepDetailsToolCallsCodeOutputImageObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepDetailsToolCallsCodeOutputImageObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepDetailsToolCallsCodeOutputImageObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepDetailsToolCallsCodeOutputImageObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeOutputLogsObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeOutputLogsObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..5ac8912a72
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeOutputLogsObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepDetailsToolCallsCodeOutputLogsObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepDetailsToolCallsCodeOutputLogsObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepDetailsToolCallsCodeOutputLogsObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepDetailsToolCallsCodeOutputLogsObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepDetailsToolCallsCodeOutputLogsObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepDetailsToolCallsCodeOutputLogsObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepDetailsToolCallsCodeOutputLogsObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsFileSearchObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsFileSearchObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..72f5cc39f7
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsFileSearchObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepDetailsToolCallsFileSearchObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepDetailsToolCallsFileSearchObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepDetailsToolCallsFileSearchObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepDetailsToolCallsFileSearchObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepDetailsToolCallsFileSearchObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepDetailsToolCallsFileSearchObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepDetailsToolCallsFileSearchObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsFunctionObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsFunctionObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..a1d64597d7
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsFunctionObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepDetailsToolCallsFunctionObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepDetailsToolCallsFunctionObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepDetailsToolCallsFunctionObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepDetailsToolCallsFunctionObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepDetailsToolCallsFunctionObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepDetailsToolCallsFunctionObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepDetailsToolCallsFunctionObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..b3688b57d5
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepDetailsToolCallsObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepDetailsToolCallsObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepDetailsToolCallsObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepDetailsToolCallsObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepDetailsToolCallsObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepDetailsToolCallsObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepDetailsToolCallsObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectLastErrorCodeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectLastErrorCodeNullable.g.verified.cs
new file mode 100644
index 0000000000..fc89faf7ac
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectLastErrorCodeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepObjectLastErrorCodeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepObjectLastErrorCodeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepObjectLastErrorCode? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepObjectLastErrorCodeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepObjectLastErrorCode)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepObjectLastErrorCode? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepObjectLastErrorCodeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..f03dca25f6
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepObjectObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepObjectObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepObjectObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepObjectObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepObjectObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepObjectObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..2f6b32369b
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepObjectStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepObjectStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepObjectStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepObjectStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepObjectStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepObjectStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepObjectStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..3cc8e23823
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunStepObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunStepObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunStepObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunStepObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunStepObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunStepObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunStepObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunToolCallObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunToolCallObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..2fb2cc1a99
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunToolCallObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.RunToolCallObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class RunToolCallObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.RunToolCallObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.RunToolCallObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.RunToolCallObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.RunToolCallObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.RunToolCallObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ThreadObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ThreadObjectObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..ff74accddf
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ThreadObjectObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ThreadObjectObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ThreadObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ThreadObjectObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ThreadObjectObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ThreadObjectObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ThreadObjectObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ThreadObjectObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.TruncationObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.TruncationObjectTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..70f54b9fb9
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.TruncationObjectTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.TruncationObjectTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class TruncationObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.TruncationObjectType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.TruncationObjectTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.TruncationObjectType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.TruncationObjectType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.TruncationObjectTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreExpirationAfterAnchorNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreExpirationAfterAnchorNullable.g.verified.cs
new file mode 100644
index 0000000000..ff4f62f34a
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreExpirationAfterAnchorNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.VectorStoreExpirationAfterAnchorNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class VectorStoreExpirationAfterAnchorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.VectorStoreExpirationAfterAnchor? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.VectorStoreExpirationAfterAnchorExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.VectorStoreExpirationAfterAnchor)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.VectorStoreExpirationAfterAnchor? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.VectorStoreExpirationAfterAnchorExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileBatchObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileBatchObjectObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..e30b33bcf9
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileBatchObjectObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.VectorStoreFileBatchObjectObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class VectorStoreFileBatchObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.VectorStoreFileBatchObjectObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.VectorStoreFileBatchObjectObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.VectorStoreFileBatchObjectObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.VectorStoreFileBatchObjectObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.VectorStoreFileBatchObjectObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileBatchObjectStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileBatchObjectStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..a853c4e65d
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileBatchObjectStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.VectorStoreFileBatchObjectStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class VectorStoreFileBatchObjectStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.VectorStoreFileBatchObjectStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.VectorStoreFileBatchObjectStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.VectorStoreFileBatchObjectStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.VectorStoreFileBatchObjectStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.VectorStoreFileBatchObjectStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectLastErrorCodeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectLastErrorCodeNullable.g.verified.cs
new file mode 100644
index 0000000000..27bdd1b847
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectLastErrorCodeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.VectorStoreFileObjectLastErrorCodeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class VectorStoreFileObjectLastErrorCodeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.VectorStoreFileObjectLastErrorCode? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.VectorStoreFileObjectLastErrorCodeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.VectorStoreFileObjectLastErrorCode)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.VectorStoreFileObjectLastErrorCode? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.VectorStoreFileObjectLastErrorCodeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..39904fce62
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.VectorStoreFileObjectObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class VectorStoreFileObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.VectorStoreFileObjectObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.VectorStoreFileObjectObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.VectorStoreFileObjectObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.VectorStoreFileObjectObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.VectorStoreFileObjectObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..e293d6a251
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.VectorStoreFileObjectStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class VectorStoreFileObjectStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.VectorStoreFileObjectStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.VectorStoreFileObjectStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.VectorStoreFileObjectStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.VectorStoreFileObjectStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.VectorStoreFileObjectStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreObjectObjectNullable.g.verified.cs
new file mode 100644
index 0000000000..f87bd6d6a2
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreObjectObjectNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.VectorStoreObjectObjectNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class VectorStoreObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.VectorStoreObjectObject? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.VectorStoreObjectObjectExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.VectorStoreObjectObject)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.VectorStoreObjectObject? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.VectorStoreObjectObjectExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreObjectStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreObjectStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..1de9f251b6
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreObjectStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.VectorStoreObjectStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class VectorStoreObjectStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.VectorStoreObjectStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.VectorStoreObjectStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.VectorStoreObjectStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.VectorStoreObjectStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.VectorStoreObjectStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
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 cd3bd7418e..4591350b70 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
@@ -37,14 +37,23 @@ public Api(
Converters =
{
new global::OpenApiGenerator.JsonConverters.PredictionRequestWebhookEventsFilterJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.PredictionRequestWebhookEventsFilterNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.TrainingRequestWebhookEventsFilterJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.TrainingRequestWebhookEventsFilterNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.VersionPredictionRequestWebhookEventsFilterJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.VersionPredictionRequestWebhookEventsFilterNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetAccountResponseTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetAccountResponseTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateDeploymentsResponseCurrentReleaseCreatedByTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateDeploymentsResponseCurrentReleaseCreatedByTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetDeploymentsResponseCurrentReleaseCreatedByTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetDeploymentsResponseCurrentReleaseCreatedByTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateModelsRequestVisibilityJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateModelsRequestVisibilityNullableJsonConverter(),
}
};
}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.CreateDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.CreateDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..c63e1c05f2
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.CreateDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateDeploymentsResponseCurrentReleaseCreatedByTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateDeploymentsResponseCurrentReleaseCreatedByType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateDeploymentsResponseCurrentReleaseCreatedByTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateDeploymentsResponseCurrentReleaseCreatedByType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateDeploymentsResponseCurrentReleaseCreatedByType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateDeploymentsResponseCurrentReleaseCreatedByTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.CreateModelsRequestVisibilityNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.CreateModelsRequestVisibilityNullable.g.verified.cs
new file mode 100644
index 0000000000..e48acf4762
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.CreateModelsRequestVisibilityNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateModelsRequestVisibilityNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateModelsRequestVisibilityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateModelsRequestVisibility? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateModelsRequestVisibilityExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateModelsRequestVisibility)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateModelsRequestVisibility? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateModelsRequestVisibilityExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.GetAccountResponseTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.GetAccountResponseTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..077cfefc00
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.GetAccountResponseTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.GetAccountResponseTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class GetAccountResponseTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.GetAccountResponseType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.GetAccountResponseTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.GetAccountResponseType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.GetAccountResponseType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.GetAccountResponseTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.GetDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.GetDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..3263688ffe
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.GetDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.GetDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class GetDeploymentsResponseCurrentReleaseCreatedByTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.GetDeploymentsResponseCurrentReleaseCreatedByType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.GetDeploymentsResponseCurrentReleaseCreatedByTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.GetDeploymentsResponseCurrentReleaseCreatedByType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.GetDeploymentsResponseCurrentReleaseCreatedByType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.GetDeploymentsResponseCurrentReleaseCreatedByTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..a9d8aac1fa
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ListDeploymentsResponseResultsCurrentReleaseCreatedByType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ListDeploymentsResponseResultsCurrentReleaseCreatedByType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ListDeploymentsResponseResultsCurrentReleaseCreatedByType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.PredictionRequestWebhookEventsFilterNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.PredictionRequestWebhookEventsFilterNullable.g.verified.cs
new file mode 100644
index 0000000000..2c9486a8d6
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.PredictionRequestWebhookEventsFilterNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.PredictionRequestWebhookEventsFilterNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class PredictionRequestWebhookEventsFilterNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.PredictionRequestWebhookEventsFilter? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.PredictionRequestWebhookEventsFilterExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.PredictionRequestWebhookEventsFilter)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.PredictionRequestWebhookEventsFilter? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.PredictionRequestWebhookEventsFilterExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.TrainingRequestWebhookEventsFilterNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.TrainingRequestWebhookEventsFilterNullable.g.verified.cs
new file mode 100644
index 0000000000..7e6c4cd7da
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.TrainingRequestWebhookEventsFilterNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.TrainingRequestWebhookEventsFilterNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class TrainingRequestWebhookEventsFilterNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.TrainingRequestWebhookEventsFilter? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.TrainingRequestWebhookEventsFilterExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.TrainingRequestWebhookEventsFilter)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.TrainingRequestWebhookEventsFilter? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.TrainingRequestWebhookEventsFilterExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..86405372f7
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class UpdateDeploymentsResponseCurrentReleaseCreatedByTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.UpdateDeploymentsResponseCurrentReleaseCreatedByType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.UpdateDeploymentsResponseCurrentReleaseCreatedByType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.UpdateDeploymentsResponseCurrentReleaseCreatedByType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.VersionPredictionRequestWebhookEventsFilterNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.VersionPredictionRequestWebhookEventsFilterNullable.g.verified.cs
new file mode 100644
index 0000000000..45f130e4e4
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.VersionPredictionRequestWebhookEventsFilterNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.VersionPredictionRequestWebhookEventsFilterNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class VersionPredictionRequestWebhookEventsFilterNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.VersionPredictionRequestWebhookEventsFilter? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.VersionPredictionRequestWebhookEventsFilterExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.VersionPredictionRequestWebhookEventsFilter)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.VersionPredictionRequestWebhookEventsFilter? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.VersionPredictionRequestWebhookEventsFilterExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
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 8162ad2e78..bdaa734a9e 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
@@ -195,80 +195,155 @@ public Api(
Converters =
{
new global::OpenApiGenerator.JsonConverters.CheermoteTiersIdJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CheermoteTiersIdNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CheermoteTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CheermoteTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ExtensionTransactionProductDataCostTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ExtensionTransactionProductDataCostTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ExtensionTransactionProductTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ExtensionTransactionProductTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ModifyChannelInformationBodyContentClassificationLabelsIdJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ModifyChannelInformationBodyContentClassificationLabelsIdNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CustomRewardRedemptionStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CustomRewardRedemptionStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.UpdateRedemptionStatusBodyStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.UpdateRedemptionStatusBodyStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ChannelEmoteEmoteTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ChannelEmoteEmoteTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ChannelEmoteFormatJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ChannelEmoteFormatNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ChannelEmoteScaleJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ChannelEmoteScaleNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ChannelEmoteThemeModeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ChannelEmoteThemeModeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GlobalEmoteFormatJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GlobalEmoteFormatNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GlobalEmoteScaleJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GlobalEmoteScaleNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GlobalEmoteThemeModeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GlobalEmoteThemeModeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.EmoteEmoteTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.EmoteEmoteTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.EmoteFormatJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.EmoteFormatNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.EmoteScaleJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.EmoteScaleNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.EmoteThemeModeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.EmoteThemeModeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetUserEmotesResponseDataEmoteTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetUserEmotesResponseDataEmoteTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.SendChatAnnouncementBodyColorJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.SendChatAnnouncementBodyColorNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetConduitShardsResponseDataTransportMethodJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetConduitShardsResponseDataTransportMethodNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetConduitShardsResponseDataStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetConduitShardsResponseDataStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.UpdateConduitShardsBodyShardsTransportMethodJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.UpdateConduitShardsBodyShardsTransportMethodNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.UpdateConduitShardsResponseDataTransportMethodJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.UpdateConduitShardsResponseDataTransportMethodNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.UpdateConduitShardsResponseDataStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.UpdateConduitShardsResponseDataStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.DropsEntitlementFulfillmentStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.DropsEntitlementFulfillmentStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.UpdateDropsEntitlementsBodyFulfillmentStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.UpdateDropsEntitlementsBodyFulfillmentStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.DropsEntitlementUpdatedStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.DropsEntitlementUpdatedStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ExtensionConfigurationSegmentSegmentJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ExtensionConfigurationSegmentSegmentNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.SetExtensionConfigurationSegmentBodySegmentJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.SetExtensionConfigurationSegmentBodySegmentNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.SendExtensionPubSubMessageBodyTargetJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.SendExtensionPubSubMessageBodyTargetNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ExtensionConfigurationLocationJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ExtensionConfigurationLocationNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ExtensionStateJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ExtensionStateNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ExtensionSubscriptionsSupportLevelJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ExtensionSubscriptionsSupportLevelNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ExtensionBitsProductCostTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ExtensionBitsProductCostTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.UpdateExtensionBitsProductBodyCostTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.UpdateExtensionBitsProductBodyCostTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateEventSubSubscriptionBodyTransportMethodJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateEventSubSubscriptionBodyTransportMethodNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreateEventSubSubscriptionBodyTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreateEventSubSubscriptionBodyTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.EventSubSubscriptionTransportMethodJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.EventSubSubscriptionTransportMethodNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.EventSubSubscriptionStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.EventSubSubscriptionStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.EventSubSubscriptionTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.EventSubSubscriptionTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.CreatorGoalTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.CreatorGoalTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetChannelGuestStarSettingsResponseGroupLayoutJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetChannelGuestStarSettingsResponseGroupLayoutNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.UpdateChannelGuestStarSettingsBodyGroupLayoutJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.UpdateChannelGuestStarSettingsBodyGroupLayoutNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.HypeTrainEventEventDataLastContributionTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.HypeTrainEventEventDataLastContributionTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.HypeTrainEventEventDataTopContributionsTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.HypeTrainEventEventDataTopContributionsTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.ManageHeldAutoModMessagesBodyActionJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.ManageHeldAutoModMessagesBodyActionNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.PollStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.PollStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.EndPollBodyStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.EndPollBodyStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.PredictionOutcomeColorJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.PredictionOutcomeColorNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.PredictionStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.PredictionStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.EndPredictionBodyStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.EndPredictionBodyStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.StreamTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.StreamTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.BroadcasterSubscriptionTierJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.BroadcasterSubscriptionTierNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.UserSubscriptionTierJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.UserSubscriptionTierNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.UserTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.UserTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.UserBroadcasterTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.UserBroadcasterTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.UserExtensionTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.UserExtensionTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.VideoTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.VideoTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetExtensionAnalyticsTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetExtensionAnalyticsTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetGameAnalyticsTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetGameAnalyticsTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetBitsLeaderboardPeriodJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetBitsLeaderboardPeriodNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetCustomRewardRedemptionStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetCustomRewardRedemptionStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetCustomRewardRedemptionSortJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetCustomRewardRedemptionSortNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.UpdateUserChatColorColorJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.UpdateUserChatColorColorNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetDropsEntitlementsFulfillmentStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetDropsEntitlementsFulfillmentStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetExtensionConfigurationSegmentSegmentJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetExtensionConfigurationSegmentSegmentNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetEventsubSubscriptionsStatusJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetEventsubSubscriptionsStatusNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetEventsubSubscriptionsTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetEventsubSubscriptionsTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetStreamsTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetStreamsTypeNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.BlockUserSourceContextJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.BlockUserSourceContextNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.BlockUserReasonJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.BlockUserReasonNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetVideosPeriodJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetVideosPeriodNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetVideosSortJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetVideosSortNullableJsonConverter(),
new global::OpenApiGenerator.JsonConverters.GetVideosTypeJsonConverter(),
+ new global::OpenApiGenerator.JsonConverters.GetVideosTypeNullableJsonConverter(),
}
};
}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BlockUserReasonNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BlockUserReasonNullable.g.verified.cs
new file mode 100644
index 0000000000..583c537ab2
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BlockUserReasonNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.BlockUserReasonNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class BlockUserReasonNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.BlockUserReason? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.BlockUserReasonExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.BlockUserReason)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.BlockUserReason? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.BlockUserReasonExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BlockUserSourceContextNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BlockUserSourceContextNullable.g.verified.cs
new file mode 100644
index 0000000000..a367fc4e60
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BlockUserSourceContextNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.BlockUserSourceContextNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class BlockUserSourceContextNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.BlockUserSourceContext? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.BlockUserSourceContextExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.BlockUserSourceContext)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.BlockUserSourceContext? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.BlockUserSourceContextExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BroadcasterSubscriptionTierNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BroadcasterSubscriptionTierNullable.g.verified.cs
new file mode 100644
index 0000000000..7a141b11ed
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BroadcasterSubscriptionTierNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.BroadcasterSubscriptionTierNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class BroadcasterSubscriptionTierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.BroadcasterSubscriptionTier? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.BroadcasterSubscriptionTierExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.BroadcasterSubscriptionTier)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.BroadcasterSubscriptionTier? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.BroadcasterSubscriptionTierExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteEmoteTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteEmoteTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..165e5094bf
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteEmoteTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ChannelEmoteEmoteTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ChannelEmoteEmoteTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ChannelEmoteEmoteType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ChannelEmoteEmoteTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ChannelEmoteEmoteType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ChannelEmoteEmoteType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ChannelEmoteEmoteTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteFormatNullable.g.verified.cs
new file mode 100644
index 0000000000..589dd4bd59
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteFormatNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ChannelEmoteFormatNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ChannelEmoteFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ChannelEmoteFormat? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ChannelEmoteFormatExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ChannelEmoteFormat)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ChannelEmoteFormat? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ChannelEmoteFormatExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteScaleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteScaleNullable.g.verified.cs
new file mode 100644
index 0000000000..530ca39ae4
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteScaleNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ChannelEmoteScaleNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ChannelEmoteScaleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ChannelEmoteScale? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ChannelEmoteScaleExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ChannelEmoteScale)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ChannelEmoteScale? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ChannelEmoteScaleExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteThemeModeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteThemeModeNullable.g.verified.cs
new file mode 100644
index 0000000000..69e693084b
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteThemeModeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ChannelEmoteThemeModeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ChannelEmoteThemeModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ChannelEmoteThemeMode? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ChannelEmoteThemeModeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ChannelEmoteThemeMode)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ChannelEmoteThemeMode? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ChannelEmoteThemeModeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CheermoteTiersIdNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CheermoteTiersIdNullable.g.verified.cs
new file mode 100644
index 0000000000..c0a3d161aa
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CheermoteTiersIdNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CheermoteTiersIdNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CheermoteTiersIdNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CheermoteTiersId? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CheermoteTiersIdExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CheermoteTiersId)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CheermoteTiersId? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CheermoteTiersIdExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CheermoteTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CheermoteTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..3657707fa3
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CheermoteTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CheermoteTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CheermoteTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CheermoteType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CheermoteTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CheermoteType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CheermoteType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CheermoteTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreateEventSubSubscriptionBodyTransportMethodNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreateEventSubSubscriptionBodyTransportMethodNullable.g.verified.cs
new file mode 100644
index 0000000000..7b76cb1625
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreateEventSubSubscriptionBodyTransportMethodNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateEventSubSubscriptionBodyTransportMethodNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateEventSubSubscriptionBodyTransportMethodNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateEventSubSubscriptionBodyTransportMethod? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateEventSubSubscriptionBodyTransportMethodExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateEventSubSubscriptionBodyTransportMethod)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateEventSubSubscriptionBodyTransportMethod? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateEventSubSubscriptionBodyTransportMethodExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreateEventSubSubscriptionBodyTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreateEventSubSubscriptionBodyTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..f0bbc71998
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreateEventSubSubscriptionBodyTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreateEventSubSubscriptionBodyTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreateEventSubSubscriptionBodyTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreateEventSubSubscriptionBodyType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreateEventSubSubscriptionBodyTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreateEventSubSubscriptionBodyType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreateEventSubSubscriptionBodyType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreateEventSubSubscriptionBodyTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreatorGoalTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreatorGoalTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..054f04ff55
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreatorGoalTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CreatorGoalTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CreatorGoalTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CreatorGoalType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CreatorGoalTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CreatorGoalType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CreatorGoalType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CreatorGoalTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CustomRewardRedemptionStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CustomRewardRedemptionStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..84e15e6854
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CustomRewardRedemptionStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.CustomRewardRedemptionStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class CustomRewardRedemptionStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.CustomRewardRedemptionStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.CustomRewardRedemptionStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.CustomRewardRedemptionStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.CustomRewardRedemptionStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.CustomRewardRedemptionStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.DropsEntitlementFulfillmentStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.DropsEntitlementFulfillmentStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..0532bd594e
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.DropsEntitlementFulfillmentStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.DropsEntitlementFulfillmentStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class DropsEntitlementFulfillmentStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.DropsEntitlementFulfillmentStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.DropsEntitlementFulfillmentStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.DropsEntitlementFulfillmentStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.DropsEntitlementFulfillmentStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.DropsEntitlementFulfillmentStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.DropsEntitlementUpdatedStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.DropsEntitlementUpdatedStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..0d97a05735
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.DropsEntitlementUpdatedStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.DropsEntitlementUpdatedStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class DropsEntitlementUpdatedStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.DropsEntitlementUpdatedStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.DropsEntitlementUpdatedStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.DropsEntitlementUpdatedStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.DropsEntitlementUpdatedStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.DropsEntitlementUpdatedStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteEmoteTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteEmoteTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..a5301a418e
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteEmoteTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.EmoteEmoteTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class EmoteEmoteTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.EmoteEmoteType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.EmoteEmoteTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.EmoteEmoteType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.EmoteEmoteType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.EmoteEmoteTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteFormatNullable.g.verified.cs
new file mode 100644
index 0000000000..1b39ebf506
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteFormatNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.EmoteFormatNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class EmoteFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.EmoteFormat? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.EmoteFormatExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.EmoteFormat)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.EmoteFormat? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.EmoteFormatExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteScaleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteScaleNullable.g.verified.cs
new file mode 100644
index 0000000000..a88a949272
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteScaleNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.EmoteScaleNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class EmoteScaleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.EmoteScale? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.EmoteScaleExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.EmoteScale)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.EmoteScale? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.EmoteScaleExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteThemeModeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteThemeModeNullable.g.verified.cs
new file mode 100644
index 0000000000..770102f4b3
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteThemeModeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.EmoteThemeModeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class EmoteThemeModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.EmoteThemeMode? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.EmoteThemeModeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.EmoteThemeMode)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.EmoteThemeMode? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.EmoteThemeModeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EndPollBodyStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EndPollBodyStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..24305a9b7d
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EndPollBodyStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.EndPollBodyStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class EndPollBodyStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.EndPollBodyStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.EndPollBodyStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.EndPollBodyStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.EndPollBodyStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.EndPollBodyStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EndPredictionBodyStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EndPredictionBodyStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..542f8a2686
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EndPredictionBodyStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.EndPredictionBodyStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class EndPredictionBodyStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.EndPredictionBodyStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.EndPredictionBodyStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.EndPredictionBodyStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.EndPredictionBodyStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.EndPredictionBodyStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..f20a15f5c4
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.EventSubSubscriptionStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class EventSubSubscriptionStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.EventSubSubscriptionStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.EventSubSubscriptionStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.EventSubSubscriptionStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.EventSubSubscriptionStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.EventSubSubscriptionStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionTransportMethodNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionTransportMethodNullable.g.verified.cs
new file mode 100644
index 0000000000..ff20927bc9
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionTransportMethodNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.EventSubSubscriptionTransportMethodNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class EventSubSubscriptionTransportMethodNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.EventSubSubscriptionTransportMethod? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.EventSubSubscriptionTransportMethodExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.EventSubSubscriptionTransportMethod)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.EventSubSubscriptionTransportMethod? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.EventSubSubscriptionTransportMethodExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..7516335698
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.EventSubSubscriptionTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class EventSubSubscriptionTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.EventSubSubscriptionType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.EventSubSubscriptionTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.EventSubSubscriptionType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.EventSubSubscriptionType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.EventSubSubscriptionTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionBitsProductCostTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionBitsProductCostTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..7890416aeb
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionBitsProductCostTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ExtensionBitsProductCostTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ExtensionBitsProductCostTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ExtensionBitsProductCostType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ExtensionBitsProductCostTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ExtensionBitsProductCostType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ExtensionBitsProductCostType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ExtensionBitsProductCostTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionConfigurationLocationNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionConfigurationLocationNullable.g.verified.cs
new file mode 100644
index 0000000000..d743f570b9
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionConfigurationLocationNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ExtensionConfigurationLocationNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ExtensionConfigurationLocationNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ExtensionConfigurationLocation? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ExtensionConfigurationLocationExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ExtensionConfigurationLocation)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ExtensionConfigurationLocation? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ExtensionConfigurationLocationExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionConfigurationSegmentSegmentNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionConfigurationSegmentSegmentNullable.g.verified.cs
new file mode 100644
index 0000000000..8275d28b73
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionConfigurationSegmentSegmentNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ExtensionConfigurationSegmentSegmentNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ExtensionConfigurationSegmentSegmentNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ExtensionConfigurationSegmentSegment? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ExtensionConfigurationSegmentSegmentExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ExtensionConfigurationSegmentSegment)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ExtensionConfigurationSegmentSegment? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ExtensionConfigurationSegmentSegmentExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionStateNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionStateNullable.g.verified.cs
new file mode 100644
index 0000000000..185c59567a
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionStateNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ExtensionStateNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ExtensionStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ExtensionState? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ExtensionStateExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ExtensionState)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ExtensionState? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ExtensionStateExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionSubscriptionsSupportLevelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionSubscriptionsSupportLevelNullable.g.verified.cs
new file mode 100644
index 0000000000..6d6c89c2ff
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionSubscriptionsSupportLevelNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ExtensionSubscriptionsSupportLevelNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ExtensionSubscriptionsSupportLevelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ExtensionSubscriptionsSupportLevel? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ExtensionSubscriptionsSupportLevelExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ExtensionSubscriptionsSupportLevel)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ExtensionSubscriptionsSupportLevel? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ExtensionSubscriptionsSupportLevelExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionTransactionProductDataCostTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionTransactionProductDataCostTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..924239c721
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionTransactionProductDataCostTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ExtensionTransactionProductDataCostTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ExtensionTransactionProductDataCostTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ExtensionTransactionProductDataCostType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ExtensionTransactionProductDataCostTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ExtensionTransactionProductDataCostType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ExtensionTransactionProductDataCostType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ExtensionTransactionProductDataCostTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionTransactionProductTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionTransactionProductTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..13efabbd43
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionTransactionProductTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.ExtensionTransactionProductTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class ExtensionTransactionProductTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.ExtensionTransactionProductType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.ExtensionTransactionProductTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.ExtensionTransactionProductType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.ExtensionTransactionProductType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.ExtensionTransactionProductTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetBitsLeaderboardPeriodNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetBitsLeaderboardPeriodNullable.g.verified.cs
new file mode 100644
index 0000000000..4fc0d7b35b
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetBitsLeaderboardPeriodNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.GetBitsLeaderboardPeriodNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class GetBitsLeaderboardPeriodNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.GetBitsLeaderboardPeriod? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.GetBitsLeaderboardPeriodExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.GetBitsLeaderboardPeriod)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.GetBitsLeaderboardPeriod? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.GetBitsLeaderboardPeriodExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetChannelGuestStarSettingsResponseGroupLayoutNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetChannelGuestStarSettingsResponseGroupLayoutNullable.g.verified.cs
new file mode 100644
index 0000000000..4590c98205
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetChannelGuestStarSettingsResponseGroupLayoutNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.GetChannelGuestStarSettingsResponseGroupLayoutNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class GetChannelGuestStarSettingsResponseGroupLayoutNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.GetChannelGuestStarSettingsResponseGroupLayout? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.GetChannelGuestStarSettingsResponseGroupLayoutExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.GetChannelGuestStarSettingsResponseGroupLayout)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.GetChannelGuestStarSettingsResponseGroupLayout? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.GetChannelGuestStarSettingsResponseGroupLayoutExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetConduitShardsResponseDataStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetConduitShardsResponseDataStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..a051300263
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetConduitShardsResponseDataStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.GetConduitShardsResponseDataStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class GetConduitShardsResponseDataStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.GetConduitShardsResponseDataStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.GetConduitShardsResponseDataStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.GetConduitShardsResponseDataStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.GetConduitShardsResponseDataStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.GetConduitShardsResponseDataStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetConduitShardsResponseDataTransportMethodNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetConduitShardsResponseDataTransportMethodNullable.g.verified.cs
new file mode 100644
index 0000000000..4b035566c2
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetConduitShardsResponseDataTransportMethodNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.GetConduitShardsResponseDataTransportMethodNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class GetConduitShardsResponseDataTransportMethodNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.GetConduitShardsResponseDataTransportMethod? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.GetConduitShardsResponseDataTransportMethodExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.GetConduitShardsResponseDataTransportMethod)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.GetConduitShardsResponseDataTransportMethod? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.GetConduitShardsResponseDataTransportMethodExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetCustomRewardRedemptionSortNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetCustomRewardRedemptionSortNullable.g.verified.cs
new file mode 100644
index 0000000000..52a6badd02
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetCustomRewardRedemptionSortNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.GetCustomRewardRedemptionSortNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class GetCustomRewardRedemptionSortNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.GetCustomRewardRedemptionSort? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.GetCustomRewardRedemptionSortExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.GetCustomRewardRedemptionSort)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.GetCustomRewardRedemptionSort? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.GetCustomRewardRedemptionSortExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetCustomRewardRedemptionStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetCustomRewardRedemptionStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..0f527659e0
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetCustomRewardRedemptionStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.GetCustomRewardRedemptionStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class GetCustomRewardRedemptionStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.GetCustomRewardRedemptionStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.GetCustomRewardRedemptionStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.GetCustomRewardRedemptionStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.GetCustomRewardRedemptionStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.GetCustomRewardRedemptionStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetDropsEntitlementsFulfillmentStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetDropsEntitlementsFulfillmentStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..2a707205dc
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetDropsEntitlementsFulfillmentStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.GetDropsEntitlementsFulfillmentStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class GetDropsEntitlementsFulfillmentStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.GetDropsEntitlementsFulfillmentStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.GetDropsEntitlementsFulfillmentStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.GetDropsEntitlementsFulfillmentStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.GetDropsEntitlementsFulfillmentStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.GetDropsEntitlementsFulfillmentStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetEventsubSubscriptionsStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetEventsubSubscriptionsStatusNullable.g.verified.cs
new file mode 100644
index 0000000000..6ed5fece00
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetEventsubSubscriptionsStatusNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.GetEventsubSubscriptionsStatusNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class GetEventsubSubscriptionsStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.GetEventsubSubscriptionsStatus? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.GetEventsubSubscriptionsStatusExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.GetEventsubSubscriptionsStatus)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.GetEventsubSubscriptionsStatus? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.GetEventsubSubscriptionsStatusExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetEventsubSubscriptionsTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetEventsubSubscriptionsTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..fe4c5915c1
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetEventsubSubscriptionsTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.GetEventsubSubscriptionsTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class GetEventsubSubscriptionsTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.GetEventsubSubscriptionsType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.GetEventsubSubscriptionsTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.GetEventsubSubscriptionsType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.GetEventsubSubscriptionsType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.GetEventsubSubscriptionsTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetExtensionAnalyticsTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetExtensionAnalyticsTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..53cb2fa020
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetExtensionAnalyticsTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.GetExtensionAnalyticsTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class GetExtensionAnalyticsTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.GetExtensionAnalyticsType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.GetExtensionAnalyticsTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.GetExtensionAnalyticsType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.GetExtensionAnalyticsType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.GetExtensionAnalyticsTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetExtensionConfigurationSegmentSegmentNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetExtensionConfigurationSegmentSegmentNullable.g.verified.cs
new file mode 100644
index 0000000000..f7e6cdaca6
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetExtensionConfigurationSegmentSegmentNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.GetExtensionConfigurationSegmentSegmentNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class GetExtensionConfigurationSegmentSegmentNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.GetExtensionConfigurationSegmentSegment? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.GetExtensionConfigurationSegmentSegmentExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.GetExtensionConfigurationSegmentSegment)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.GetExtensionConfigurationSegmentSegment? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.GetExtensionConfigurationSegmentSegmentExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetGameAnalyticsTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetGameAnalyticsTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..ee848c5475
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetGameAnalyticsTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.GetGameAnalyticsTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class GetGameAnalyticsTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::G.GetGameAnalyticsType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::G.GetGameAnalyticsTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::G.GetGameAnalyticsType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::G.GetGameAnalyticsType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::G.GetGameAnalyticsTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetStreamsTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetStreamsTypeNullable.g.verified.cs
new file mode 100644
index 0000000000..2bad6c5bb8
--- /dev/null
+++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetStreamsTypeNullable.g.verified.cs
@@ -0,0 +1,57 @@
+//HintName: JsonConverters.GetStreamsTypeNullable.g.cs
+#nullable enable
+
+namespace OpenApiGenerator.JsonConverters
+{
+ ///
+ public sealed class GetStreamsTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///