@@ -41,13 +41,15 @@ public override SourceFilter Read(ref Utf8JsonReader reader, Type typeToConvert,
41
41
var property = reader . GetString ( ) ;
42
42
if ( property == "excludes" || property == "exclude" )
43
43
{
44
- variant . Excludes = JsonSerializer . Deserialize < Elastic . Clients . Elasticsearch . Serverless . Fields ? > ( ref reader , options ) ;
44
+ reader . Read ( ) ;
45
+ variant . Excludes = new FieldsConverter ( ) . Read ( ref reader , typeToConvert , options ) ;
45
46
continue ;
46
47
}
47
48
48
49
if ( property == "includes" || property == "include" )
49
50
{
50
- variant . Includes = JsonSerializer . Deserialize < Elastic . Clients . Elasticsearch . Serverless . Fields ? > ( ref reader , options ) ;
51
+ reader . Read ( ) ;
52
+ variant . Includes = new FieldsConverter ( ) . Read ( ref reader , typeToConvert , options ) ;
51
53
continue ;
52
54
}
53
55
}
@@ -62,13 +64,13 @@ public override void Write(Utf8JsonWriter writer, SourceFilter value, JsonSerial
62
64
if ( value . Excludes is not null )
63
65
{
64
66
writer . WritePropertyName ( "excludes" ) ;
65
- JsonSerializer . Serialize ( writer , value . Excludes , options ) ;
67
+ new FieldsConverter ( ) . Write ( writer , value . Excludes , options ) ;
66
68
}
67
69
68
70
if ( value . Includes is not null )
69
71
{
70
72
writer . WritePropertyName ( "includes" ) ;
71
- JsonSerializer . Serialize ( writer , value . Includes , options ) ;
73
+ new FieldsConverter ( ) . Write ( writer , value . Includes , options ) ;
72
74
}
73
75
74
76
writer . WriteEndObject ( ) ;
0 commit comments