Skip to content

Commit

Permalink
Address initial feedback from API review
Browse files Browse the repository at this point in the history
  • Loading branch information
captainsafia authored Jan 19, 2022
1 parent 83d405d commit 3afbcde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions src/Http/Http.Extensions/src/HttpJsonServiceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,29 @@
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.AspNetCore.Http.Json;
using Microsoft.Extensions.DependencyInjection;

namespace Microsoft.AspNetCore.Http;
namespace Microsoft.Extensions.DependencyInjection;

/// <summary>
/// Extension methods to configure JSON serialization behavior.
/// </summary>
public static class HttpJsonServiceExtensions
public static class RouteHandlerJsonServiceExtensions
{
#pragma warning disable CS0419 // Ambiguous reference in cref attribute
/// <summary>
/// Configures options used for reading and writing JSON by route handlers.
/// </summary>
/// <remarks>
/// The options configured here will only affect JSON returned and processed
/// from route handlers, not controllers.
/// from route handlers, not controllers, when using <see cref="System.Net.Http.Json.HttpContentJsonExtensions.ReadFromJsonAsync" />
/// and <see cref="Microsoft.AspNetCore.Http.HttpResponseJsonExtensions.WriteAsJsonAsync" />.
/// </remarks>
/// <param name="services">The <see cref="IServiceCollection" /> to configure options on.</param>
/// <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)
#pragma warning restore CS0419 // Ambiguous reference in cref attribute
public static IServiceCollection ConfigureRouteHandlerJsonOptions(this IServiceCollection services, Action<JsonOptions> configureOptions)
{
services.Configure<JsonOptions>(configureOptions);
return services;
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Http.Extensions/src/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#nullable enable
Microsoft.AspNetCore.Http.HttpJsonServiceExtensions
static Microsoft.AspNetCore.Http.HttpJsonServiceExtensions.ConfigureHttpJsonOptions(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Action<Microsoft.AspNetCore.Http.Json.JsonOptions!>! configureOptions) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
Microsoft.Extensions.DependencyInjection.RouteHandlerJsonServiceExtensions
static Microsoft.Extensions.DependencyInjection.RouteHandlerJsonServiceExtensions.ConfigureRouteHandlerJsonOptions(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Action<Microsoft.AspNetCore.Http.Json.JsonOptions!>! configureOptions) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!

0 comments on commit 3afbcde

Please sign in to comment.