Skip to content

Commit ec77cd7

Browse files
committed
Use generated JSON context for event args
1 parent a1f47e8 commit ec77cd7

File tree

3 files changed

+4
-37
lines changed

3 files changed

+4
-37
lines changed

dotnet/src/webdriver/DevTools/Json/DevToolsJsonOptions.cs

Lines changed: 0 additions & 35 deletions
This file was deleted.

third_party/dotnet/devtools/src/generator/CodeGen/DomainGenerator.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using OpenQA.Selenium.DevToolsGenerator.ProtocolDefinition;
44
using System;
55
using System.Collections.Generic;
6+
using System.Linq;
67

78
namespace OpenQA.Selenium.DevToolsGenerator.CodeGen
89
{
@@ -61,7 +62,8 @@ public override IDictionary<string, string> GenerateCode(DomainDefinition domain
6162
domain = domainDefinition,
6263
className = className,
6364
rootNamespace = Settings.RootNamespace,
64-
context = context
65+
context = context,
66+
protocolVersion = Settings.RootNamespace.Split(".").Last()
6567
});
6668

6769
var outputPath = Utility.ReplaceTokensInPath(Settings.DefinitionTemplates.DomainTemplate.OutputPath, className, context, Settings);

third_party/dotnet/devtools/src/generator/Templates/domain.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ namespace {{rootNamespace}}.{{domain.Name}}
6060
if (m_eventMap.ContainsKey(e.EventName))
6161
{
6262
var eventData = m_eventMap[e.EventName];
63-
var eventArgs = e.EventData.Deserialize(eventData.EventArgsType, global::OpenQA.Selenium.DevTools.Json.DevToolsJsonOptions.Default);
63+
var eventArgs = e.EventData.Deserialize(eventData.EventArgsType, {{rootNamespace}}.{{protocolVersion}}JsonSerializerContext.Default);
6464
eventData.EventInvoker(eventArgs);
6565
}
6666
}

0 commit comments

Comments
 (0)