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

Using joi.allow() generates an enum when it shouldn't #11

Open
simonrenoult opened this issue May 30, 2016 · 0 comments
Open

Using joi.allow() generates an enum when it shouldn't #11

simonrenoult opened this issue May 30, 2016 · 0 comments

Comments

@simonrenoult
Copy link

Given the joi object

Joi.string().example('MR').description('civility').allow('')

It mistakingly returns

"civility": {
  "description": "civility",
  "enum": [ "" ], 
  "type": "string"
}

While it should return something like

"civility": {
  "description": "civility",
  "type": "string"
}

Indeed, as stated in the joi.allow() API: this whitelist of allowed values is in addition to any other permitted values

kenspirit pushed a commit to kenspirit/joi-route-to-swagger that referenced this issue Oct 7, 2019
…schema#11

2. Remove operationId as it's optional and not easy to auto-generate a unique one if dev is not careful enough

3. Fix object field in array not processed issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant