Skip to content

Commit

Permalink
test: failing test for #273, incorrect schemaPath in referenced schema
Browse files Browse the repository at this point in the history
  • Loading branch information
epoberezkin committed Nov 7, 2016
1 parent 599f579 commit a9e77e2
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions spec/issues.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,3 +467,30 @@ describe('issue #259, support validating [meta-]schemas against themselves', fun
ajv.addMetaSchema(hyperSchema);
});
});


describe.skip('issue #273, schemaPath in error in referenced schema', function() {
it('should have canonic reference with hash after file name', function() {
test(new Ajv);
test(new Ajv({inlineRefs: false}));

function test(ajv) {
var schema = {
"properties": {
"a": { "$ref": "int" }
}
};

var referencedSchema = {
"id": "int",
"type": "integer"
};

ajv.addSchema(referencedSchema);
var validate = ajv.compile(schema);

validate({ "a": "foo" }) .should.equal(false);
validate.errors[0].schemaPath .should.equal('int#/type');
}
});
});

0 comments on commit a9e77e2

Please sign in to comment.