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:
-
A driver shift must have either a
minStartTimeor aminFirstStopArrivalTime. -
A driver shift must have a
minStartTimebefore or equal tominFirstStopArrivalTime(when both are set). -
A driver shift itinerary contains a stop that is not found in the route plan.
-
The list of jobs is empty.
-
A job’s
requiredDriversreferences a non-existing driver. -
A stop’s time window does not have
minStartTimeless than themaxEndTime. -
A stop’s dependency must reference an existing preceding stop id.
-
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 visit, including:
-
The list of drivers is empty.
-
The list of driver shifts is empty.
-
A job’s 'preferredDrivers' references a non-existing driver.
-
A time window is too small for a stop.
-
A job requires a skill that is not declared by any driver shift.
-
-
Solution: The dataset will be processed, but we recommend looking at the warnings and updating the dataset.
Next
-
See the full API spec or try the online API.