Upraviť

Zdieľať cez


JsonWriterOptions.SkipValidation Property

Definition

Gets or sets a value that indicates whether the Utf8JsonWriter should skip structural validation and allow the user to write invalid JSON.

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

Property Value

true if structural validation is skipped and invalid JSON is allowed; false if an InvalidOperationException is thrown on any attempt to write invalid JSON.

Remarks

If the JSON being written is known to be correct, then skipping validation (by setting this property to true) could improve performance. An example of invalid JSON where the writer will throw (when SkipValidation is set to false) is when you write a value within a JSON object without a property name.

Applies to