Skip to content

Not allowing empty string #41

@Gilbert1391

Description

@Gilbert1391

It seems like joi browser does not allow to have empty string. This is my schema:

schema = {
    _id: Joi.string(),
    heading: Joi.string()
      .min(5)
      .max(50)
      .label("Heading")
      .required(),
    subHeading: Joi.string().max(50)
  };

If I leave the subHeading field empty (because it is not a required field) I get an error: ""subHeading" is not allowed to be empty"

Is there anyways to allow empty string in the validation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions