[ExcludeFromCodeCoverage] // DEVNOTE: No need to test JsonSerializerSettings really public static IAppMetricsMiddlewareHealthChecksOptionsBuilder AddJsonFormatters(this IAppMetricsMiddlewareHealthChecksOptionsBuilder options, JsonSerializerSettings serializerSettings) { options.AppMetricsHealthChecksChecksBuilder.Services.Replace(ServiceDescriptor.Transient <IHealthResponseWriter, JsonHealthResponseWriter>()); options.AppMetricsHealthChecksChecksBuilder.Services.Replace(ServiceDescriptor.Transient <IHealthStatusSerializer>(provider => new HealthStatusSerializer(serializerSettings))); return(options); }
/// <summary> /// Enables Plain Text serialization on the health endpoint's response /// </summary> /// <param name="options">The metrics middleware options checksBuilder.</param> /// <returns>The metrics middleware options checksBuilder</returns> public static IAppMetricsMiddlewareHealthChecksOptionsBuilder AddAsciiFormatters(this IAppMetricsMiddlewareHealthChecksOptionsBuilder options) { options.AppMetricsHealthChecksChecksBuilder.Services.Replace(ServiceDescriptor.Transient <IHealthResponseWriter, AsciiHealthResponseWriter>()); return(options); }