hapijs / joi

The most powerful data validation library for JS
Other
20.74k stars 1.51k forks source link

Typo in Joi Validation with Swagger... #3038

Open big-finn opened 1 month ago

big-finn commented 1 month ago

Runtime

nodejs

Runtime version

17.13.1

Module version

17.13.1

Last module version without issue

No response

Used with

hapi

Any other relevant information

Used with latest Hapi and Joi

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

If you set this validation;

  validate: {
    payload: Joi.object({
      newPassword: Joi.string().min(8).max(64).required(),
    }),
  },

  In the swagger UI the default test is "newPassword": "stringst" instead of string, its just a typo.

What was the result you got?

"newPassword": "stringst"

What result did you expect?

"newPassword": "string"

Marsup commented 1 month ago

Sorry but I have no idea what you're referring to, this doesn't look like a joi issue as you're mentioning swagger.