Skip to content

number.multiple() throws exception for non-integer and ref values #916

@santanu-biswas

Description

@santanu-biswas

number.multiple() accepts only integers (throws exception). It neither accepts floats/decimals nor does it accept refs.

So, it accepts number.multiple(2), but does not accept number.multiple(2.5).
It also does not accept number.multiple(Joi.ref('anotherKey')).

It seems the code here explicitly throws a exception for anything non-integer.

Is this by design? Or a bug?

If it is by design, I am wondering why is it so, and also in such case should it not send the error gracefully for validate call instead of throwing exception!

Metadata

Metadata

Assignees

Labels

featureNew functionality or improvement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions