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

Validate ISO Duration string #1612

Closed
austin-payne opened this issue Oct 11, 2018 · 0 comments
Closed

Validate ISO Duration string #1612

austin-payne opened this issue Oct 11, 2018 · 0 comments
Assignees
Labels
feature New functionality or improvement
Milestone

Comments

@austin-payne
Copy link

Describe the problem you are trying to fix (provide as much context as possible)

If a payload should contain a duration, it may be desirable to require a ISO duration string rather than a number which assumes the caller knows whether it should be in minutes, hours, etc.

ISO 8601 standard for Durations as defined here could be validatable with joi. moment.js has support for duration strings, so going from a validated duration string to a moment.Duration object to use in whatever way would be seamless.

Which API (or modification of the current API) do you suggest to solve that problem ?

Maybe add a .duration() to DateSchema, or add a DurationSchema, not sure

Are you ready to work on a pull request if your suggestion is accepted ?

Possibly

@Marsup Marsup added the request label Nov 11, 2018
@hueniverse hueniverse added feature New functionality or improvement and removed request labels May 29, 2019
@hueniverse hueniverse added this to the 16.0.0 milestone May 29, 2019
@hueniverse hueniverse self-assigned this May 29, 2019
@hueniverse hueniverse added the v16 label Aug 10, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality or improvement
Projects
None yet
Development

No branches or pull requests

3 participants