fix: recursive ref to async sub-schema, closes #612

master
Evgeny Poberezkin 2017-12-02 10:24:27 +00:00
parent 850d904574
commit b8d36fc0b0
3 changed files with 3 additions and 3 deletions

View File

@ -221,7 +221,7 @@ function compile(schema, root, localRefs, baseId) {
function resolvedRef(refVal, code) {
return typeof refVal == 'object' || typeof refVal == 'boolean'
? { code: code, schema: refVal, inline: true }
: { code: code, $async: refVal && refVal.$async };
: { code: code, $async: refVal && !!refVal.$async };
}
function usePattern(regexStr) {

View File

@ -50,7 +50,7 @@
{{?}}
{{??}}
{{
$async = $refVal.$async === true;
$async = $refVal.$async === true || (it.async && $refVal.$async !== false);
$refCode = $refVal.code;
}}
{{?}}

View File

@ -239,7 +239,7 @@ describe('async schemas, formats and keywords', function() {
return recursiveTest(schema);
});
it.skip('should validate recursive ref to async sub-schema, issue #612', function() {
it('should validate recursive ref to async sub-schema, issue #612', function() {
var schema = {
$async: true,
type: 'object',