ansman / validate.js

A declarative validation library written javascript
https://validatejs.org
MIT License
2.63k stars 336 forks source link

False positives when attribute name has dots #197

Closed serhiinkh closed 7 years ago

serhiinkh commented 7 years ago

Hello seem like this project is abandoned by author but anyway here is issue that i found.

validate({"test.test":"123"}, {"test.test": {
    presence: {
        message:"Empty"
    }
}})
ansman commented 7 years ago

You need to escape the period: http://validatejs.org/#validate-nested

validate({"test.test":"123"}, {"test\\.test": {
    presence: {
        message:"Empty"
    }
}})