-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
I have a model similar to below:
export class Address {
public currentAddress: string;
public permanentAddress: string;
}
The requirement here is that at-least currentAddress
or permanentAddress
should be provided. And @or decorator fits the bill perfectly here, however i'm unable to get it working.
Looking at some of the joi examples, it seems .or
is used on the schema of the object (i.e. Address
class in my example above) rather than on the keys (i.e. currentAddress
, permanentAddress
etc).
Can someone provide an example of how @or decorator be used? I could not find anything in the tests too.
Thanks in advance.
lhaase and phanngl