Show / Hide Table of Contents

Class JsonSerializerOptions

Represents a set of behavior options for the JsonSerializer object.

Inheritance
System.Object
JsonSerializerOptions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Manatee.Json.Serialization
Assembly: Manatee.Json.dll
Syntax
public class JsonSerializerOptions

Constructors

| Improve this Doc View Source

JsonSerializerOptions()

Creates a new instance of JsonSerializerOptions with default options.

Declaration
public JsonSerializerOptions()
| Improve this Doc View Source

JsonSerializerOptions(JsonSerializerOptions)

Creates a new instance of JsonSerializerOptions by copying an existing JsonSerializerOptions instance.

Declaration
public JsonSerializerOptions(JsonSerializerOptions options)
Parameters
Type Name Description
JsonSerializerOptions options

The JsonSerializerOptions instance to copy.

Fields

| Improve this Doc View Source

Default

Default options used by the serializer.

Declaration
public static readonly JsonSerializerOptions Default
Field Value
Type Description
JsonSerializerOptions

Properties

| Improve this Doc View Source

AutoSerializeFields

Gets and sets whether public fields should be serialized during autoserialization.

Declaration
public bool AutoSerializeFields { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

CaseSensitiveDeserialization

Gets and sets whether the serializer considers case for properties while deserializing.

Declaration
public bool CaseSensitiveDeserialization { get; set; }
Property Value
Type Description
System.Boolean
Remarks

This only affects automatic serialization.

| Improve this Doc View Source

CustomDateTimeSerializationFormat

Gets and sets a custom serialization format for System.DateTime.

Declaration
public string? CustomDateTimeSerializationFormat { get; set; }
Property Value
Type Description
System.Nullable<System.String>
| Improve this Doc View Source

DateTimeSerializationFormat

Gets and sets the format for System.DateTime serialization using the default serializer methods.

Declaration
public DateTimeSerializationFormat DateTimeSerializationFormat { get; set; }
Property Value
Type Description
DateTimeSerializationFormat
Remarks

If a custom serializer for DateTime has been registered, this property will have no effect.

| Improve this Doc View Source

DeserializationNameTransform

Gets and sets a transformation function for property names during deserialization. Default is no transformation.

Declaration
public Func<string, string> DeserializationNameTransform { get; set; }
Property Value
Type Description
System.Func<System.String, System.String>
| Improve this Doc View Source

EncodeDefaultValues

Gets and sets whether the serializer encodes default values for properties.

Declaration
public bool EncodeDefaultValues { get; set; }
Property Value
Type Description
System.Boolean
Remarks

Setting to 'true' may significantly increase the size of the JSON structure.

| Improve this Doc View Source

EnumSerializationFormat

Gets and sets the format for enumeration serialization using the default serializer methods.

Declaration
public EnumSerializationFormat EnumSerializationFormat { get; set; }
Property Value
Type Description
EnumSerializationFormat
| Improve this Doc View Source

FlagsEnumSeparator

Gets and sets a separator to be used when serializing enumerations marked with the System.FlagsAttribute.

Declaration
public string FlagsEnumSeparator { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

InvalidPropertyKeyBehavior

Gets and sets the behavior of the deserializer when a JSON structure is passed which contains invalid property keys.

Declaration
public InvalidPropertyKeyBehavior InvalidPropertyKeyBehavior { get; set; }
Property Value
Type Description
InvalidPropertyKeyBehavior
| Improve this Doc View Source

OnlyExplicitProperties

Gets and sets whether the serializer will serialize only the properties defined by the type given as the generic parameter.

Declaration
public bool OnlyExplicitProperties { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

PropertySelectionStrategy

Gets and sets which properties are automatically included while serializing.

Declaration
public PropertySelectionStrategy PropertySelectionStrategy { get; set; }
Property Value
Type Description
PropertySelectionStrategy
| Improve this Doc View Source

Resolver

Gets and sets an IResolver implementation for instantiating objects while deserializing.

Declaration
public IResolver Resolver { get; set; }
Property Value
Type Description
IResolver
| Improve this Doc View Source

SerializationNameTransform

Gets and sets a transformation function for property names during serialization. Default is no transformation.

Declaration
public Func<string, string> SerializationNameTransform { get; set; }
Property Value
Type Description
System.Func<System.String, System.String>
| Improve this Doc View Source

TypeNameSerializationBehavior

Gets and sets whether the serializer always includes the type name while serializing.

Declaration
public TypeNameSerializationBehavior TypeNameSerializationBehavior { get; set; }
Property Value
Type Description
TypeNameSerializationBehavior
Remarks

This only affects automatic serialization.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX