Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public static ulong GetKey(ReadOnlySpan<byte> propertyName)
public static Type GetElementType(Type propertyType, Type parentType, MemberInfo memberInfo, JsonSerializerOptions options)
{
// We want to handle as the implemented collection type, if applicable.
Type implementedType = GetImplementedCollectionType(parentType, propertyType, null, out _, options);
Type implementedType = GetImplementedCollectionType(parentType, propertyType, propertyInfo: null, out _, options);

if (!typeof(IEnumerable).IsAssignableFrom(implementedType))
{
Expand Down Expand Up @@ -484,7 +484,7 @@ public static ClassType GetClassType(Type type, JsonSerializerOptions options)
Debug.Assert(type != null);

// We want to handle as the implemented collection type, if applicable.
Type implementedType = GetImplementedCollectionType(typeof(object), type, null, out _, options);
Type implementedType = GetImplementedCollectionType(typeof(object), type, propertyInfo: null, out _, options);

if (implementedType.IsGenericType && implementedType.GetGenericTypeDefinition() == typeof(Nullable<>))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,14 @@ internal JsonPropertyInfo GetJsonPropertyInfoFromClassInfo(Type objectType, Json
{
if (!_objectJsonProperties.TryGetValue(objectType, out JsonPropertyInfo propertyInfo))
{
propertyInfo = JsonClassInfo.CreateProperty(objectType, objectType, objectType, null, typeof(object), null, options);
propertyInfo = JsonClassInfo.CreateProperty(
objectType,
objectType,
objectType,
propertyInfo: null,
typeof(object),
converter: null,
options);
_objectJsonProperties[objectType] = propertyInfo;
}

Expand Down