JsonCommentHandling Enum
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Defines how the Utf8JsonReader struct handles comments.
public enum class JsonCommentHandling
public enum JsonCommentHandling
type JsonCommentHandling =
Public Enum JsonCommentHandling
- Inheritance
Name | Value | Description |
---|---|---|
Disallow | 0 | Doesn't allow comments within the JSON input. Comments are treated as invalid JSON if found, and a JsonException is thrown. This is the default value. |
Skip | 1 | Allows comments within the JSON input and ignores them. The Utf8JsonReader behaves as if no comments are present. |
Allow | 2 | Allows comments within the JSON input and treats them as valid tokens. While reading, the caller can access the comment values. |
For more information, see How to allow some kinds of invalid JSON with System.Text.Json.
Product | Versions |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10 |
.NET Standard | 2.0 (package-provided) |
.NET feedback
.NET is an open source project. Select a link to provide feedback: