Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In version 0.9.0 empty arrays are still handled incorrectly #38

Closed
antonsmetanin opened this issue Jan 26, 2015 · 1 comment
Closed

In version 0.9.0 empty arrays are still handled incorrectly #38

antonsmetanin opened this issue Jan 26, 2015 · 1 comment
Labels
Milestone

Comments

@antonsmetanin
Copy link

@antonsmetanin antonsmetanin commented Jan 26, 2015

class EmptyArrayTest
{
    class Data
    {
        public int[] array;
        public string name;
    }

    class Response
    {
        public JsonData data;
    }

    string testJson = @"
    {
        ""data"":
        {
            ""array"": [],
            ""name"": ""testName""
        }
    }";

    public void Run()
    {
        var response = JsonMapper.ToObject<Response>(testJson);
        JsonMapper.ToObject<Data>(response.data.ToJson());
    }
}

As of latest commit (e16713d) this code generates a JsonException: Can't assign value 'name' (type System.String) to type System.Int32[]

@devlead
Copy link
Member

@devlead devlead commented Feb 14, 2020

Fixed by #115

@devlead devlead closed this as completed Feb 14, 2020
@devlead devlead added this to the 0.16.0 milestone Feb 14, 2020
@devlead devlead added the bug label Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants