Validation
Whenever you submit a dataset to Timefold through the API the input is validated and if there are issues, you will see the following depending on the type of validation issue:
-
Invalid JSON: The submitted JSON file is validated to make sure the JSON is valid according to the OpenAPI specification and can be processed by Timefold.
A POST call with an invalid JSON document will return a status 400 Bad Request
.
The response will include a message specifying the input JSON has an invalid format and details that will help you locate the issue with the JSON.
Solution: Fix the invalid JSON and resubmit the dataset.
-
Error: The JSON is valid according to the OpenAPI specification but the submitted dataset includes (or does not include) elements that need to be rectified before the dataset can be solved, including:
-
Referencing an undeclared tag type or tag.
-
A shift group matches multiple shift group rules with assignment mode defined. Only one rule with assignment mode per shift group is allowed.
-
A shift belongs to multiple shift groups. A shift can only belong to one shift group.
-
Start times must be earlier than end times.
-
A shift’s logged time must not be negative or longer than the duration of the shift.
-
An employee can only have 1 contract with travel configurations.
-
An employee must have a location if they are assigned a contract with a travel configuration.
-
An employee can only have 1 contract with a custom FTE configuration.
-
Either the
maxEmployeeToShiftTravelDistanceInMeters
or theminMinutesBetweenShiftsInDifferentLocations
must be set on thetravelConfiguration
of a contract. -
A shift matches multiple rotation groups. A shift can only belong to one rotation group.
-
A contract defines non-consecutive weekend days in weekendConfiguration. Weekend days must be consecutive.
-
An employee defines a pairing with themself.
-
Minimums must be less than their associated maximums, for instance,
minDemand
andmaxDemand
,shiftsWorkedMin
andshiftsWorkedMax
. -
Rules use an invalid period that is not a built-in period or a custom period.
-
Solution: Review the error message and update the dataset.
-
Warning: The JSON is valid according to the OpenAPI specification but the dataset:
-
Uses a deprecated feature.
-
Is missing some element that is necessary to successfully assign a shift, including:
-
The planning window cannot be determined because there are no shifts.
-
The list of shifts is empty.
-
The list of employees is empty.
-
An employee defines both a required and prohibited pairing with another employee.
-
A multi-day shift pattern rule starts with OFF but the planning window was not provided.
-
A rolling window rule on a contract has a
daysWorkedLimit
with adaysWorkedMax
greater than the rolling window size in full days. -
A rolling window rule on a contract has a
minutesWorkedLimit
with aminutesWorkedMax
greater than the rolling window size in minutes. -
A shift requires or prefers a skill that is not defined by any employee.
-
-
Solution: The dataset will be processed, but we recommend looking at the warnings and updating the dataset.