Skip to content

Add Date -> Joi.DateSchema map to ObjectPropertiesSchema<T> #2698

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

Merged
merged 1 commit into from
Dec 1, 2021

Conversation

jamietre
Copy link
Contributor

@jamietre jamietre commented Nov 9, 2021

Handle mapping of DateSchema validation types to Date when using StrictSchemaValidation<T>

For example:

type MyApi = {
   foo: string;
   bar: Date;
}

const schema = Joi.object<MyApi>({
Joi.object({
    foo: Joi.string(),
   // this is a typescript error in current codebase
    bar: Joi.date(),
}

@hueniverse hueniverse self-assigned this Dec 1, 2021
@hueniverse hueniverse added the types TypeScript type definitions label Dec 1, 2021
@hueniverse hueniverse added this to the 17.5.0 milestone Dec 1, 2021
@hueniverse hueniverse merged commit 4d769b7 into hapijs:master Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types TypeScript type definitions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants