// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; namespace Microsoft.AspNetCore.Mvc { internal class MvcJsonOptionsConfigureCompatibilityOptions : ConfigureCompatibilityOptions { public MvcJsonOptionsConfigureCompatibilityOptions( ILoggerFactory loggerFactory, IOptions compatibilityOptions) : base(loggerFactory, compatibilityOptions) { } protected override IReadOnlyDictionary DefaultValues { get { var values = new Dictionary(); if (Version >= CompatibilityVersion.Version_2_1) { values[nameof(MvcJsonOptions.AllowInputFormatterExceptionMessages)] = true; } return values; } } } }