Permalink
Browse files

Merge pull request #57 from apiaryio/master

joinPath fix
  • Loading branch information...
2 parents 1c43d5e + 800e054 commit 4f4984af5f97f9b9797e124b2af12c90a4bf77e0 @Baggz committed Jun 19, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/engines/json/joinPath.js
@@ -12,9 +12,9 @@ Validation.prototype.joinPath = function(path, property) {
// Converts the ‘property’ to a string
property = property + '';
- if (property.match(/^[a-zA-Z][a-zA-Z0-9]*$/)) {
+ if (property.match(/^[a-zA-Z_][a-zA-Z0-9_]*$/)) {
return (path) ? (path + '.' + property) : property;
- } else if (property.match(/\d+/)) {
+ } else if (property.match(/^\d+$/)) {
return path + '[' + property + ']';
} else {
return path + '["' + property + '"]';

0 comments on commit 4f4984a

Please sign in to comment.