Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion packages/cubejs-schema-compiler/src/compiler/CubeValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ const timeShiftItemRequired = Joi.object({
});

const timeShiftItemOptional = Joi.object({
timeDimension: Joi.func(), // не required
timeDimension: Joi.func(), // not required
interval: regexTimeInterval.required(),
type: Joi.string().valid('next', 'prior').required(),
});
Expand Down Expand Up @@ -661,6 +661,17 @@ const DimensionsSchema = Joi.object().pattern(identifierRegex, Joi.alternatives(
type: Joi.any().valid('number').required(),
sql: Joi.func().required(),
addGroupBy: Joi.func(),
}),
// TODO should be valid only for calendar cubes, but this requires significant refactoring
// of all schemas. Left for the future when we'll switch to zod.
inherit(BaseDimensionWithoutSubQuery, {
type: Joi.any().valid('time').required(),
sql: Joi.func().required(),
timeShift: Joi.array().items(Joi.object({
interval: regexTimeInterval.required(),
type: Joi.string().valid('next', 'prior').required(),
sql: Joi.func().required(),
})),
})
));

Expand Down
Loading
Loading