-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Document JsonSerializerDefaults.Strict behavior #12255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document JsonSerializerDefaults.Strict behavior #12255
Conversation
…vior Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR clarifies the documentation for JsonSerializerDefaults.Strict by replacing a vague description with a concrete list of the behaviors it enables, aligning the format with JsonSerializerDefaults.Web.
Changes:
- Expanded
Strictmember docs to list the specific strictness behaviors it implies. - Added a markdown-based remarks section describing the strict deserialization behavior.
- Adjusted the summary structure to match the existing
Webmember documentation style.
| <para>Option values appropriate for strict JSON parsing.</para> | ||
| <para>This member implies that:</para> | ||
| <para>- Unmapped JSON properties are disallowed.</para> | ||
| <para>- Duplicate JSON properties aren't allowed.</para> |
Copilot
AI
Jan 22, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bullet list mixes phrasing styles ("are disallowed" vs "aren't allowed"). Consider using consistent wording across all bullets (for example, use "are disallowed" for both).
| <para>- Duplicate JSON properties aren't allowed.</para> | |
| <para>- Duplicate JSON properties are disallowed.</para> |
gewarren
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preview looks good.
The
JsonSerializerDefaults.Strictdocumentation was vague ("stricter policies should be applied when deserializing from JSON").Changes
Updated
xml/System.Text.Json/JsonSerializerDefaults.xmlto document the four specific behaviors configured byStrict:UnmappedMemberHandling.Disallow)AllowDuplicateProperties = false)RespectNullableAnnotations = true)RespectRequiredConstructorParameters = true)Documentation format now matches
JsonSerializerDefaults.Webwith bulleted summary and remarks section.Original prompt
JsonSerializerDefaults.Strictdoes not document its behavior #12254💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.