-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Configure both Microsoft.AspNetCore.Http.Json.JsonOptions & Microsoft.AspNetCore.Mvc.JsonOptions using DocumentJsonSerializerOptions defaults #16836
Conversation
….AspNetCore.Mvc.JsonOptions using DocumentJsonSerializerOptions defaults
=> options.SerializerOptions.Merge(_jsonSerializerOptions); | ||
|
||
public void Configure(MvcJsonOptions options) | ||
=> options.JsonSerializerOptions.Merge(_jsonSerializerOptions); |
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.
When does this get called for you? Because it doesn't for me.
Also, this would be better in two classes.
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.
When does this get called for you? Because it doesn't for me.
Read the issue description
Also, this would be better in two classes.
The problem with two classes is the naming
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.
We could use partial class for clarity
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.
I understand the issue description. My question is, when testing this, when do you see line 23 be called?
You can have two IConfigureOptions
implementations, there's surely no difficulty in that.
I think we should not do this in OC because this will change the default of ASP.NET framework by OC which could impact people in a way they don't expect. I actually think we should remove I would do this instead #16831 (comment) |
This pull request has merge conflicts. Please resolve those before requesting a review. |
Fixed in #16837. |
This pull request includes changes to the
JsonOptionsConfigurations
class to support bothHttpJsonOptions
andMvcJsonOptions
configurations.Fixes #16831
/cc @wAsnk