@@ -29,6 +29,8 @@ namespace System.Text.Json.SourceGeneration.Tests
29
29
[ JsonSerializable ( typeof ( byte [ ] ) , GenerationMode = JsonSourceGenerationMode . Metadata ) ]
30
30
[ JsonSerializable ( typeof ( string ) , GenerationMode = JsonSourceGenerationMode . Metadata ) ]
31
31
[ JsonSerializable ( typeof ( ( string Label1 , int Label2 , bool ) ) , GenerationMode = JsonSourceGenerationMode . Metadata ) ]
32
+ [ JsonSerializable ( typeof ( JsonDocument ) , GenerationMode = JsonSourceGenerationMode . Metadata ) ]
33
+ [ JsonSerializable ( typeof ( JsonElement ) , GenerationMode = JsonSourceGenerationMode . Metadata ) ]
32
34
[ JsonSerializable ( typeof ( RealWorldContextTests . ClassWithEnumAndNullable ) , GenerationMode = JsonSourceGenerationMode . Metadata ) ]
33
35
[ JsonSerializable ( typeof ( RealWorldContextTests . ClassWithNullableProperties ) , GenerationMode = JsonSourceGenerationMode . Metadata ) ]
34
36
[ JsonSerializable ( typeof ( ClassWithCustomConverter ) , GenerationMode = JsonSourceGenerationMode . Metadata ) ]
@@ -79,6 +81,8 @@ public override void EnsureFastPathGeneratedAsExpected()
79
81
Assert . Null ( MetadataWithPerTypeAttributeContext . Default . SampleEnum . SerializeHandler ) ;
80
82
Assert . Null ( MetadataWithPerTypeAttributeContext . Default . String . SerializeHandler ) ;
81
83
Assert . Null ( MetadataWithPerTypeAttributeContext . Default . ValueTupleStringInt32Boolean . SerializeHandler ) ;
84
+ Assert . Null ( MetadataWithPerTypeAttributeContext . Default . JsonDocument . SerializeHandler ) ;
85
+ Assert . Null ( MetadataWithPerTypeAttributeContext . Default . JsonElement . SerializeHandler ) ;
82
86
Assert . Null ( MetadataWithPerTypeAttributeContext . Default . ClassWithEnumAndNullable . SerializeHandler ) ;
83
87
Assert . Null ( MetadataWithPerTypeAttributeContext . Default . ClassWithNullableProperties . SerializeHandler ) ;
84
88
Assert . Null ( MetadataWithPerTypeAttributeContext . Default . ClassWithCustomConverter . SerializeHandler ) ;
@@ -95,6 +99,7 @@ public override void EnsureFastPathGeneratedAsExpected()
95
99
Assert . Null ( MetadataWithPerTypeAttributeContext . Default . PersonStruct . SerializeHandler ) ;
96
100
Assert . Null ( MetadataWithPerTypeAttributeContext . Default . TypeWithValidationAttributes . SerializeHandler ) ;
97
101
Assert . Null ( MetadataWithPerTypeAttributeContext . Default . TypeWithDerivedAttribute . SerializeHandler ) ;
102
+ Assert . Null ( MetadataWithPerTypeAttributeContext . Default . PolymorphicClass . SerializeHandler ) ;
98
103
}
99
104
}
100
105
@@ -121,6 +126,8 @@ public override void EnsureFastPathGeneratedAsExpected()
121
126
[ JsonSerializable ( typeof ( byte [ ] ) ) ]
122
127
[ JsonSerializable ( typeof ( string ) ) ]
123
128
[ JsonSerializable ( typeof ( ( string Label1 , int Label2 , bool ) ) ) ]
129
+ [ JsonSerializable ( typeof ( JsonDocument ) ) ]
130
+ [ JsonSerializable ( typeof ( JsonElement ) ) ]
124
131
[ JsonSerializable ( typeof ( RealWorldContextTests . ClassWithEnumAndNullable ) ) ]
125
132
[ JsonSerializable ( typeof ( RealWorldContextTests . ClassWithNullableProperties ) ) ]
126
133
[ JsonSerializable ( typeof ( ClassWithCustomConverter ) ) ]
@@ -194,6 +201,8 @@ public override void EnsureFastPathGeneratedAsExpected()
194
201
Assert . Null ( MetadataContext . Default . SampleEnum . SerializeHandler ) ;
195
202
Assert . Null ( MetadataContext . Default . String . SerializeHandler ) ;
196
203
Assert . Null ( MetadataContext . Default . ValueTupleStringInt32Boolean . SerializeHandler ) ;
204
+ Assert . Null ( MetadataContext . Default . JsonDocument . SerializeHandler ) ;
205
+ Assert . Null ( MetadataContext . Default . JsonElement . SerializeHandler ) ;
197
206
Assert . Null ( MetadataContext . Default . ClassWithEnumAndNullable . SerializeHandler ) ;
198
207
Assert . Null ( MetadataContext . Default . ClassWithNullableProperties . SerializeHandler ) ;
199
208
Assert . Null ( MetadataContext . Default . ClassWithCustomConverter . SerializeHandler ) ;
@@ -210,6 +219,7 @@ public override void EnsureFastPathGeneratedAsExpected()
210
219
Assert . Null ( MetadataContext . Default . PersonStruct . SerializeHandler ) ;
211
220
Assert . Null ( MetadataContext . Default . TypeWithValidationAttributes . SerializeHandler ) ;
212
221
Assert . Null ( MetadataContext . Default . TypeWithDerivedAttribute . SerializeHandler ) ;
222
+ Assert . Null ( MetadataContext . Default . PolymorphicClass . SerializeHandler ) ;
213
223
}
214
224
215
225
[ Fact ]
0 commit comments