JsonOptions.AllowInputFormatterExceptionMessages Property

Definition

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

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