Skip to content

empty string is wrongly accepted as a timestamp #1303

@pjpsoares

Description

@pjpsoares

Context

  • node version: v8.4.0
  • joi version: 11.0.1
  • environment (node, browser): node
  • used with (hapi, standalone, ...): standalone
  • any other relevant information:

What are you trying to achieve or the steps to reproduce ?

When you set a field as a timestamp it is accepting an empty string as a valid value.

    Joi.assert('', Joi.date().timestamp().required());

Which result you had ?

No error thrown.

What did you expect ?

Should throw an error as '' is not a valid timestamp

Metadata

Metadata

Assignees

Labels

bugBug or defect

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions