-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Add ConfigureRouteHandlerJsonOptions for M.A.Htt.Json.JsonOptions #39502
Conversation
b648155
to
83d405d
Compare
/// <param name="configureOptions">The <see cref="Action{JsonOptions}"/> to configure the | ||
/// <see cref="JsonOptions"/>.</param> | ||
/// <returns>The modified <see cref="IServiceCollection"/>.</returns> | ||
public static IServiceCollection ConfigureHttpJsonOptions(this IServiceCollection services, Action<JsonOptions> configureOptions) |
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 should review this name.
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.
Is this the first time we're adding a ConfigureWhatever()
IServiceCollection
extension method for an option type? I guess in most cases it wouldn't be necessary because you could have an overload that takes a configureOptions
callback to AddWhatever()
for most option types.
The only thing I see right now that's close to this is ConfigureApplicationCookie()
and ConfigureExternalCookie()
which use named options.
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.
Not exactly the same, but we added ConfigureApiBehaviorOptions
to MVC to solve a similar discoverability issue: https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.mvccoremvcbuilderextensions.configureapibehavioroptions?view=aspnetcore-6.0#microsoft-extensions-dependencyinjection-mvccoremvcbuilderextensions-configureapibehavioroptions(microsoft-extensions-dependencyinjection-imvcbuilder-system-action((microsoft-aspnetcore-mvc-apibehavioroptions)))
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 updated the name to ConfigureRouteHandlerJsonOptions
per our email conversation but open to other ideas.
Also Closes #35904 |
@Kahbazi Do you not care about endpoint specific JSON options? |
3b90756
to
3afbcde
Compare
@halter73 It's not an issue for me at the moment, since it's also doable by combination of |
d0b40fa
to
eeca3a5
Compare
…tnet#39502) * Add ConfigureHttpJsonOptions for M.A.Htt.Json.JsonOptions * Address initial feedback from API review * Fix method reference in doc comment * Fix up crefs
Closes #39226.