JsonCommentHandling 列舉

定義

定義 Utf8JsonReader 結構如何處理註解。

public enum class JsonCommentHandling
public enum JsonCommentHandling
type JsonCommentHandling = 
Public Enum JsonCommentHandling
繼承
JsonCommentHandling

欄位

Allow 2

允許在 JSON 輸入內使用註解,並將其視為有效的權杖。 讀取時,呼叫端可以存取註解值。

Disallow 0

不允許在 JSON 輸入內使用註解。 找到的註解會視為無效 JSON,並擲回 JsonException。 這是預設值。

Skip 1

允許在 JSON 輸入內使用註解,並予以忽略。 Utf8JsonReader 的行為就如同未呈現任何註解。

備註

如需詳細資訊,請參閱 如何使用 System.Text.Json 允許某種不正確 JSON

適用於