-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
Missing Types for Pattern, MaxLength, MinLength #1594
Labels
Comments
joshuamil
added
bug
Something isn't working
openapi-ts
Relevant to the openapi-typescript library
labels
Mar 19, 2024
I have a couple questions:
|
drwpow
added
question
Further information is requested
and removed
bug
Something isn't working
labels
Mar 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Missing Type Definitions for Pattern, MaxLength, MinLength
When trying to validate an OpenAPI 3 specification that is using Patterns, MaxLength, and MinLength for string and other data types, I get type errors when trying to use the aforementioned properties. I'm using 42Crunch for security audit and validation of generated API specifications, and it complains about these being missing. In the short-term, I've used
x-pattern
and the like, and then simply replace the text before writing the file programmatically. Obviously, that's not ideal, and is only a workaround in one specific use-case. If you're trying to validate a specification that has these supported properties, it will fail.openapi-typescript
^2.0.0
21.5.0
macOS Sonoma (14.4)
Reproduction
You can reproduce this by defining an API request, response, or schema and using the following property:
Expected result
Should not get type errors when using supported properties maxLength, minLength, and pattern.
Checklist
npx @redocly/cli@latest lint
)The text was updated successfully, but these errors were encountered: