Skip to content

Joi.array() modifies original array #502

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

Closed
gaastonsr opened this issue Nov 30, 2014 · 3 comments
Closed

Joi.array() modifies original array #502

gaastonsr opened this issue Nov 30, 2014 · 3 comments
Assignees
Labels
bug Bug or defect
Milestone

Comments

@gaastonsr
Copy link
Contributor

I'm validating an array of times with

var schedule = [
    '08:00',
    '16:00'
];

var result = Joi.validate({
    schedule: schedule
}, {
    schedule: Joi.array().includes(Joi.date().format('HH:mm')).unique().required()
});

After the validation schedule becomes an array of dates when I expect only result.value.schedule to be an array of casted values.

@Marsup Marsup closed this as completed in f82f421 Nov 30, 2014
@Marsup Marsup added the bug Bug or defect label Nov 30, 2014
@Marsup Marsup self-assigned this Nov 30, 2014
@Marsup Marsup added this to the 5.0.1 milestone Nov 30, 2014
@gaastonsr
Copy link
Contributor Author

Thanks!

Marsup added a commit that referenced this issue Nov 30, 2014
@Marsup
Copy link
Collaborator

Marsup commented Nov 30, 2014

Thanks for reporting it.

@Marsup
Copy link
Collaborator

Marsup commented Nov 30, 2014

Published.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 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