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

No conversion is done inside Joi.array().items #585

Closed
AdriVanHoudt opened this issue Mar 5, 2015 · 0 comments
Closed

No conversion is done inside Joi.array().items #585

AdriVanHoudt opened this issue Mar 5, 2015 · 0 comments
Labels
bug Bug or defect
Milestone

Comments

@AdriVanHoudt
Copy link
Contributor

Test case:

var email = [{ email:' adri@Gmail.com ' }];

var schema = Joi.array().items(
    Joi.object().keys({
        email: Joi.string().email().trim().required()
    }).required()
).required();

Joi.validate(email, schema, function (err, value) {
    console.log(err);
    console.log(value);
});

Output: { email: ' adri@Gmail.com ' }
Expected output: { email: 'adri@Gmail.com' }

This also happens with lowercase() and uppercase()
Forcing convert: true doesn't help

@Marsup Marsup added the bug Bug or defect label Mar 5, 2015
@Marsup Marsup added this to the 6.0.1 milestone Mar 5, 2015
@Marsup Marsup self-assigned this Mar 5, 2015
@Marsup Marsup closed this as completed in 919dfb8 Mar 5, 2015
@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