express-openapi-validator
express-openapi-validator copied to clipboard
Setting nullable breaks minLength validation
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.