-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
supportQuestions, discussions, and general supportQuestions, discussions, and general support
Description
Support plan
- is this issue currently blocking your project? (yes):
- is this issue affecting a production system? (no):
Context
- node version: 18
- module version with issue: 17.9.2
- environment (e.g. node, browser, native): node
- used with (e.g. hapi application, another framework, standalone, ...): standalone
- any other relevant information:
What are you trying to achieve or the steps to reproduce?
const hostSchema = Joi.alternatives([Joi.string().ip(), Joi.string().domain().allow('localhost')]).required();What was the result you got?
hostSchema gets a type of Joi.AlternativesSchema<any> instead of specific union of types,

What result did you expect?
It should contain reflect the union type of the alternatives...
Maybe we can use the types from https://github.com/maghis/types-joi/blob/master/index.d.ts which do work
The problem is that SchemaLike is not related to the TSchema, In addition, Typescript doesn't supports rest params of different types, therefore, we probably need to do what is done here
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
supportQuestions, discussions, and general supportQuestions, discussions, and general support