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

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.
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" /> .
Provides methods to transform UTF-8 or UTF-16 encoded text into a form that is suitable for JSON.
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.
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.
Provides the ability for the user to define custom behavior when reading JSON.
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.
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.
Provides options to be used with <see cref="T:System.Text.Json.JsonSerializer" /> .
Defines the various JSON tokens that make up a JSON text.
Specifies the data type of a JSON value.
Allows the user to define custom behavior when writing JSON using the <see cref="T:System.Text.Json.Utf8JsonWriter" /> .
Provides a high-performance API for forward-only, read-only access to UTF-8 encoded JSON text.
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.
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

Maps .NET types to JSON schema objects using contract metadata from <see cref="T:System.Text.Json.Serialization.Metadata.JsonTypeInfo" /> instances.
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

Specifies that the JSON type should have its <see cref="M:System.Text.Json.Serialization.IJsonOnDeserialized.OnDeserialized" /> method called after deserialization occurs.
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.
Provides the base class for serialization attributes.
When placed on a constructor, indicates that the constructor should be used to create instances of the type on deserialization.
Converts an object or value to or from JSON.
class JsonConverter<​T>
Converts an object or value to or from JSON.
When placed on a property or type, specifies the converter type to use.
Supports converting several types by using a factory pattern.
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.
Prevents a property from being serialized or deserialized.
Controls how the <see cref="T:System.Text.Json.Serialization.JsonIgnoreAttribute" /> ignores properties on serialization and deserialization.
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.
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.
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.
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.
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" /> .
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.
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.
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.
Used to resolve the JSON serialization contract for requested types.
class JsonCollectionInfoValues<​TCollection>
Provides serialization metadata about a collection type.
Represents a supported derived type defined in the metadata of a polymorphic type.
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.
Provides JSON serialization-related metadata about a constructor parameter.
Provides information about a constructor parameter required for JSON deserialization.
Defines polymorphic configuration for a specified base type.
Provides JSON serialization-related metadata about a property or field.
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.
Describes the kind of contract metadata a <see cref="T:System.Text.Json.Serialization.Metadata.JsonTypeInfo" /> specifies.
Contains utilities and combinators acting on <see cref="T:System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver" /> .