You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[STJ] Disallow property names that conflict with metadata property names #106390
area-System.Text.Jsonbreaking-changeIssue or PR that represents a breaking API or functional change over a previous release.enhancementProduct code improvement that does NOT require public API changes/additionsin-prThere is an active PR which will close this issue when it is mergedneeds-breaking-change-doc-createdBreaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet
I think the best course of action is to disallow properties that conflict with type discriminators. It produces JSON with duplicate properties that cannot be roundtripped -- the failure of the schema exporter is merely a side-effect of configuration being invalid.
This should include conflicting type discriminator id's, as well as reference types containing $id or $ref in cases where reference preservation has been enabled.
Reacted by Martin Costello and Juliano Leal Goncalves
needs-breaking-change-doc-createdBreaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet
Added needs-breaking-change-doc-created label because this issue has the breaking-change label.
Create and link to this issue a matching issue in the dotnet/docs repo using the breaking change documentation template, then remove this needs-breaking-change-doc-created label.
Tagging @dotnet/compat for awareness of the breaking change.
area-System.Text.Jsonbreaking-changeIssue or PR that represents a breaking API or functional change over a previous release.enhancementProduct code improvement that does NOT require public API changes/additionsin-prThere is an active PR which will close this issue when it is mergedneeds-breaking-change-doc-createdBreaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet
Activity
dotnet-policy-service commentedon Aug 14, 2024
Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Aug 14, 2024
Added
needs-breaking-change-doc-createdlabel because this issue has thebreaking-changelabel.needs-breaking-change-doc-createdlabel.Tagging @dotnet/compat for awareness of the breaking change.
gregsdennis commentedon Aug 15, 2024
Does the usage of
$idor$refhave anything to do with JSON Schema, or is it independent/other functionality?eiriktsarpalis commentedon Aug 15, 2024
Unrelated, it's metadata being emitted when serializing with
ReferenceHandler.Preserve.gregsdennis commentedon Aug 15, 2024
Okay. I understand it's existing behavior, but the overlap with JSON Schema is a bit concerning for me.