Add ReadOnlySpan<char> overloads to JsonSerializer.Deserialize (#41957)
authorHuo Yaoyuan <huoyaoyuan@hotmail.com>
Wed, 14 Oct 2020 15:19:24 +0000 (23:19 +0800)
committerGitHub <noreply@github.com>
Wed, 14 Oct 2020 15:19:24 +0000 (08:19 -0700)
commit7ca6d85188e3352935d33b2202f2de8d253cc419
tree48a814f57a3d13094b38012e49a4dc6b2a03a9d4
parentc9dda914b9e2583080a040891d39ea63363d9b42
Add ReadOnlySpan<char> overloads to JsonSerializer.Deserialize (#41957)

* Add char span overloads to JsonSerializer.Deserialize.

* Add new methods to ref source.

* Fix ambiguous call in test.

* Fix documentation issue.

* Guard and test for empty span.

* Add span in deserialization test wrapper.

* Apply doc suggestions

Co-authored-by: Layomi Akinrinade <layomia@gmail.com>
* Treat default span as empty, and cover returnType in test.

* Apply doc suggestions

Co-authored-by: Ahson Khan <ahkha@microsoft.com>
* Add exception doc for null returnType.

Co-authored-by: Layomi Akinrinade <layomia@gmail.com>
Co-authored-by: Ahson Khan <ahkha@microsoft.com>
src/libraries/System.Text.Json/ref/System.Text.Json.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.String.cs
src/libraries/System.Text.Json/tests/Serialization/ConstructorTests/ConstructorTests.ParameterMatching.cs
src/libraries/System.Text.Json/tests/Serialization/DeserializationWrapper.cs
src/libraries/System.Text.Json/tests/Serialization/ReadValueTests.cs