Skip to content

IDictionary Normalize value #9

@RobLinux

Description

@RobLinux
if (value is IDictionary dict)
{
    var jsonObject = new JsonObject();
    foreach (DictionaryEntry entry in dict)
    {
        var key = entry.Key?.ToString() ?? string.Empty;
        jsonObject[key] = NormalizeValue(entry.Value);
    }
    return jsonObject;
}

will never be called since

if (value is IEnumerable enumerable && value is not string)
{
    var jsonArray = new JsonArray();
    foreach (var item in enumerable)
    {
        jsonArray.Add(NormalizeValue(item));
    }
    return jsonArray;
}

is always true

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions