You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Initial implementation for contract customization
fix build errors
Move converter rooting to DefaultJsonTypeInfoResolver so that it can be used standalone
Fix ConfigurationList.IsReadOnly
Minor refactorings (#1)
* Makes the following changes:
* Move singleton initialization for DefaultTypeInfoResolver behind a static property.
* Consolidate JsonSerializerContext & IJsonTypeInfoResolver values to a single field.
* Move reflection fallback logic away from JsonSerializerContext and into JsonSerializerOptions
* Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.cs
* remove testing of removed field
Simplify the JsonTypeInfo.CreateObject implemenetation (#2)
* Simplify the JsonTypeInfo.CreateObject implemenetation
* Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfoOfT.cs
* Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonTypeInfoOfT.cs
Co-authored-by: Krzysztof Wicher <[email protected]>
Co-authored-by: Krzysztof Wicher <[email protected]>
Tests and fixes for JsonTypeInfoKind.None
TypeInfo type mismatch tests
Allow setting NumberHandling on JsonTypeInfoKind.None
test resolver returning wrong type of options
JsonTypeInfo/JsonPropertyInfo mutability tests
rename test file
Move default converter rooting responsibility behind DefaultJsonTypeInfoResolver (#3)
* Move default converter rooting responsibility behind DefaultJsonTypeInfoResolver
* address feedback
Add simple test for using JsonTypeInfo<T> with APIs directly taking it
fix and tests for untyped/typed CreateObject
uncomment test cases, remove todo
More tests and tiny fixes
Add a JsonTypeInfoResolver.Combine test for JsonSerializerContext (#4)
* Fix JsonTypeInfoResolver.Combine for JsonSerializerContext
* Break up failing test
Fix simple scenarios for combining contexts (#6)
* Fix simple scenarios for combining contexts
* feedback
JsonSerializerContext combine test with different camel casing
Remove unneeded virtual calls & branching when accessing Get & Set delegates (#7)
JsonPropertyInfo tests everything minus ShouldSerialize & NumberHandling
Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs
Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs
throw InvalidOperationException rather than ArgumentNullException for source gen when PropertyInfo.Name is assigned through JsonPropertyInfoValues
tests for duplicated property names and JsonPropertyInfo.NumberHandling
Add tests for NumberHandling and failing tests for ShouldSerialize
disable the failing test and add extra checks
disable remainder of the failing ShouldSerialize tests, fix working one
Fix ShouldSerialize and IgnoreCondition interop
Add failing tests for CreateObject + parametrized constructors
Fix CreateObject support for JsonConstructor types (#10)
* Fix CreateObject support for JsonConstructor types
* address feedback
Make contexts more combinator friendly (#9)
* Make contexts more combinator friendly
* remove converter cache
* redesign test to account for JsonConstructorAttribute
* Combine unit tests
* address feedback
* Add acceptance tests for DataContract attributes & Specified pattern (#11)
* Add private field serialization acceptance test (#13)
* tests, PR feedback (#14)
* PR feedback and extra tests
* Shorten class name, remove incorrect check (not true for polimorphic cases)
* Make parameter matching for custom properties map property Name with parameter (#16)
* Test static initialization with JsonTypeInfo (#17)
* Fix test failures and proper fix this time (#18)
* Fix test failures and proper fix this time
* reinstate ActiveIssueAttribute
* PR feedback and adjust couple of tests which don't set TypeInfoResolver
* fix IAsyncEnumerable tests
* Lock JsonSerializerOptions in JsonTypeInfo.EnsureConfigured()
Co-authored-by: Eirik Tsarpalis <[email protected]>
Co-authored-by: Eirik Tsarpalis <[email protected]>
return$"{Emitter.GetConverterFromFactoryMethodName}(typeof({type.GetCompilableName()}), new {converterType.GetCompilableName()}())";
1476
+
return$"{Emitter.GetConverterFromFactoryMethodName}({OptionsLocalVariableName}, typeof({type.GetCompilableName()}), new {converterType.GetCompilableName()}())";
return$"{Emitter.GetConverterFromFactoryMethodName}<{type.GetCompilableName()}>({OptionsLocalVariableName}, new {converterType.GetCompilableName()}())";
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
363
+
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
1058
+
[System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use generic overload or System.Text.Json source generation for native AOT applications.")]
1210
+
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use generic overload or System.Text.Json source generation for native AOT applications.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use generic overload or System.Text.Json source generation for native AOT applications.")]
1213
+
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use generic overload or System.Text.Json source generation for native AOT applications.")]
<value>Metadata for type '{0}' was not provided to the serializer. The serializer method used does not support reflection-based creation of serialization-related type metadata. If using source generation, ensure that all root types passed to the serializer have been indicated with 'JsonSerializableAttribute', along with any types that might be serialized polymorphically.</value>
<value>Runtime type '{0}' has a diamond ambiguity between derived types '{1}' and '{2}' of polymorphic type '{3}'. Consider either removing one of the derived types or removing the 'JsonUnknownDerivedTypeHandling.FallBackToNearestAncestor' setting.</value>
0 commit comments