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.
We should review this name.
There was a problem hiding this comment.
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.
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.
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.