Skip to content

Commit

Permalink
Merge pull request #1 from shalevshalit/fix-visit
Browse files Browse the repository at this point in the history
default schemaPath in visit anyOf or oneOf
  • Loading branch information
shalevshalit committed Dec 18, 2017
2 parents 030467a + b5f46cd commit 8621356
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ var compile = function(schema, cache, root, reporter, opts) {
validate('if (errors !== %s) {', prev)
('errors = %s', prev)
}
visit(name, sch, false, false)
visit(name, sch, false, false, schemaPath)
})
node.anyOf.forEach(function(sch, i) {
if (i) validate('}')
Expand All @@ -432,7 +432,7 @@ var compile = function(schema, cache, root, reporter, opts) {
('var %s = 0', passes)

node.oneOf.forEach(function(sch, i) {
visit(name, sch, false, false)
visit(name, sch, false, false, schemaPath)
validate('if (%s === errors) {', prev)
('%s++', passes)
('} else {')
Expand Down

0 comments on commit 8621356

Please sign in to comment.