Dela via


MvcNewtonsoftJsonOptions.AllowInputFormatterExceptionMessages Property

Definition

Gets or sets a flag to determine whether error messages from JSON deserialization by the NewtonsoftJsonInputFormatter will be added to the ModelStateDictionary. If false, a generic error message will be used instead.

public:
 property bool AllowInputFormatterExceptionMessages { bool get(); void set(bool value); };
public bool AllowInputFormatterExceptionMessages { get; set; }
member this.AllowInputFormatterExceptionMessages : bool with get, set
Public Property AllowInputFormatterExceptionMessages As Boolean

Property Value

The default value is true.

Remarks

Error messages in the ModelStateDictionary are often communicated to clients, either in HTML or using BadRequestObjectResult. In effect, this setting controls whether clients can receive detailed error messages about submitted JSON data.

Applies to