Skip to content

Commit 27cdb89

Browse files
committed
[dotnet] Address AOT warnings in BiDi
1 parent 44e35d2 commit 27cdb89

32 files changed

+73
-4
lines changed

dotnet/src/webdriver/BiDi/Communication/Broker.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ internal Broker(BiDi bidi, ITransport transport)
8282
new PrintPageRangeConverter(),
8383
new InputOriginConverter(),
8484
new SubscriptionConverter(),
85-
new JsonStringEnumConverter(JsonNamingPolicy.CamelCase),
8685

8786
// https://github.com/dotnet/runtime/issues/72604
8887
new Json.Converters.Polymorphic.MessageConverter(),

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetClientWindowsResultConverter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@
2020
using OpenQA.Selenium.BiDi.Modules.Browser;
2121
using System;
2222
using System.Collections.Generic;
23+
using System.Diagnostics.CodeAnalysis;
2324
using System.Text.Json;
2425
using System.Text.Json.Serialization;
2526

2627
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable;
2728

29+
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
30+
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
2831
internal class GetClientWindowsResultConverter : JsonConverter<GetClientWindowsResult>
2932
{
3033
public override GetClientWindowsResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetCookiesResultConverter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@
2020
using OpenQA.Selenium.BiDi.Modules.Storage;
2121
using System;
2222
using System.Collections.Generic;
23+
using System.Diagnostics.CodeAnalysis;
2324
using System.Text.Json;
2425
using System.Text.Json.Serialization;
2526

2627
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable;
2728

29+
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
30+
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
2831
internal class GetCookiesResultConverter : JsonConverter<GetCookiesResult>
2932
{
3033
public override GetCookiesResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetRealmsResultConverter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@
2020
using OpenQA.Selenium.BiDi.Modules.Script;
2121
using System;
2222
using System.Collections.Generic;
23+
using System.Diagnostics.CodeAnalysis;
2324
using System.Text.Json;
2425
using System.Text.Json.Serialization;
2526

2627
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable;
2728

29+
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
30+
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
2831
internal class GetRealmsResultConverter : JsonConverter<GetRealmsResult>
2932
{
3033
public override GetRealmsResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetUserContextsResultConverter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@
2020
using OpenQA.Selenium.BiDi.Modules.Browser;
2121
using System;
2222
using System.Collections.Generic;
23+
using System.Diagnostics.CodeAnalysis;
2324
using System.Text.Json;
2425
using System.Text.Json.Serialization;
2526

2627
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable;
2728

29+
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
30+
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
2831
internal class GetUserContextsResultConverter : JsonConverter<GetUserContextsResult>
2932
{
3033
public override GetUserContextsResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/InputSourceActionsConverter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@
1919

2020
using OpenQA.Selenium.BiDi.Modules.Input;
2121
using System;
22+
using System.Diagnostics.CodeAnalysis;
2223
using System.Linq;
2324
using System.Text.Json;
2425
using System.Text.Json.Serialization;
2526

2627
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable;
2728

29+
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
30+
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
2831
internal class InputSourceActionsConverter : JsonConverter<SourceActions>
2932
{
3033
public override SourceActions Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/LocateNodesResultConverter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@
2121
using OpenQA.Selenium.BiDi.Modules.Script;
2222
using System;
2323
using System.Collections.Generic;
24+
using System.Diagnostics.CodeAnalysis;
2425
using System.Text.Json;
2526
using System.Text.Json.Serialization;
2627

2728
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Enumerable;
2829

30+
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
31+
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
2932
internal class LocateNodesResultConverter : JsonConverter<LocateNodesResult>
3033
{
3134
public override LocateNodesResult Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

dotnet/src/webdriver/BiDi/Communication/Json/Converters/InputOriginConverter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@
1919

2020
using OpenQA.Selenium.BiDi.Modules.Input;
2121
using System;
22+
using System.Diagnostics.CodeAnalysis;
2223
using System.Text.Json;
2324
using System.Text.Json.Serialization;
2425

2526
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters;
2627

28+
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
29+
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
2730
internal class InputOriginConverter : JsonConverter<Origin>
2831
{
2932
public override Origin Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/EvaluateResultConverter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@
1919

2020
using OpenQA.Selenium.BiDi.Modules.Script;
2121
using System;
22+
using System.Diagnostics.CodeAnalysis;
2223
using System.Text.Json;
2324
using System.Text.Json.Serialization;
2425

2526
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Polymorphic;
2627

28+
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
29+
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
2730
// https://github.com/dotnet/runtime/issues/72604
2831
internal class EvaluateResultConverter : JsonConverter<EvaluateResult>
2932
{

dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/LogEntryConverter.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@
1919

2020
using OpenQA.Selenium.BiDi.Modules.Log;
2121
using System;
22+
using System.Diagnostics.CodeAnalysis;
2223
using System.Text.Json;
2324
using System.Text.Json.Serialization;
2425

2526
namespace OpenQA.Selenium.BiDi.Communication.Json.Converters.Polymorphic;
2627

2728
// https://github.com/dotnet/runtime/issues/72604
29+
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Json serializer options should have AOT-safe type resolution")]
30+
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Json serializer options should have AOT-safe type resolution")]
2831
internal class LogEntryConverter : JsonConverter<Modules.Log.Entry>
2932
{
3033
public override Modules.Log.Entry? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

0 commit comments

Comments
 (0)