@@ -795,6 +795,19 @@ const cubeSchema = inherit(baseSchema, {
795
795
'object.xor' : 'You must use either sql or sqlTable within a model, but not both'
796
796
} ) ;
797
797
798
+ const folderSchema = Joi . object ( ) . keys ( {
799
+ name : Joi . string ( ) . required ( ) ,
800
+ includes : Joi . alternatives ( [
801
+ Joi . string ( ) . valid ( '*' ) ,
802
+ Joi . array ( ) . items (
803
+ Joi . alternatives ( [
804
+ Joi . string ( ) . required ( ) ,
805
+ Joi . link ( '#folderSchema' ) , // Can contain nested folders
806
+ ] ) ,
807
+ ) ,
808
+ ] ) . required ( ) ,
809
+ } ) . id ( 'folderSchema' ) ;
810
+
798
811
const viewSchema = inherit ( baseSchema , {
799
812
isView : Joi . boolean ( ) . strict ( ) ,
800
813
cubes : Joi . array ( ) . items (
@@ -822,13 +835,7 @@ const viewSchema = inherit(baseSchema, {
822
835
'object.oxor' : 'Using split together with prefix is not supported'
823
836
} )
824
837
) ,
825
- folders : Joi . array ( ) . items ( Joi . object ( ) . keys ( {
826
- name : Joi . string ( ) . required ( ) ,
827
- includes : Joi . alternatives ( [
828
- Joi . string ( ) . valid ( '*' ) ,
829
- Joi . array ( ) . items ( Joi . string ( ) . required ( ) )
830
- ] ) . required ( ) ,
831
- } ) ) ,
838
+ folders : Joi . array ( ) . items ( folderSchema ) ,
832
839
} ) ;
833
840
834
841
function formatErrorMessageFromDetails ( explain , d ) {
0 commit comments