diff --git a/src/Elastic.Clients.Elasticsearch.Shared/Serialization/Stringified.cs b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/Stringified.cs index 607d1b15fcd..0d178e886f8 100644 --- a/src/Elastic.Clients.Elasticsearch.Shared/Serialization/Stringified.cs +++ b/src/Elastic.Clients.Elasticsearch.Shared/Serialization/Stringified.cs @@ -12,11 +12,11 @@ namespace Elastic.Clients.Elasticsearch.Serverless.Serialization; namespace Elastic.Clients.Elasticsearch.Serialization; #endif -internal sealed class StringifiedLongConverter : JsonConverter +internal sealed class StringifiedLongConverter : JsonConverter { - public override long? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => ReadStringifiedLong(ref reader); + public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => ReadStringifiedLong(ref reader); - public override void Write(Utf8JsonWriter writer, long? value, JsonSerializerOptions options) => writer.WriteNumberValue(value.Value); + public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options) => writer.WriteNumberValue(value); public static long ReadStringifiedLong(ref Utf8JsonReader reader) { @@ -39,11 +39,11 @@ public static long ReadStringifiedLong(ref Utf8JsonReader reader) } } -internal sealed class StringifiedIntegerConverter : JsonConverter +internal sealed class StringifiedIntegerConverter : JsonConverter { - public override int? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => ReadStringifiedInteger(ref reader); + public override int Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => ReadStringifiedInteger(ref reader); - public override void Write(Utf8JsonWriter writer, int? value, JsonSerializerOptions options) => writer.WriteNumberValue(value.Value); + public override void Write(Utf8JsonWriter writer, int value, JsonSerializerOptions options) => writer.WriteNumberValue(value); public static int ReadStringifiedInteger(ref Utf8JsonReader reader) { @@ -66,11 +66,11 @@ public static int ReadStringifiedInteger(ref Utf8JsonReader reader) } } -internal sealed class StringifiedBoolConverter : JsonConverter +internal sealed class StringifiedBoolConverter : JsonConverter { - public override bool? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => ReadStringifiedBool(ref reader); + public override bool Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => ReadStringifiedBool(ref reader); - public override void Write(Utf8JsonWriter writer, bool? value, JsonSerializerOptions options) => writer.WriteBooleanValue(value.Value); + public override void Write(Utf8JsonWriter writer, bool value, JsonSerializerOptions options) => writer.WriteBooleanValue(value); public static bool ReadStringifiedBool(ref Utf8JsonReader reader) {