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

Setting nullable breaks minLength validation #912

Open
sepek opened this issue Apr 24, 2024 · 0 comments
Open

Setting nullable breaks minLength validation #912

sepek opened this issue Apr 24, 2024 · 0 comments

Comments

@sepek
Copy link

sepek commented Apr 24, 2024

Describe the bug
When setting nullable and minLength for a string and sending a request which does not fullfil the minLength makes the request hang

To Reproduce
Just try the request again which does not fullfil the minLength

Actual behavior
E.g. curl simply hangs until timeout

Expected behavior
Express should respond that the request doesn't fullfil the requirements.

Examples and context
Having a model including a requestBody for POST containing something like that:

    UserPassword:
      type: string
      minLength: 8
      maxLength: 128
      nullable: true
      default: null
      description: Foo
      example: Bar

will make Express hang if a string is provided in a request which is smaller than minLength.

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