Skip to content

Commit

Permalink
validate numbers in multipleOf
Browse files Browse the repository at this point in the history
  • Loading branch information
epoberezkin committed Jul 1, 2020
1 parent 332b30d commit 9c009a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/dot/multipleOf.jst
Expand Up @@ -3,6 +3,8 @@
{{# def.setupKeyword }}
{{# def.$data }}

{{# def.numberKeyword }}

var division{{=$lvl}};
if ({{?$isData}}
{{=$schemaValue}} !== undefined && (
Expand Down
7 changes: 7 additions & 0 deletions spec/ajv.spec.js
Expand Up @@ -549,6 +549,13 @@ describe('Ajv', function () {
});
});

it('multipleOf', function() {
passValidationThrowCompile({
$ref: '#/foo',
foo: {maxProperties: 'bar'}
});
});

function passValidationThrowCompile(schema) {
ajv.validateSchema(schema) .should.equal(true);
should.throw(function() {
Expand Down

0 comments on commit 9c009a9

Please sign in to comment.