Skip to content

Commit 2d44574

Browse files
[9.2] Use trim-safe code in LazyJsonConverter. (#8793) (#8806)
Co-authored-by: Theodore Tsirpanis <teo@tsirpanis.gr>
1 parent 7ee5584 commit 2d44574

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Elastic.Clients.Elasticsearch/_Shared/Core/LazyJsonConverter.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ public sealed class LazyJsonConverter : JsonConverter<LazyJson>
1515
{
1616
private IElasticsearchClientSettings? _settings;
1717

18-
[UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute'", Justification = "Always using explicit TypeInfoResolver")]
19-
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute'", Justification = "Always using explicit TypeInfoResolver")]
2018
public override LazyJson Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
2119
{
2220
InitializeSettings(options);
2321

24-
return new LazyJson(JsonSerializer.Deserialize<JsonElement>(ref reader, options), _settings!);
22+
return new LazyJson(JsonElement.ParseValue(ref reader), _settings!);
2523
}
2624

2725
private void InitializeSettings(JsonSerializerOptions options)

0 commit comments

Comments
 (0)