From 7b9308b0cf0a3dbe9236727475c77db3ab3895a7 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Mon, 8 Dec 2025 21:55:03 +0200 Subject: [PATCH] Use trim-safe code in `LazyJsonConverter`. --- .../_Shared/Core/LazyJsonConverter.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Elastic.Clients.Elasticsearch/_Shared/Core/LazyJsonConverter.cs b/src/Elastic.Clients.Elasticsearch/_Shared/Core/LazyJsonConverter.cs index 5291695a874..b0700dd1918 100644 --- a/src/Elastic.Clients.Elasticsearch/_Shared/Core/LazyJsonConverter.cs +++ b/src/Elastic.Clients.Elasticsearch/_Shared/Core/LazyJsonConverter.cs @@ -18,9 +18,7 @@ public override LazyJson Read(ref Utf8JsonReader reader, Type typeToConvert, Jso { InitializeSettings(options); -#pragma warning disable IL2026, IL3050 // The `TypeInfoResolver` for `RequestResponseConverter` knows how to handle `JsonElement`. - return new LazyJson(JsonSerializer.Deserialize(ref reader, options), _settings!); -#pragma warning restore IL2026, IL3050 + return new LazyJson(JsonElement.ParseValue(ref reader), _settings!); } private void InitializeSettings(JsonSerializerOptions options)