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 visit time window does not have a
minStartTimethat is less than or equal to themaxStartTimeormaxEndTime. -
A floating break does not have a
minStartTimeplusdurationthat is less than or equal to themaxEndTime. -
A fixed break does not have a
startTimeless than or equal to theendTime. -
A break starts before its shift
minStartTime. -
A vehicle shift must have either a
minStartTimeor aminFirstVisitArrivalTime. -
A visit dependency must reference an existing preceding visit id.
-
A visit group must have at least two visits.
-
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:
-
Technician ratings are defined for vehicles, but the model config does not enable the technician ratings constraint.
-
There is a deprecated priority in a visit.
-
The list of vehicles is empty.
-
The list of vehicle shifts is empty.
-
A vehicle shift should have a
maxSoftTravelTimethat is less or equal tomaxTravelTime. -
The time window is too small for the visit’s specified duration.
-
All time windows of a visit start after the latestSlaEndTime.
-
A visit’s 'preferredVehicles' references a non-existing vehicle.
-
A visit’s 'prohibitedVehicles' references a non-existing vehicle.
-
A visit requires a tag that is not declared by any vehicle shift. This visit cannot be assigned to any vehicle shift.
-
A visit requires a skill that is not declared by any vehicle shift. This visit cannot be assigned to any vehicle 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.
-
Learn more about field service routing from our YouTube playlist.