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

property name lost in validation message #39

Open
bubenshchykov opened this issue Apr 10, 2013 · 0 comments
Open

property name lost in validation message #39

bubenshchykov opened this issue Apr 10, 2013 · 0 comments

Comments

@bubenshchykov
Copy link

If I have allowAdditionalProperties: false, I always have validation message with empty property name

{
    "property": "",
    "message": "stringThe property categoryName is not defined in the schema and the schema does not allow additional properties"
}

Something is wrong with a "path" in validate.js line 122, I fixed it by

var actualPath = path ? path + "." + i : i;
errors.push({property:actualPath,message:(typeof value) + " property "  ...

and it looks nice after, and also works for nested properties

{
    "property": "categoryName",
    "message": "string property categoryName is not defined in the schema and the schema does not allow additional properties"
}

Not sure if the fix is correct, but could you pls take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant