Skip to content
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

Fix comment in DocumentJsonSerializerOptionsConfiguration #16639

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

gvkries
Copy link
Contributor

@gvkries gvkries commented Aug 30, 2024

No description provided.

@@ -16,7 +16,7 @@ public DocumentJsonSerializerOptionsConfiguration(IOptions<JsonDerivedTypesOptio

public void Configure(DocumentJsonSerializerOptions options)
{
// Do not use the 'Merge' extension to avoid populating unwanted properties (e.g., Encoder, NumberHandling, AllowTrailingCommas).
// Do not use the 'Merge' extension to avoid populating unwanted properties (e.g., Encoder, NumberHandling, TypeInfoResolver).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Do not use the 'Merge' extension to avoid populating unwanted properties (e.g., Encoder, NumberHandling, TypeInfoResolver).
// Do not use the 'Merge' extension to avoid populating unwanted properties (e.g., Encoder, NumberHandling, AllowTrailingCommas, TypeInfoResolver).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hihi, no. You're setting that property 5 lines below ;-)

Copy link
Member

Choose a reason for hiding this comment

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

I see. I am okay with your PR and feel free to merge it. However, I think we should actually change this settings in the document settings. These settings should not be copied from Base and should be strictly set here. They could also slightly improve performance.

options.SerializerOptions.AllowTrailingCommas = false;
options.SerializerOptions.WriteIndented = false;
options.SerializerOptions.NumberHandling = JsonNumberHandling.Strict;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, maybe. For now let's not mess with this again ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants