Skip to content

Implement JsonSerializerOptions.RespectRequiredConstructorParameters#103096

Merged
eiriktsarpalis merged 4 commits into
dotnet:mainfrom
eiriktsarpalis:required-ctor-params
Jun 6, 2024
Merged

Implement JsonSerializerOptions.RespectRequiredConstructorParameters#103096
eiriktsarpalis merged 4 commits into
dotnet:mainfrom
eiriktsarpalis:required-ctor-params

Conversation

@eiriktsarpalis

Copy link
Copy Markdown
Member

Fix #100075

@ghost

ghost commented Jun 5, 2024

Copy link
Copy Markdown

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

1 similar comment
@ghost

ghost commented Jun 5, 2024

Copy link
Copy Markdown

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@eiriktsarpalis eiriktsarpalis self-assigned this Jun 5, 2024
@eiriktsarpalis eiriktsarpalis added this to the 9.0.0 milestone Jun 5, 2024
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

Debug.Assert(parent.PropertyCache != null);

// Soft cut-off length - once message becomes longer than that we won't be adding more elements
const int CutOffLength = 50;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I've updated the error message so that property names are wrapped with single quotes, I'm also increasing the cutoff so that roughly speaking the same number of properties are being displayed.

Comment thread src/libraries/System.Text.Json/src/Resources/Strings.resx

@krwq krwq left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM assuming comments are addressed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a STJ feature flag treating non-optional constructor parameters as required

3 participants