Fix handling of required & init-only properties with custom property names in source...
authorEirik Tsarpalis <eirik.tsarpalis@gmail.com>
Thu, 9 Mar 2023 11:44:58 +0000 (11:44 +0000)
committerGitHub <noreply@github.com>
Thu, 9 Mar 2023 11:44:58 +0000 (11:44 +0000)
commitca4f51f29b90c3cd3b6e7db8a9922cb97ed0075d
treee690675f6905b18a5a35864b49a0b389a495f21c
parentc65dce22ed4574b40c4b7cbddcc535f1fb35bdda
Fix handling of required & init-only properties with custom property names in source gen. (#83147)

* Fix handling of required & init-only properties with custom property names in source gen.

* Address feedback.
src/libraries/System.Text.Json/gen/JsonSourceGenerator.Emitter.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/DefaultJsonTypeInfoResolver.Helpers.cs
src/libraries/System.Text.Json/tests/Common/PropertyVisibilityTests.InitOnly.cs
src/libraries/System.Text.Json/tests/Common/RequiredKeywordTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/Serialization/PropertyVisibilityTests.cs
src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/Serialization/RequiredKeywordTests.cs