100 Commits
Author SHA1 Message Date
Eirik Tsarpalis cefd1a7ad9 Refactor the generic TensorPrimitives implementation into multiple files. (#98566)
* Refactor the generic TensorPrimitives implementation into multiple files.

* Use one file per method group.

* Rename Operators -> Common
2024-02-21 17:42:26 +00:00
Eirik Tsarpalis 3cfdff692b Fix source gen support for custom property names that need escaping (#98750) 2024-02-21 17:17:30 +00:00
Eirik Tsarpalis 5eddce62c2 Make ordering an explicit part of CountBy and AggregateBy testing. (#98311) 2024-02-13 10:05:31 +00:00
Eirik Tsarpalis cdc4a48d42 Temporarily disable failing assertions triggered by the FastReducer implementation. (#98212)
* Temporarily disable failing assertions triggered by the FastReducer implementation.

* Add argument labels.
2024-02-09 21:37:38 +00:00
Eirik TsarpalisandStephen Toub 85fe8fe3f6 Improve API documentation for Enumerable.Index (#98148)
* Improve API documentation for Enumerable.Index

* Update src/libraries/System.Linq/src/System/Linq/Index.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>

---------

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2024-02-08 12:38:28 +00:00
Eirik Tsarpalis 24d149c7e7 Fix #98050. (#98058) 2024-02-07 09:17:36 +00:00
Eirik Tsarpalis b8b2f89dbc Ensure HashSet.TrimExcess() does not change the count (#97989)
* Fix #97947.

* fix build
2024-02-06 13:54:20 +00:00
Eirik Tsarpalis 1a2f095fb2 [JsonSerializer] Add support for out-of-order metadata reads. (#97474)
* JsonSerializer: Add support for out-of-order metadata reads.

* Address feedback

* Address feedback & add more tests.

* Improve exception message for polymorphic abstract types.

* Improve error message.
2024-02-02 14:18:00 +00:00
Eirik Tsarpalis d250dcc2de Make JsonReaderState a readonly struct. (#97421) 2024-01-23 23:18:54 +00:00
Eirik Tsarpalis 59fb3be11c Ensure that JSON properties can be skipped without buffering their entire contents. (#96856) 2024-01-12 19:12:00 +00:00
Eirik Tsarpalis c31a2173e5 Fix fast-path support for ignoring nullable value types (#96639) 2024-01-09 11:53:00 +00:00
Eirik Tsarpalis 642c8686e3 Add regression testing for the v8 source generator. (#95352) 2023-11-29 08:32:59 +00:00
Eirik Tsarpalis ed6323fa0d Make source generated JsonTypeInfo properties nullable-oblivious (#95341) 2023-11-28 18:23:43 +00:00
Eirik Tsarpalis fe79ce8ae5 Add JSON null support for the built-in (ReadOnly)Memory converters. (#95275)
* Add JSON null support for the built-in (ReadOnly)Memory converters.

* Address feedback
2023-11-28 12:50:47 +00:00
Eirik Tsarpalis b13598088c Fix JsonArray.Add and ReplaceWith regressions. (#94854)
* Fix JsonArray.Add and ReplaceWith regressions.

* Add comment

* Address feedback.
2023-11-16 22:39:33 +00:00
Eirik Tsarpalis 57fd56a99d Ensure that JsonSerializerOptions.CachingContext is a singleton. (#94527) 2023-11-15 18:26:57 +00:00
Eirik Tsarpalis b54e9d3d33 Use fully qualified names when referencing user types. (#94267)
* Use fully qualified names when referencing user types.

* Use ToUpperInvariant

* Address feedback
2023-11-02 13:52:30 +00:00
c1f43410e6 Implement PriorityQueue.Remove (#93994)
* Implement PriorityQueue.Remove

* Update src/libraries/System.Collections/src/System/Collections/Generic/PriorityQueue.cs

* Update src/libraries/System.Collections/src/System/Collections/Generic/PriorityQueue.cs

Co-authored-by: Dan Moseley <danmose@microsoft.com>

* Update src/libraries/System.Collections/src/System/Collections/Generic/PriorityQueue.cs

* Update src/libraries/System.Collections/src/System/Collections/Generic/PriorityQueue.cs

* Update src/libraries/System.Collections/src/System/Collections/Generic/PriorityQueue.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>

* Address feedback.

* Address feedback

* Add a Dijkstra smoke test.

* Alias distance type

---------

Co-authored-by: Dan Moseley <danmose@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
2023-10-30 16:04:33 +00:00
Eirik TsarpalisandJeff Handley b09e18e8b6 Honor JsonSerializerOptions.PropertyNameCaseInsensitive in property name conflict resolution. (#93933)
* Honor JsonSerializerOptions.PropertyNameCaseInsensitive in property name conflict resolution.

* Update src/libraries/System.Text.Json/tests/Common/PropertyNameTests.cs

Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>

* Address feedback

---------

Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
2023-10-24 21:30:52 +01:00
Eirik Tsarpalis f113d9de57 Honor naming policy of JsonStringEnumConverter on dictionary key deserialization. (#93792) 2023-10-22 12:30:32 +01:00
Eirik Tsarpalis a22dee15d0 Throw NotSupportedException when applying JsonObjectHandling.Populate on types with parameterized constructors. (#92937) 2023-10-03 18:08:46 +01:00
Eirik Tsarpalis 5d3cfb1573 Add testing for #92539. (#92926)
* Add testing for #92539.

* Remove netfx test skips.
2023-10-03 17:55:23 +01:00
Eirik Tsarpalis eaa8ea19f4 Apply sequence equality comparison to the final Regex incremental value. (#92835)
* Apply sequence equality comparison to the final Regex incremental value.

* Avoid using SequenceEqual
2023-09-29 17:47:21 -04:00
Eirik Tsarpalis 01104d6d3b Remove CompilationProvider dependency from the source generator. (#92833) 2023-09-29 17:47:12 -04:00
Eirik Tsarpalis 8eeebd832b Add missing STJ xml docs (#92138)
* Add missing STJ xml docs

* fix docs and remove suppressions
2023-09-15 21:17:30 +01:00
Eirik Tsarpalis 6cafb45582 Add System.Net.Http.Json README 2023-09-06 16:40:23 +01:00
Eirik Tsarpalis 09f2307f58 Remove quotes from language versions in source gen diagnostics. (#90720) 2023-08-17 19:11:28 +01:00
Eirik Tsarpalis 227e8823e6 Fix support for non-public default constructors using JsonIncludeAttribute (#90612)
* Fix support for non-public constructors using JsonIncludeAttribute

* Address feedback.
2023-08-16 06:59:06 +01:00
Eirik Tsarpalis ff9beed32c Improve error message in the new JsonNode.GetElementIndex() and GetPropertyName() methods. (#90486) 2023-08-14 14:22:38 +01:00
Eirik Tsarpalis 2d9acc6f78 Improve System.Text.Json configuration list debugging (#90411)
* Improve debugging for configuration lists.

* Add missing DebuggerBrowsable.Never annotations.

* Add DebuggerBrowsableState.Never to a few internal getters that may throw.

* Simplify JsonPropertyInfo DebuggerDisplay

* Ensure debugger display matches API name.
2023-08-11 21:33:38 +01:00
Eirik Tsarpalis c6db89c5d5 Rework SnakeCase/KebabCase naming policies to closer match Json.NET's (#90316)
* Rework JsonNamingPolicy.SnakeCase/KebabCase to match Json.NET semantics.

* Alternative implementation that handles digits properly but doesn't trim non-alphanumeric characters.

* Refactor to switch statement

* add non-ascii letter test case

* Address feedback

* Add support for surrogate pair capitalization

* Revert "Add support for surrogate pair capitalization"

This reverts commit c1c5d1c8a039235a14caa0f02c7e97d1f696634c.

* Add surrogate pair unit tests

* Address more feedback

* Address feedback and add a few more test cases.

* Add more surrogate pair tests

* Add unpaired surrogate testing
2023-08-11 12:18:11 +01:00
Eirik Tsarpalis 5730c2098b Ensure OuterLoop test doesn't use reflection in SG test suite. (#90137) 2023-08-08 10:37:01 +01:00
Eirik Tsarpalis a409892231 Fix analyzer warning that is breaking the build (#90136) 2023-08-08 09:50:11 +02:00
Eirik Tsarpalis c0967dcfc1 Add JsonSerializerOptions.MakeReadOnly(bool) overload. (#90013) 2023-08-07 11:57:35 +01:00
Eirik Tsarpalis 4f7fbf55d4 Fix race condition in JsonSerializerOptions initialization. (#89935) 2023-08-03 18:07:32 +01:00
Eirik Tsarpalis 4ceb853246 Apply mitigations for a recent STJ performance regression (#89856) 2023-08-02 19:11:51 +01:00
Eirik Tsarpalis 045f9d22b6 Move JsonSerializerOptions initialization logic to a shared helper. (#89729) 2023-07-31 23:33:37 +03:00
Eirik Tsarpalis 72bcd73f3d Ensure built-in converters can skip JSON values when invoked via custom converters in async deserialization. (#89637) 2023-07-28 20:33:11 +03:00
Eirik Tsarpalis 76070f7e07 Fix collection deserialization in polymorphic objects. (#89635) 2023-07-28 20:32:48 +03:00
Eirik Tsarpalis 67b3117309 Improve serialization error message when IsReflectionEnabledByDefault is turned off. (#89578)
* Improve serialization error message when IsReflectionEnabledByDefault is turned off.

* Update trimming tests
2023-07-27 21:16:12 +01:00
Eirik Tsarpalis c02a0265e6 Fix #88628. (#89569) 2023-07-27 18:58:37 +01:00
Eirik Tsarpalis 84873e6c4e Ensure System.Text.Json SG diagnostics don't use Location values from referenced assemblies. (#89518) 2023-07-27 13:13:27 +01:00
Eirik Tsarpalis 6c0599fdf6 Fix STJ source gen support for System.BinaryData. (#89454)
* Fix STJ source gen support for System.BinaryData.

* remove redundant sealed keyword from converter overrides

* Generate compatibility suppressions

* Add comment to compatibility suppressions
2023-07-26 16:54:13 +01:00
Eirik Tsarpalis 0cba6f847b Disable failing test. (#89442) 2023-07-25 17:49:48 +01:00
Eirik Tsarpalis 8f5364695b Fix System.BinaryData tests failing in AOT. (#89381) 2023-07-25 12:29:56 +01:00
Eirik Tsarpalis 5bc100ed64 Emit a diagnostic when attributes deriving from JsonConverterAttribute are being used. (#89199)
* Emit a diagnostic when attributes deriving from JsonConverterAttribute are being used.

* Address feedback.
2023-07-21 17:23:44 +01:00
Eirik Tsarpalis 6db5113212 Fix System.Net.Http.Json tests in AOT (#89307) 2023-07-21 17:21:47 +01:00
Eirik Tsarpalis 8c27281ca6 Improve JsonSourceGenerationOptionsAttribute xml documentation. (#89082) 2023-07-19 00:11:21 -04:00
Eirik Tsarpalis 420b40f63a Disable reflection in source gen tests and fix AOT testing. (#89105) 2023-07-18 19:36:18 +01:00
Eirik Tsarpalis f83580df1d Add JsonSourceGenerationOptions.UseStringEnumConverter (#88984)
* Add JsonSourceGenerationOptions.UseStringEnumConverter.

* Fix failing tests in browser-wasm
2023-07-17 20:27:48 +01:00
Eirik Tsarpalis c9551c5c0c Fix naming conflict resolution algorithm for linear interface hierarchies. (#88916) 2023-07-17 17:12:07 +01:00
Eirik Tsarpalis acedeb273b Extend JsonSourceGenerationOptionsAttribute to have feature parity with JsonSerializerOptions. (#88753) 2023-07-14 17:37:45 +01:00
Eirik Tsarpalis 24d7f5a58a Extend JsonIncludeAttribute and JsonConstructorAttribute support to internal and private members (#88452)
* Relax JsonIncludeAttribute to also support private or internal members.

* Relax JsonConstructorAttribute to include internal or private constructors (where applicable).
2023-07-07 12:40:29 +01:00
Eirik Tsarpalis 104752ae28 Disable default JSON reflection when PublishTrimmed == true (#88480) 2023-07-07 09:45:01 +01:00
Eirik Tsarpalis 7fe6609efe Implement JsonTypeInfoResolver.WithAddedModifier (#88255) 2023-07-05 13:55:21 +01:00
Eirik Tsarpalis 1db4357891 Apply a number of improvements and bugfixes to JsonNode (#88194)
* Avoid JsonElement torn read in a few JsonArray/JsonDocument and unify code patterns.

* Simplify and clean up JsonValue implementation -- fix DeepEquality bugs.

* Update src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonValueOfTPrimitive.cs

* Avoid delegate allocation in the JsonObject setter.
2023-07-01 09:07:46 +01:00
Eirik Tsarpalis dbf3a16dba Document new STJ diagnostics and fix diagnostic id conflicts. (#87980) 2023-06-26 16:38:12 +01:00
Eirik Tsarpalis 478130b491 Add unsupported language detection to the STJ source generator (#87950)
* Make the STJ source generator detect unsupported C# language versions and emit error diagnostics.

* Fix whitespace

* Do not hardcode minimal lang version on diagnostic string.
2023-06-23 19:04:00 +01:00
Eirik Tsarpalis 5fd32d9989 Fix support for JsonSerializerContext contained in arbitrary types. (#87829)
* Fix support for JsonSerializerContext contained in struct types.

* Extend support to other kinds.

* Simplify testing

* Improve namespace detection logic.
2023-06-21 19:39:23 +01:00
Eirik Tsarpalis 139826b2b0 Fix a number of source generator bugs. (#87796)
* Fix a number of source generator bugs.

* Extract type attribute processing to a standalone method.
2023-06-20 18:43:29 +01:00
Eirik Tsarpalis 88cd88d2ee Ensure that parsed JsonElement values are never marked as disposable. (#87766) 2023-06-20 18:36:56 +01:00
Eirik TsarpalisandEric Erhardt cf4a851497 Address feedback from #87680. (#87695)
* Address feedback from #87680.

* Update src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/JsonSerializerWrapper.Reflection.cs

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>

---------

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
2023-06-16 23:30:41 +01:00
Eirik Tsarpalis 76da696f3f Attempt to fix browser-wasm test failures. (#87680)
* Attempt to fix browser-wasm test failures.

* Address feedback.
2023-06-16 13:50:21 +01:00
Eirik Tsarpalis 2f6380ee9c Remove KeyValuePairConverter. (#87637) 2023-06-16 00:11:07 -04:00
Eirik Tsarpalis 64cab8fd72 Re-enable disabled BigInteger tests. (#87640) 2023-06-15 23:45:21 +01:00
Eirik Tsarpalis 58d28f950f Add regression testing for #76802. (#87632) 2023-06-15 22:26:38 +01:00
Eirik Tsarpalis a2f4a94e3f Make the soure generator format enums using their identifiers rather than numeric values. (#87557)
* Make the soure generator format enums using their identifiers rather than numeric values.

* Address feedback
2023-06-15 13:32:19 +01:00
Eirik TsarpalisandLayomi Akinrinade baceeb0283 Subject src-gen serializer to full number-handling test (#87484)
* Subject src-gen serializer to full number-handling tests

* Make failing tests pass

* Revert API break and use contract APIs instead

* React to test infra changes

* Fix rebase conflicts & ensure all tests are passing.

---------

Co-authored-by: Layomi Akinrinade <laakinri@microsoft.com>
2023-06-13 22:10:48 +01:00
Eirik Tsarpalis 255f364103 Ensure that types of ignored or inaccessible properties are not included by the source generator. (#87383) 2023-06-13 09:30:27 +01:00
Eirik Tsarpalis 52bacbc2f0 Add a JsonConverter.Type property. (#87382) 2023-06-12 19:55:10 +01:00
Eirik Tsarpalis 2905fe7590 Fix DeserializeAsyncEnumerable generic recursion issue. (#87276) 2023-06-08 19:39:04 +01:00
Eirik Tsarpalis 9d7840cce5 Implement JsonStringEnumConverter<TEnum> (#87224)
* Fix NativeAOT support for JsonStringEnumConverter.

* Fix merge issue.

* Implement JsonStringEnumConverter<TEnum>.

* Remove leftover comments.

* Revert unnecessary suppression.

* Update compatibility suppressions.

* Add missing XML docs

* Fix capitalization.

* add local project compatibility suppressions

* apply suggestion in all location

* Fix failing test.

* Ensure both converter factories throw an appropriate exception when passed invalid inputs.
2023-06-08 00:20:34 +01:00
Eirik Tsarpalis 2eaf1d20e7 Move the CreateCastingConverter<T>() method to the base JsonConverter type. (#87211) 2023-06-07 15:16:19 +01:00
Eirik Tsarpalis 6328b231f7 Fix a number of accessibility resolution issues in the source generator. (#87136) 2023-06-05 22:41:49 +01:00
Eirik Tsarpalis fe980088a9 Ensure JsonSerializerOptions always returns a JsonTypeInfo for object. (#87093)
* Ensure JsonSerializerOptions always returns a JsonTypeInfo for `object`.

* Address feedback.
2023-06-05 14:21:45 +01:00
Eirik Tsarpalis 48ce1d901f Ensure the correct typeToConvert parameter is being passed to constructor parameter converters. (#87111) 2023-06-04 12:37:42 -04:00
Eirik Tsarpalis 15583461b9 Enable Native AOT testing in System.Text.Json. (#86975)
* Enable Native AOT testing in System.Text.Json. Fix #73431.

* Enabled AOT testing for generic theories/MakeGenericMethod tests. Address misc feedback.

* Remove hardcoded JsonSerializer calls from test suite.
2023-06-02 10:59:06 +01:00
Eirik Tsarpalis 1af3c9eb5d Fix recursive type support when consuming source generated code from the .NET 6 sdk. (#86821) 2023-05-31 14:59:31 +01:00
Eirik Tsarpalis 4d709cd122 Ensure Memory<T>/ReadOnlyMemory<T> are marked as unsupported types. (#86900)
* Ensure Memory<T>/ReadOnlyMemory<T> are marked as unsupported types.

* Update src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/InvalidTypeTests.cs
2023-05-30 23:12:23 +01:00
Eirik Tsarpalis bf7fb2ecbf Fix deserialization of nullable structs with constructors. (#86896) 2023-05-30 19:25:02 +01:00
Eirik Tsarpalis 081f87c02d Ensure that the generated JsonSerializerContext.Default static property returns a sigleton. (#86757) 2023-05-25 15:38:16 +01:00
Eirik Tsarpalis eac41a3205 Remove STJ dependency on IncrementalValuesProvider.Collect() (#86616)
* Remove dependency on IncrementalValuesProvider.Collect()

* Address feedback.
2023-05-23 20:38:17 +01:00
Eirik Tsarpalis 93b7dbaa3c Avoid capturing diagnostic objects in SG incremental values. (#86605) 2023-05-22 22:39:42 +01:00
Eirik Tsarpalis c5cfd7b97f Apply the SourceWriter pattern to the STJ source generator. (#86526)
* Use the SourceWriter pattern in the STJ SG emitter.

* Make helper method static.

* Minimize the size of the generic helper method.
2023-05-22 18:30:34 +01:00
Eirik Tsarpalis 60f8edfbd9 Remove System.Reflection wrappers from the STJ source generator. (#86334)
* Remove System.Reflection wrappers from the STJ source generator.

* Fix linker warning.

* Fix namespace.

* Move ImmutableEquatableArray to Helpers folder.

* Fix build

* Salvage test from TypeWrapperTests
2023-05-18 13:44:23 +01:00
Eirik Tsarpalis bda1f6c691 Revert RequiredAttribute.DisallowAllDefaultValues (#86378) 2023-05-17 17:23:45 +01:00
Eirik TsarpalisandStephen Toub c21406dd8a Make the STJ source generator cache friendly (#86121)
* Make the STJ source generator cache friendly.

* Address feedback

* Fix GetHashCode implementation.

* Update src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>

* Remove TODO comment.

* Remove TODO comment.

* Update src/libraries/System.Text.Json/gen/Model/ImmutableEquatableArray.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>

* Address feedback.

* Address feedback

* Expand incremental compilation unit test coverage to include Roslyn tracking.

---------

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2023-05-12 18:47:47 +01:00
Eirik Tsarpalis 0a57a9b209 Fix null handling of built-in converters. (#86056) 2023-05-10 19:18:38 +01:00
Eirik Tsarpalis f924d6b5f6 Remove a number of unneeded nullability suppressions. (#85788)
* Fix nullability annotation of the JsonSerializer.Serialize methods.

* Remove a few more suppressions from the implementation.

* Revert annotations in the public APIs.
2023-05-04 23:13:35 +01:00
Eirik Tsarpalis 5eb4ff0e29 Remove common tests from the Roslyn3.11 test project. (#85165)
* Remove shared tests from the Roslyn3.11 test project.

* Decouple Roslyn3.11 smoke tests from shared test classes.

* Fix project file order.
2023-04-24 14:19:41 +01:00
Eirik Tsarpalis 4da4aafc95 Fix generic recursion condition when calling DeserializeAsyncEnumerable in NativeAOT. (#85176)
* Fix polymorphic recursion condition when calling DeserializeAsyncEnumerable in NativeAOT.

* Address feedback
2023-04-22 19:38:04 +01:00
Eirik Tsarpalis fcae013a4a Do not surface resolver exceptions when running ancestor type resolution (#85108) 2023-04-20 18:18:02 +01:00
Eirik Tsarpalis 3a01050b47 Fix a number of issues related to boxed value serialization (#84768)
* Remove unspeakable type support form serialization overloads accepting an explicit `Type` parameter.

* Honor polymorphism metadata when serializing boxed polymorphic values.

* Support boxed root value serialization in source generators that don't supply metadata for `object`.

* Address feedback
2023-04-19 18:45:20 +01:00
Eirik Tsarpalis 2d9cb2d33f Report contents of chained resolvers in exception messages. (#84757) 2023-04-14 09:21:31 +01:00
Eirik Tsarpalis 0b081118de Add a JsonSerializerOptions.TryGetTypeInfo method. (#84411)
* Mark the return type of the JsonSerializer.GetTypeInfo method as nullable.

* Use new TryGetTypeInfo method instead.
2023-04-12 15:59:13 +01:00
Eirik TsarpalisandEric Erhardt 0f11212710 Implement the JsonSerializer.IsReflectionEnabledByDefault feature switch (#83844)
* Implement the STJ.DisableDefaultReflection feature switch.

* Reinstate accidentally stripped attribute

* Address feedback.

* Address feedback.

* Add a trimming test for STJ

* Move trimming test to existing trimming tests folder.

* Add source gen serialization test case to Trimming test.

* Fix style.

* Expose the feature switch as a property on JsonSerializer -- rename feature switch to match namespace.

* Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Helpers.cs

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>

* Update src/libraries/System.Text.Json/tests/System.Text.Json.Tests/TrimmingTests/IsReflectionEnabledByDefaultFalse.cs

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>

* Address feedback.

* Address feedback.

* Add entry to feature-switches.md

---------

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
2023-04-05 21:21:06 +01:00
Eirik Tsarpalis e43ddbf9dc Revert #80698 and obsolete JsonSerializerOptions.AddContext (#84022)
* Revert 9a6686be5d.

* Obsolete JsonSerializerOptions.AddContext
2023-03-30 12:40:48 +01:00
Eirik Tsarpalis 4f2397ffa3 Fix #84053. (#84070) 2023-03-29 15:26:53 +01:00
Eirik TsarpalisandDan Moseley dcd0506788 Implement support for unspeakable types. (#83631)
* Implement support for unspeakable types.

* Remove unneeded declarations.

* Record ambiguity information in exception message.

* Fix error message testing in wasm.

* Address feedback.

* Add test case for interface POCOs

* Update src/libraries/System.Text.Json/src/Resources/Strings.resx

Co-authored-by: Dan Moseley <danmose@microsoft.com>

---------

Co-authored-by: Dan Moseley <danmose@microsoft.com>
2023-03-20 20:08:09 +00:00
Eirik Tsarpalis 46632f4f47 Implement JsonSerializerOptions.TypeInfoResolverChain. (#83358)
* Implement JsonSerializerOptions.TypeInfoResolverChain.

* Move DebuggerDisplay from ConfigurationList to JsonTypeInfoResolverChain -- address feedback.

* Ensure JsonSerializerOptions hash equates null with empty converter list.

* Use correct error message when modifying readonly resolver chains.

* Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Caching.cs

* Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Caching.cs
2023-03-15 07:16:26 +00:00