Skip to content

Commit

Permalink
Merge pull request #863 from epoberezkin/fix-861-property-names
Browse files Browse the repository at this point in the history
Fix #861: propertyNames with empty schema
  • Loading branch information
epoberezkin committed Sep 23, 2018
2 parents 12e1655 + c1f929b commit 5c41a84
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/dot/propertyNames.jst
Expand Up @@ -3,6 +3,8 @@
{{# def.setupKeyword }}
{{# def.setupNextLevel }}

var {{=$errs}} = errors;

{{? {{# def.nonEmptySchema:$schema }} }}
{{
$it.schema = $schema;
Expand All @@ -22,8 +24,6 @@
, $currentBaseId = it.baseId;
}}

var {{=$errs}} = errors;

{{? $ownProperties }}
var {{=$dataProperties}} = undefined;
{{?}}
Expand Down
23 changes: 23 additions & 0 deletions spec/tests/issues/861_empty_propertynames.json
@@ -0,0 +1,23 @@
[
{
"description": "propertyNames with empty schema (#861)",
"schema": {
"properties": {
"foo": {"type": "string"}
},
"propertyNames": {}
},
"tests": [
{
"description": "valid",
"data": {"foo": "bar"},
"valid": true
},
{
"description": "invalid",
"data": {"foo": 1},
"valid": false
}
]
}
]

0 comments on commit 5c41a84

Please sign in to comment.