Thanks to visit codestin.com
Credit goes to github.com

Skip to content

JSON Serialization Name Collision with hidden properties #30964

Closed
@douglasg14b

Description

@douglasg14b

Take Two Classes:

public class ClassA
{
    public List<int> SomeList { get; set; }
}

public class ClassB : ClassA
{
    new public IEnumerable<int> SomeList { get; set; }
}

If ClassB is serialized an exception is thrown:

The JSON property name for 'ClassB.SomeList' collides with another property.

This seems like unwanted behavior.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions