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

Fixed the TypeScript type definition for Options' "format" #1163

Merged
merged 1 commit into from
Feb 12, 2020

Conversation

MattiAstedrone
Copy link
Contributor

What issue does this pull request resolve?
According to documentation "false" is valid input for ajvOptions.format. However typescript definition only lists the type string for it, which causes an error:
"Type 'false' is not assignable to type 'string'.ts(2322)
ajv.d.ts(172, 5): The expected type comes from property 'format' which is declared here on type 'Partial'"

Existing documentation for avjOptions.format:
"format: formats validation mode. Option values:
"fast" (default) - simplified and fast validation (see Formats for details of which formats are available and affected by this option).
"full" - more restrictive and slow validation. E.g., 25:00:00 and 2015/14/33 will be invalid time and date in 'full' mode but it will be valid in 'fast' mode.
false - ignore all format keywords."

What changes did you make?
Add the false as allowed type

Is there anything that requires more attention while reviewing?
No

@epoberezkin epoberezkin merged commit 2320dc5 into ajv-validator:master Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants