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.

class System.​Text.​Json.​Serialization.​Metadata.​JsonTypeInfo

Assembly: System.Text.Json

Inheritance: object → JsonTypeInfo

Provides JSON serialization-related metadata about a type.

Properties

public JsonConverter
Converter
Gets the <see cref="T:System.Text.Json.Serialization.JsonConverter" /> associated with the current type.
public Func<​object>
CreateObject
Gets or sets a parameterless factory to be used on deserialization.
ConstructorAttributeProvider
Gets or sets an attribute provider corresponding to the deserialization constructor.
public Type
ElementType
Gets the element type corresponding to an enumerable, dictionary or optional type.
public bool
IsReadOnly
Gets a value that indicates whether the current instance has been locked for modification.
public Type
KeyType
Gets the key type corresponding to a dictionary type.
Kind
Gets a value that describes the kind of contract metadata that the current instance specifies.
NumberHandling
Gets or sets the type-level <see cref="P:System.Text.Json.JsonSerializerOptions.NumberHandling" /> override.
public Action<​object>
OnDeserialized
Gets or sets a callback to be invoked after deserialization occurs.
public Action<​object>
OnDeserializing
Gets or sets a callback to be invoked before deserialization occurs.
public Action<​object>
OnSerialized
Gets or sets a callback to be invoked after serialization occurs.
public Action<​object>
OnSerializing
Gets or sets a callback to be invoked before serialization occurs.
Options
Gets the <see cref="T:System.Text.Json.JsonSerializerOptions" /> value associated with the current <see cref="T:System.Text.Json.Serialization.Metadata.JsonTypeInfo" /> instance.
OriginatingResolver
Gets or sets the <see cref="T:System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver" /> from which this metadata instance originated.
PolymorphismOptions
Gets or sets a configuration object specifying polymorphism metadata.
PreferredPropertyObjectCreationHandling
Gets or sets the preferred <see cref="T:System.Text.Json.Serialization.JsonObjectCreationHandling" /> value for properties contained in the type.
Gets the list of <see cref="T:System.Text.Json.Serialization.Metadata.JsonPropertyInfo" /> metadata corresponding to the current type.
public Type
Type
Gets the <see cref="P:System.Text.Json.Serialization.Metadata.JsonTypeInfo.Type" /> for which the JSON serialization contract is being defined.
UnmappedMemberHandling
Gets or sets the type-level <see cref="T:System.Text.Json.Serialization.JsonUnmappedMemberHandling" /> override.

Methods

CreateJsonPropertyInfo​(Type propertyType, string name)
Creates a blank <see cref="T:System.Text.Json.Serialization.Metadata.JsonPropertyInfo" /> instance for the current <see cref="T:System.Text.Json.Serialization.Metadata.JsonTypeInfo" /> .
Returns A blank <see cref="T:System.Text.Json.Serialization.Metadata.JsonPropertyInfo" /> instance.
propertyType The declared type for the property.
name The property name used in JSON serialization and deserialization.
public static JsonTypeInfo
CreateJsonTypeInfo​(Type type, JsonSerializerOptions options)
Creates a blank <see cref="T:System.Text.Json.Serialization.Metadata.JsonTypeInfo" /> instance.
Returns A blank <see cref="T:System.Text.Json.Serialization.Metadata.JsonTypeInfo" /> instance.
type The type for which contract metadata is specified.
options The <see cref="T:System.Text.Json.JsonSerializerOptions" /> instance the metadata is associated with.
public static JsonTypeInfo<​T>
CreateJsonTypeInfo​(JsonSerializerOptions options)
Creates a blank <see cref="T:System.Text.Json.Serialization.Metadata.JsonTypeInfo`1" /> instance.
Returns A blank <see cref="T:System.Text.Json.Serialization.Metadata.JsonTypeInfo`1" /> instance.
options The <see cref="T:System.Text.Json.JsonSerializerOptions" /> instance the metadata is associated with.
public void
MakeReadOnly​()
Locks the current instance for further modification.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object