@@ -29,7 +29,7 @@ public partial class ContractDescriptorParser
29
29
}
30
30
31
31
[ JsonSerializable ( typeof ( ContractDescriptor ) ) ]
32
- [ JsonSerializable ( typeof ( int ) ) ]
32
+ [ JsonSerializable ( typeof ( int ? ) ) ]
33
33
[ JsonSerializable ( typeof ( string ) ) ]
34
34
[ JsonSerializable ( typeof ( Dictionary < string , int > ) ) ]
35
35
[ JsonSerializable ( typeof ( Dictionary < string , TypeDescriptor > ) ) ]
@@ -38,11 +38,17 @@ public partial class ContractDescriptorParser
38
38
[ JsonSerializable ( typeof ( TypeDescriptor ) ) ]
39
39
[ JsonSerializable ( typeof ( FieldDescriptor ) ) ]
40
40
[ JsonSerializable ( typeof ( GlobalDescriptor ) ) ]
41
+ [ JsonSerializable ( typeof ( Dictionary < string , JsonElement > ) ) ]
41
42
[ JsonSourceGenerationOptions ( AllowTrailingCommas = true ,
42
43
DictionaryKeyPolicy = JsonKnownNamingPolicy . Unspecified , // contracts, types and globals are case sensitive
43
44
PropertyNamingPolicy = JsonKnownNamingPolicy . CamelCase ,
44
45
NumberHandling = JsonNumberHandling . AllowReadingFromString ,
45
- ReadCommentHandling = JsonCommentHandling . Skip ) ]
46
+ ReadCommentHandling = JsonCommentHandling . Skip ,
47
+ UnmappedMemberHandling = JsonUnmappedMemberHandling . Skip ,
48
+ UnknownTypeHandling = JsonUnknownTypeHandling . JsonElement ,
49
+ Converters = [ typeof ( TypeDescriptorConverter ) ,
50
+ typeof ( FieldDescriptorConverter ) ,
51
+ typeof ( GlobalDescriptorConverter ) ] ) ]
46
52
internal sealed partial class ContractDescriptorContext : JsonSerializerContext
47
53
{
48
54
}
@@ -58,7 +64,13 @@ public class ContractDescriptor
58
64
public Dictionary < string , GlobalDescriptor > ? Globals { get ; set ; }
59
65
60
66
[ JsonExtensionData ]
61
- public Dictionary < string , object ? > ? Extras { get ; set ; }
67
+ public Dictionary < string , JsonElement > ? Extras { get ; set ; }
68
+
69
+ public override string ToString ( )
70
+ {
71
+ return $ "Version: { Version } , Baseline: { Baseline } , Contracts: { Contracts ? . Count } , Types: { Types ? . Count } , Globals: { Globals ? . Count } ";
72
+ }
73
+
62
74
}
63
75
64
76
[ JsonConverter ( typeof ( TypeDescriptorConverter ) ) ]
0 commit comments