Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty string is wrongly accepted as a timestamp #1303

Closed
pjpsoares opened this issue Sep 15, 2017 · 2 comments
Closed

empty string is wrongly accepted as a timestamp #1303

pjpsoares opened this issue Sep 15, 2017 · 2 comments
Assignees
Labels
bug Bug or defect
Milestone

Comments

@pjpsoares
Copy link

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

@Marsup Marsup added the bug Bug or defect label Sep 15, 2017
@Marsup Marsup added this to the 11.0.2 milestone Sep 19, 2017
@Marsup Marsup self-assigned this Sep 19, 2017
@Marsup Marsup closed this as completed in 1a8bfcb Sep 19, 2017
@Marsup
Copy link
Collaborator

Marsup commented Sep 19, 2017

Thanks for the report, it's fixed.

@pjpsoares
Copy link
Author

Thank you for such a quick fix and for maintaining this!

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug or defect
Projects
None yet
Development

No branches or pull requests

2 participants