Open dpkshrma opened 6 years ago
Also, I can see that this BaseSchema interface in this file - https://github.com/thiagobustamante/typescript-rest-swagger/blob/master/src/swagger/swagger.ts does contain minLength
specification.
I still don't understand how to declare in my own interfaces for the request body.
@thiagobustamante Please suggest a way to do it.
Okay. I was looking at getSwaggerTypeForPrimitiveType
method in https://github.com/thiagobustamante/typescript-rest-swagger/blob/master/src/swagger/generator.ts
And it seems there is no such option available yet. But, I might hopefully be wrong :|
I have a similar question with pattern
for strings to specify a regex👍
The swagger spec allows for specifying minimum and maximum length of string keys. Reference - https://swagger.io/docs/specification/data-models/data-types/#string
I could not find any documentation on how to describe them in the types for request body.
AFAIK, Typescript does not support length checks out of the box for
string
data type. Is there a specific syntax to achieve this?