File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
dotnet/src/webdriver/DevTools/Json Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 2626
2727namespace OpenQA . Selenium . DevTools . Json ;
2828
29- internal sealed class StringConverter : JsonConverter < string >
29+ internal sealed class StringConverter : JsonConverter < string ? >
3030{
3131 public override bool HandleNull => true ;
3232
@@ -56,6 +56,16 @@ internal sealed class StringConverter : JsonConverter<string>
5656 }
5757 }
5858
59- public override void Write ( Utf8JsonWriter writer , string value , JsonSerializerOptions options ) =>
59+ public override void Write ( Utf8JsonWriter writer , string ? value , JsonSerializerOptions options ) =>
6060 writer . WriteStringValue ( value ) ;
61+
62+ public override string ? ReadAsPropertyName ( ref Utf8JsonReader reader , Type typeToConvert , JsonSerializerOptions options )
63+ {
64+ return reader . GetString ( ) ;
65+ }
66+
67+ public override void WriteAsPropertyName ( Utf8JsonWriter writer , string value , JsonSerializerOptions options )
68+ {
69+ writer . WritePropertyName ( value ) ;
70+ }
6171}
You can’t perform that action at this time.
0 commit comments