|
23 | 23 | using System.Text.Json.Serialization; |
24 | 24 | using System.Threading.Tasks; |
25 | 25 | using OpenQA.Selenium.BiDi.Communication; |
26 | | -using OpenQA.Selenium.BiDi.Communication.Json; |
27 | 26 |
|
28 | 27 | namespace OpenQA.Selenium.BiDi.Network; |
29 | 28 |
|
30 | 29 | public sealed partial class NetworkModule : Module |
31 | 30 | { |
32 | | - private JsonSerializerContext _jsonContext = null!; |
| 31 | + private NetworkModuleJsonSerializerContext _jsonContext = null!; |
33 | 32 |
|
34 | 33 | public async Task<Collector> AddDataCollectorAsync(IEnumerable<DataType> DataTypes, int MaxEncodedDataSize, AddDataCollectorOptions? options = null) |
35 | 34 | { |
@@ -181,6 +180,32 @@ public async Task<Subscription> OnAuthRequiredAsync(Action<AuthRequiredEventArgs |
181 | 180 |
|
182 | 181 | protected internal override void Initialize(JsonSerializerOptions options) |
183 | 182 | { |
184 | | - _jsonContext = new BiDiJsonSerializerContext(options); |
| 183 | + _jsonContext = new(options); |
185 | 184 | } |
186 | 185 | } |
| 186 | + |
| 187 | +[JsonSerializable(typeof(Command))] |
| 188 | +[JsonSerializable(typeof(EmptyResult))] |
| 189 | + |
| 190 | +[JsonSerializable(typeof(AddDataCollectorCommand))] |
| 191 | +[JsonSerializable(typeof(AddDataCollectorResult))] |
| 192 | +[JsonSerializable(typeof(AddInterceptCommand))] |
| 193 | +[JsonSerializable(typeof(AddInterceptResult))] |
| 194 | +[JsonSerializable(typeof(ContinueRequestCommand))] |
| 195 | +[JsonSerializable(typeof(ContinueResponseCommand))] |
| 196 | +[JsonSerializable(typeof(ContinueWithAuthCommand))] |
| 197 | +[JsonSerializable(typeof(FailRequestCommand))] |
| 198 | +[JsonSerializable(typeof(GetDataCommand))] |
| 199 | +[JsonSerializable(typeof(GetDataResult))] |
| 200 | +[JsonSerializable(typeof(ProvideResponseCommand))] |
| 201 | +[JsonSerializable(typeof(RemoveDataCollectorCommand))] |
| 202 | +[JsonSerializable(typeof(RemoveInterceptCommand))] |
| 203 | +[JsonSerializable(typeof(SetCacheBehaviorCommand))] |
| 204 | +[JsonSerializable(typeof(SetExtraHeadersCommand))] |
| 205 | + |
| 206 | +[JsonSerializable(typeof(BeforeRequestSentEventArgs))] |
| 207 | +[JsonSerializable(typeof(ResponseStartedEventArgs))] |
| 208 | +[JsonSerializable(typeof(ResponseCompletedEventArgs))] |
| 209 | +[JsonSerializable(typeof(FetchErrorEventArgs))] |
| 210 | +[JsonSerializable(typeof(AuthRequiredEventArgs))] |
| 211 | +internal partial class NetworkModuleJsonSerializerContext : JsonSerializerContext; |
0 commit comments