rules
rules: object[] = [{name: 'items',params: {items: Joi.array().items(Joi.object()).required(),},validate(this: Joi.ExtensionBoundSchema, params: OneOfSchemaParams,value: any,_state: Joi.State, options: Joi.ValidationOptions): any {const index: number[] = [];params.items.forEach((item, i) => {const ret = Joi.validate(value, item, options);if (ret.error) {return;}index.push(i);});if (index.length === 1) {return value;}return this.createError('oneOf.items', {index: JSON.stringify(index),}, {key: JSON.stringify(value),path: '',}, options);}}]