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

Wrong error message #3

Open
jrm0695 opened this issue Dec 4, 2021 · 0 comments
Open

Wrong error message #3

jrm0695 opened this issue Dec 4, 2021 · 0 comments
Assignees
Labels
investigating Under inverstigation

Comments

@jrm0695
Copy link

jrm0695 commented Dec 4, 2021

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)

@moshegottlieb moshegottlieb self-assigned this Dec 7, 2021
@moshegottlieb moshegottlieb added the investigating Under inverstigation label Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating Under inverstigation
Projects
None yet
Development

No branches or pull requests

2 participants