@@ -790,6 +790,19 @@ const cubeSchema = inherit(baseSchema, {
790790 'object.xor' : 'You must use either sql or sqlTable within a model, but not both'
791791} ) ;
792792
793+ const folderSchema = Joi . object ( ) . keys ( {
794+ name : Joi . string ( ) . required ( ) ,
795+ includes : Joi . alternatives ( [
796+ Joi . string ( ) . valid ( '*' ) ,
797+ Joi . array ( ) . items (
798+ Joi . alternatives ( [
799+ Joi . string ( ) . required ( ) ,
800+ Joi . link ( '#folderSchema' ) , // Can contain nested folders
801+ ] ) ,
802+ ) ,
803+ ] ) . required ( ) ,
804+ } ) . id ( 'folderSchema' ) ;
805+
793806const viewSchema = inherit ( baseSchema , {
794807 isView : Joi . boolean ( ) . strict ( ) ,
795808 cubes : Joi . array ( ) . items (
@@ -817,13 +830,7 @@ const viewSchema = inherit(baseSchema, {
817830 'object.oxor' : 'Using split together with prefix is not supported'
818831 } )
819832 ) ,
820- folders : Joi . array ( ) . items ( Joi . object ( ) . keys ( {
821- name : Joi . string ( ) . required ( ) ,
822- includes : Joi . alternatives ( [
823- Joi . string ( ) . valid ( '*' ) ,
824- Joi . array ( ) . items ( Joi . string ( ) . required ( ) )
825- ] ) . required ( ) ,
826- } ) ) ,
833+ folders : Joi . array ( ) . items ( folderSchema ) ,
827834} ) ;
828835
829836function formatErrorMessageFromDetails ( explain , d ) {
0 commit comments