Skip to content

Respect polymorphism when selecting ambient Populate - #138525

Draft
eiriktsarpalis wants to merge 3 commits into
mainfrom
copilot/fix-json-populate-configuration
Draft

eiriktsarpalis wants to merge 3 commits into
mainfrom
copilot/fix-json-populate-configuration

Conversation

@eiriktsarpalis

@eiriktsarpalis eiriktsarpalis commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Ambient Populate could populate a polymorphic property even though an explicit Populate annotation rejects it.

  • Handling: Fall back to Replace when the property type supports discriminator-based polymorphic deserialization.
  • Scope: Preserve the existing declaring-type restriction. Recursive metadata configuration and classifier-only polymorphism remain unresolved.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-text-json
See info in area-owners.md if you want to be subscribed.

eiriktsarpalis and others added 2 commits November 30, 2026 13:57
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@eiriktsarpalis eiriktsarpalis changed the title [WIP] Fix inconsistent Populate configuration for polymorphic properties Respect polymorphism when selecting ambient Populate Nov 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

System.Text.Json ambient Populate configuration is inconsistent with property annotation for polymorphic properties

2 participants