Use underlying type converter for nullable type (#84208)
authorBadre BSAILA <54767641+pedrobsaila@users.noreply.github.com>
Wed, 31 May 2023 11:29:27 +0000 (13:29 +0200)
committerGitHub <noreply@github.com>
Wed, 31 May 2023 11:29:27 +0000 (12:29 +0100)
commit2a1b52a1b691c42a7f4079fa86625569584a1c66
treeaae5426cf705cefa2e9d43d537260d761cbfe048
parentf9246538e3d49b90b0e9128d7b1defef57cd6911
Use underlying type converter for nullable type (#84208)

* Use underlying type converter for nullable type

* verify that we use underlying type converter for nullable types

* rollback a little change

* Update src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs

* Update src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs

* Use consistent indentation.

* Fix runtime support for nullable properties with custom converters.

---------

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs
src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/ContextClasses.cs
src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MetadataAndSerializationContextTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MetadataContextTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/MixedModeContextTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/RealWorldContextTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/SerializationContextTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/TestClasses.CustomConverters.cs
src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs