138 [
Obsolete(
"JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.", DiagnosticId =
"SYSLIB0020", UrlFormat =
"https://aka.ms/dotnet-warnings/{0}")]
357 [
RequiresUnreferencedCode(
"JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
434 [
RequiresUnreferencedCode(
"Getting a converter for a type may require reflection which depends on unreferenced code.")]
569 if (attributes.Length == 0)
573 if (attributes.Length == 1)
648 [
RequiresUnreferencedCode(
"JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
654 [
RequiresUnreferencedCode(
"JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
static ? object CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors|DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type, BindingFlags bindingAttr, Binder? binder, object?[]? args, CultureInfo? culture)
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
bool ContainsKey(TKey key)
bool TryAdd(TKey key, TValue value)
void Add(TKey key, TValue value)
static string DefaultIgnoreConditionAlreadySpecified
static string DefaultIgnoreConditionInvalid
static string SerializationInvalidBufferSize
static string JsonSerializerDoesNotSupportComments
static JsonNamingPolicy CamelCase
static ConditionalWeakTable< JsonSerializerOptions, object > All
static Dictionary< Type, JsonConverter > GetDefaultSimpleConverters()
JsonSerializerContext _context
bool _haveTypesBeenCreated
static Attribute GetAttributeThatCanHaveMultiple(Type attributeType, Type classType, MemberInfo memberInfo, object[] attributes)
JsonNamingPolicy? DictionaryKeyPolicy
bool _ignoreReadOnlyProperties
static void TrackOptionsInstance(JsonSerializerOptions options)
JavaScriptEncoder _encoder
JavaScriptEncoder? Encoder
static Dictionary< Type, JsonConverter > s_defaultSimpleConverters
JsonConverter GetConverter(Type typeToConvert)
static readonly JsonSerializerOptions s_defaultOptions
ReferenceHandler _referenceHandler
void InitializeForReflectionSerializer()
JsonSerializerOptions(JsonSerializerDefaults defaults)
JsonNamingPolicy? PropertyNamingPolicy
JsonConverter DetermineConverter(Type parentClassType, Type runtimePropertyType, MemberInfo memberInfo)
bool _ignoreReadonlyFields
ReferenceHandlingStrategy ReferenceHandlingStrategy
JsonNumberHandling NumberHandling
static Attribute GetAttributeThatCanHaveMultiple(Type classType, Type attributeType, MemberInfo memberInfo)
bool TypeIsCached(Type type)
bool TryGetClass(Type type, [NotNullWhen(true)] out JsonTypeInfo jsonTypeInfo)
JsonNamingPolicy _jsonPropertyNamingPolicy
JsonIgnoreCondition DefaultIgnoreCondition
JsonCommentHandling ReadCommentHandling
bool IsInitializedForReflectionSerializer
void AddContext< TContext >()
JsonNumberHandling _numberHandling
JsonConverter GetConverterFromAttribute(JsonConverterAttribute converterAttribute, Type typeToConvert, Type classTypeAttributeIsOn, MemberInfo memberInfo)
JsonNamingPolicy _dictionaryKeyPolicy
MemberAccessor _memberAccessorStrategy
JsonUnknownTypeHandling UnknownTypeHandling
JsonCommentHandling _readCommentHandling
readonly ConcurrentDictionary< Type, JsonConverter > _converters
JsonTypeInfo GetClassFromContextOrCreate(Type type)
bool IgnoreReadOnlyProperties
static Attribute GetAttributeThatCanHaveMultiple(Type classType, Type attributeType)
JsonUnknownTypeHandling _unknownTypeHandling
Func< Type, JsonSerializerOptions, JsonTypeInfo > _typeInfoCreationFunc
static JsonConverter[] s_defaultFactoryConverters
void RootBuiltInConverters()
JsonConverter GetConverterInternal(Type typeToConvert)
readonly ConcurrentDictionary< Type, JsonTypeInfo > _classes
MemberAccessor MemberAccessorStrategy
bool IgnoreReadOnlyFields
JsonSerializerOptions(JsonSerializerOptions options)
bool TryGetDefaultSimpleConverter(Type typeToConvert, [NotNullWhen(true)] out JsonConverter converter)
JsonNodeOptions GetNodeOptions()
JsonTypeInfo GetOrAddClass(Type type)
JsonWriterOptions GetWriterOptions()
JsonDocumentOptions GetDocumentOptions()
bool _allowTrailingCommas
JsonTypeInfo GetOrAddClassForRootType(Type type)
bool _propertyNameCaseInsensitive
bool PropertyNameCaseInsensitive
JsonReaderOptions GetReaderOptions()
JsonIgnoreCondition _defaultIgnoreCondition
static bool IsValidNumberHandlingValue(JsonNumberHandling handling)
static JsonConverter CreateValueConverter(Type valueTypeToConvert, JsonConverter valueConverter)
JsonTypeInfo? GetTypeInfo(Type type)
static JsonConverter< Uri > UriConverter
static JsonConverter< byte > ByteConverter
static JsonConverter< DateTimeOffset > DateTimeOffsetConverter
static JsonConverter< long > Int64Converter
static JsonConverter< uint > UInt32Converter
static JsonConverter< DateTime > DateTimeConverter
static JsonConverter< ulong > UInt64Converter
static JsonConverter< double > DoubleConverter
static JsonConverter< object?> ObjectConverter
static JsonConverter< ushort > UInt16Converter
static JsonConverter< byte[]> ByteArrayConverter
static JsonConverter< Guid > GuidConverter
static JsonConverter< char > CharConverter
static JsonConverter< Version > VersionConverter
static JsonConverter< int > Int32Converter
static JsonConverter< short > Int16Converter
static JsonConverter< bool > BooleanConverter
static JsonConverter< sbyte > SByteConverter
static JsonConverter< TimeSpan > TimeSpanConverter
static JsonConverter< float > SingleConverter
static JsonConverter< string > StringConverter
static JsonConverter< decimal > DecimalConverter
JsonConverter ConverterBase
JsonPropertyInfo PropertyInfoForTypeInfo
ReferenceHandlingStrategy HandlingStrategy
static void ThrowInvalidOperationException_SerializerOptionsImmutable(JsonSerializerContext context)
static void ThrowNotSupportedException_BuiltInConvertersNotRooted(Type type)
static void ThrowInvalidOperationException_SerializationConverterNotCompatible(Type converterType, Type type)
static void ThrowInvalidOperationException_SerializationConverterOnAttributeNotCompatible(Type classTypeAttributeIsOn, MemberInfo memberInfo, Type typeToConvert)
static void ThrowInvalidOperationException_SerializationDuplicateAttribute(Type attribute, Type classType, MemberInfo memberInfo)
static ArgumentOutOfRangeException GetArgumentOutOfRangeException_MaxDepthMustBePositive(string parameterName)
static void ThrowInvalidOperationException_JsonSerializerOptionsAlreadyBoundToContext()
static void ThrowInvalidOperationException_SerializationConverterOnAttributeInvalid(Type classType, MemberInfo memberInfo)
static void ThrowNotSupportedException_NoMetadataForType(Type type)
static void ThrowInvalidOperationException_ConverterCanConvertMultipleTypes(Type runtimePropertyType, JsonConverter jsonConverter)
static readonly Type[] EmptyTypes
ReferenceHandlingStrategy
static ? Type GetUnderlyingType(Type nullableType)