Skip to content

Impossible to disable language.key in options #1334

Closed
@bezenson

Description

Context

  • node version: 6.11.4
  • joi version: 13.0.0
  • environment: browser
  • used with: react, redux-form

What are you trying to achieve or the steps to reproduce ?

Hi. I found that via options impossible to disable language.key. I've tried to put false and empty string. As a workaround string with one space works. But seems like it is not ok and looks weird.

const schema = Joi.object().keys({
  domain: Joi.string()
    .alphanum()
    .required()
    .options({
      language: {
        // key: false, - not working
        // key: '', - not working
        key: ' ', // works
        string: { alphanum: 'check the spelling of your {{label}} domain and try again' },
      },
    }),
});

What did you expect ?

Ability to disable language.key with false or something like that.

Metadata

Assignees

No one assigned

    Labels

    bugBug or defect

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions