Skip to content

Wrong error message #3

@jrm0695

Description

@jrm0695

Consider this code :

class Test extends JSONObject {
    @required
    // @ts-ignore
    public prop1: String

    @required
    @array(String)
    // @ts-ignore
    public prop2: Array<String>
}

try {
    let test: Test = new Test({
        "prop1": "hello",
        "prop2": [5, 8]
    })
}
catch(e) {
    console.log("error " + e.toString())
}

I have the following error : Test.prop2 array element requires type 'number', got 'string' instead, while the error should be Test.prop2 array element requires type 'string', got 'string' number (confusing expected and actual array elements type)

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions