Skip to content

Commit c404b7a

Browse files
committed
[dotnet] Fix name collisions for commands/responses/eventargs
1 parent debb325 commit c404b7a

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

third_party/dotnet/devtools/NuGet.Config

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

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ public sealed class CommandInfo(string commandName, string fullTypeName, string
99

1010
public string FullTypeName { get; } = fullTypeName;
1111

12+
public string FullSnakeTypeName { get; } = fullTypeName.Replace(".", "_");
13+
1214
public string FullResponseTypeName { get; } = fullResponseTypeName;
15+
16+
public string FullSnakeResponseTypeName { get; } = fullResponseTypeName.Replace(".", "_");
1317
}
1418
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ public sealed class EventInfo(string eventName, string fullTypeName)
88
public string EventName { get; } = eventName;
99

1010
public string FullTypeName { get; } = fullTypeName;
11+
12+
public string FullSnakeTypeName { get; } = fullTypeName.Replace(".", "_");
1113
}
1214
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ namespace {{rootNamespace}}
5050
}
5151

5252
{{#each commands}}
53-
[global::System.Text.Json.Serialization.JsonSerializable(typeof({{FullTypeName}}))]
54-
[global::System.Text.Json.Serialization.JsonSerializable(typeof({{FullResponseTypeName}}))]
53+
[global::System.Text.Json.Serialization.JsonSerializable(typeof({{FullTypeName}}), TypeInfoPropertyName = "{{FullSnakeTypeName}}")]
54+
[global::System.Text.Json.Serialization.JsonSerializable(typeof({{FullResponseTypeName}}), TypeInfoPropertyName = "{{FullSnakeResponseTypeName}}")]
5555
{{/each}}
5656
{{#each events}}
57-
[global::System.Text.Json.Serialization.JsonSerializable(typeof({{fullTypeName}}))]
57+
[global::System.Text.Json.Serialization.JsonSerializable(typeof({{FullTypeName}}), TypeInfoPropertyName = "{{FullSnakeTypeName}}")]
5858
{{/each}}
5959
[global::System.Text.Json.Serialization.JsonSourceGenerationOptions(Converters = [typeof(OpenQA.Selenium.DevTools.Json.StringConverter)])]
6060
internal sealed partial class {{protocolVersion}}JsonSerializerContext : global::System.Text.Json.Serialization.JsonSerializerContext;

0 commit comments

Comments
 (0)