1818// </copyright>
1919
2020using OpenQA . Selenium . BiDi . Communication ;
21- using OpenQA . Selenium . BiDi . Communication . Json ;
2221using System ;
22+ using System . Collections . Generic ;
2323using System . Text . Json ;
2424using System . Text . Json . Serialization ;
2525using System . Threading . Tasks ;
@@ -28,7 +28,7 @@ namespace OpenQA.Selenium.BiDi.Script;
2828
2929public sealed class ScriptModule : Module
3030{
31- private JsonSerializerContext _jsonContext = null ! ;
31+ private ScriptModuleJsonSerializerContext _jsonContext = null ! ;
3232
3333 public async Task < EvaluateResult > EvaluateAsync ( string expression , bool awaitPromise , Target target , EvaluateOptions ? options = null )
3434 {
@@ -113,6 +113,24 @@ public async Task<Subscription> OnRealmDestroyedAsync(Action<RealmDestroyedEvent
113113
114114 protected internal override void Initialize ( JsonSerializerOptions options )
115115 {
116- _jsonContext = new BiDiJsonSerializerContext ( options ) ;
116+ _jsonContext = new ( options ) ;
117117 }
118118}
119+
120+ [ JsonSerializable ( typeof ( Command ) ) ]
121+ [ JsonSerializable ( typeof ( EmptyResult ) ) ]
122+
123+ [ JsonSerializable ( typeof ( AddPreloadScriptCommand ) ) ]
124+ [ JsonSerializable ( typeof ( AddPreloadScriptResult ) ) ]
125+ [ JsonSerializable ( typeof ( DisownCommand ) ) ]
126+ [ JsonSerializable ( typeof ( CallFunctionCommand ) ) ]
127+ [ JsonSerializable ( typeof ( EvaluateCommand ) ) ]
128+ [ JsonSerializable ( typeof ( EvaluateResult ) ) ]
129+ [ JsonSerializable ( typeof ( GetRealmsCommand ) ) ]
130+ [ JsonSerializable ( typeof ( GetRealmsResult ) ) ]
131+ [ JsonSerializable ( typeof ( RemovePreloadScriptCommand ) ) ]
132+
133+ [ JsonSerializable ( typeof ( MessageEventArgs ) ) ]
134+ [ JsonSerializable ( typeof ( RealmDestroyedEventArgs ) ) ]
135+ [ JsonSerializable ( typeof ( IReadOnlyList < RealmInfo > ) ) ]
136+ internal partial class ScriptModuleJsonSerializerContext : JsonSerializerContext ;
0 commit comments