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

Use the alternate object index path syntax if the key contains dots #539

Merged
merged 1 commit into from
May 24, 2019

Conversation

espenhw
Copy link
Contributor

@espenhw espenhw commented May 24, 2019

This fixes #536 by switching to the foo.bar["baz"] syntax if the key contains a dot.

Alternatively, that syntax could be used unconditionally; I chose not to so as to keep the path pretty when possible.

There are, of course, other characters that would break the path syntax, e.g. square brackets and quotes. The current approach would work for anything but double quotes; I'm not familiar enough with lodash's path syntax to come up with something that would always work.

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

Successfully merging this pull request may close these issues.

Wrong path in ValidationError when validating an object with dotted keys
2 participants