@@ -790,6 +790,19 @@ const cubeSchema = inherit(baseSchema, {
790
790
'object.xor' : 'You must use either sql or sqlTable within a model, but not both'
791
791
} ) ;
792
792
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
+
793
806
const viewSchema = inherit ( baseSchema , {
794
807
isView : Joi . boolean ( ) . strict ( ) ,
795
808
cubes : Joi . array ( ) . items (
@@ -817,13 +830,7 @@ const viewSchema = inherit(baseSchema, {
817
830
'object.oxor' : 'Using split together with prefix is not supported'
818
831
} )
819
832
) ,
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 ) ,
827
834
} ) ;
828
835
829
836
function formatErrorMessageFromDetails ( explain , d ) {
0 commit comments