Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
System.Text.Json
System Library
| Author | Microsoft |
| Version | 10.0.1 |
| Tags |
Public Types
System.​Runtime.​InteropServices
class JsonMarshal
An unsafe class that provides a set of methods to access the underlying data representations of JSON types.
System.​Text.​Json
enum JsonCommentHandling
Defines how the <see cref="T:System.Text.Json.Utf8JsonReader" /> struct handles comments.
class JsonDocument
Provides a mechanism for examining the structural content of a JSON value without automatically instantiating data values.
struct JsonDocumentOptions
Provides the ability for the user to define custom behavior when parsing JSON to create a <see cref="T:System.Text.Json.JsonDocument" /> .
struct JsonElement
Represents a specific JSON value within a <see cref="T:System.Text.Json.JsonDocument" /> .
struct JsonEncodedText
Provides methods to transform UTF-8 or UTF-16 encoded text into a form that is suitable for JSON.
class JsonException
Defines a custom exception object that is thrown when invalid JSON text is encountered, the defined maximum depth is passed, or the JSON text is not compatible with the type of a property on an object.
class JsonNamingPolicy
Determines the naming policy used to convert a string-based name to another format, such as a camel-casing format.
struct JsonProperty
Represents a single property for a JSON object.
struct JsonReaderOptions
Provides the ability for the user to define custom behavior when reading JSON.
struct JsonReaderState
Defines an opaque type that holds and saves all the relevant state information, which must be provided to the <see cref="T:System.Text.Json.Utf8JsonReader" /> to continue reading after processing incomplete data.
class JsonSerializer
Provides functionality to serialize objects or value types to JSON and to deserialize JSON into objects or value types.
Specifies scenario-based default serialization options that can be used to construct a <see cref="T:System.Text.Json.JsonSerializerOptions" /> instance.
class JsonSerializerOptions
Provides options to be used with <see cref="T:System.Text.Json.JsonSerializer" /> .
enum JsonTokenType
Defines the various JSON tokens that make up a JSON text.
enum JsonValueKind
Specifies the data type of a JSON value.
struct JsonWriterOptions
Allows the user to define custom behavior when writing JSON using the <see cref="T:System.Text.Json.Utf8JsonWriter" /> .
struct Utf8JsonReader
Provides a high-performance API for forward-only, read-only access to UTF-8 encoded JSON text.
class Utf8JsonWriter
Provides a high-performance API for forward-only, non-cached writing of UTF-8 encoded JSON text.
System.​Text.​Json.​Nodes
class JsonArray
Represents a mutable JSON array.
class JsonNode
The base class that represents a single node within a mutable JSON document.
struct JsonNodeOptions
Options to control <see cref="T:System.Text.Json.Nodes.JsonNode" /> behavior.
class JsonObject
Represents a mutable JSON object.
class JsonValue
Represents a mutable JSON value.
System.​Text.​Json.​Schema
class JsonSchemaExporter
Maps .NET types to JSON schema objects using contract metadata from <see cref="T:System.Text.Json.Serialization.Metadata.JsonTypeInfo" /> instances.
struct JsonSchemaExporterContext
Defines the context in which a JSON schema within a type graph is being generated.
Controls the behavior of the <see cref="T:System.Text.Json.Schema.JsonSchemaExporter" /> class.
System.​Text.​Json.​Serialization
interface IJsonOnDeserialized
Specifies that the JSON type should have its <see cref="M:System.Text.Json.Serialization.IJsonOnDeserialized.OnDeserialized" /> method called after deserialization occurs.
interface IJsonOnDeserializing
Specifies that the type should have its <see cref="M:System.Text.Json.Serialization.IJsonOnDeserializing.OnDeserializing" /> method called before deserialization occurs.
interface IJsonOnSerialized
Specifies that the type should have its <see cref="M:System.Text.Json.Serialization.IJsonOnSerialized.OnSerialized" /> method called after serialization occurs.
interface IJsonOnSerializing
Specifies that the type should have its <see cref="M:System.Text.Json.Serialization.IJsonOnSerializing.OnSerializing" /> method called before serialization occurs.
class JsonAttribute
Provides the base class for serialization attributes.
class JsonConstructorAttribute
When placed on a constructor, indicates that the constructor should be used to create instances of the type on deserialization.
class JsonConverter
Converts an object or value to or from JSON.
class JsonConverter<​T>
Converts an object or value to or from JSON.
class JsonConverterAttribute
When placed on a property or type, specifies the converter type to use.
class JsonConverterFactory
Supports converting several types by using a factory pattern.
class JsonDerivedTypeAttribute
When placed on a type declaration, indicates that the specified subtype should be opted into polymorphic serialization.
When placed on a property of type <see cref="T:System.Collections.Generic.IDictionary`2" /> , any properties that do not have a matching member are added to that dictionary during deserialization and written during serialization.
class JsonIgnoreAttribute
Prevents a property from being serialized or deserialized.
enum JsonIgnoreCondition
Controls how the <see cref="T:System.Text.Json.Serialization.JsonIgnoreAttribute" /> ignores properties on serialization and deserialization.
class JsonIncludeAttribute
Indicates that the member should be included for serialization and deserialization.
The <see cref="T:System.Text.Json.JsonNamingPolicy" /> to be used at run time.
The <see cref="T:System.Text.Json.Serialization.ReferenceHandler" /> to be used at run time.
class JsonNumberEnumConverter<​TEnum>
Converter to convert enums to and from numeric values.
enum JsonNumberHandling
Determines how <see cref="T:System.Text.Json.JsonSerializer" /> handles numbers when serializing and deserializing.
When placed on a type, property, or field, indicates what <see cref="T:System.Text.Json.Serialization.JsonNumberHandling" /> settings should be used when serializing or deserializing numbers.
Determines how deserialization will handle object creation for fields or properties.
Determines how deserialization handles object creation for fields or properties.
class JsonPolymorphicAttribute
When placed on a type, indicates that the type should be serialized polymorphically.
Specifies the property name that is present in the JSON when serializing and deserializing.
Specifies the property order that is present in the JSON when serializing. Lower values are serialized first.
If the attribute is not specified, the default value is 0.
class JsonRequiredAttribute
Indicates that the annotated member must bind to a JSON property on deserialization.
Instructs the System.Text.Json source generator to generate source code to help optimize performance when serializing and deserializing instances of the specified type and types in its object graph.
class JsonSerializerContext
Provides metadata about a set of types that is relevant to JSON serialization.
The generation mode for the System.Text.Json source generator.
Instructs the System.Text.Json source generator to assume the specified options will be used at run time via <see cref="T:System.Text.Json.JsonSerializerOptions" /> .
class JsonStringEnumConverter
Converts enumeration values to and from strings.
class JsonStringEnumConverter<​TEnum>
Converter to convert enums to and from strings.
Determines the string value that should be used when serializing an enum member.
Defines how objects of a derived runtime type that has not been explicitly declared for polymorphic serialization should be handled.
Defines how deserializing a type declared as an <see cref="T:System.Object" /> is handled during deserialization.
Determines how <see cref="T:System.Text.Json.JsonSerializer" /> handles JSON properties that cannot be mapped to a specific .NET member when deserializing object types.
When placed on a type, determines the <see cref="T:System.Text.Json.Serialization.JsonUnmappedMemberHandling" /> configuration for the specific type, overriding the global <see cref="P:System.Text.Json.JsonSerializerOptions.UnmappedMemberHandling" /> setting.
class ReferenceHandler
Defines how the <see cref="T:System.Text.Json.JsonSerializer" /> deals with references on serialization and deserialization.
class ReferenceHandler<​T>
Defines how the <see cref="T:System.Text.Json.JsonSerializer" /> deals with references on serialization and deserialization.
class ReferenceResolver
Defines how the <see cref="T:System.Text.Json.JsonSerializer" /> deals with references on serialization and deserialization.
Defines the core behavior of preserving references on serialization and deserialization.
System.​Text.​Json.​Serialization.​Metadata
Defines the default, reflection-based JSON contract resolver used by System.Text.Json.
interface IJsonTypeInfoResolver
Used to resolve the JSON serialization contract for requested types.
class JsonCollectionInfoValues<​TCollection>
Provides serialization metadata about a collection type.
struct JsonDerivedType
Represents a supported derived type defined in the metadata of a polymorphic type.
class JsonMetadataServices
Provides helpers to create and initialize metadata for JSON-serializable types.
class JsonObjectInfoValues<​T>
Provides serialization metadata about an object type with constructors, properties, and fields.
class JsonParameterInfo
Provides JSON serialization-related metadata about a constructor parameter.
class JsonParameterInfoValues
Provides information about a constructor parameter required for JSON deserialization.
class JsonPolymorphismOptions
Defines polymorphic configuration for a specified base type.
class JsonPropertyInfo
Provides JSON serialization-related metadata about a property or field.
class JsonPropertyInfoValues<​T>
Provides serialization metadata about a property or field.
class JsonTypeInfo
Provides JSON serialization-related metadata about a type.
class JsonTypeInfo<​T>
Provides JSON serialization-related metadata about a type.
enum JsonTypeInfoKind
Describes the kind of contract metadata a <see cref="T:System.Text.Json.Serialization.Metadata.JsonTypeInfo" /> specifies.
class JsonTypeInfoResolver
Contains utilities and combinators acting on <see cref="T:System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver" /> .