File tree 1 file changed +12
-2
lines changed
dotnet/src/webdriver/DevTools/Json
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 26
26
27
27
namespace OpenQA . Selenium . DevTools . Json ;
28
28
29
- internal sealed class StringConverter : JsonConverter < string >
29
+ internal sealed class StringConverter : JsonConverter < string ? >
30
30
{
31
31
public override bool HandleNull => true ;
32
32
@@ -56,6 +56,16 @@ internal sealed class StringConverter : JsonConverter<string>
56
56
}
57
57
}
58
58
59
- public override void Write ( Utf8JsonWriter writer , string value , JsonSerializerOptions options ) =>
59
+ public override void Write ( Utf8JsonWriter writer , string ? value , JsonSerializerOptions options ) =>
60
60
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
+ }
61
71
}
You can’t perform that action at this time.
0 commit comments