Validation
Whenever you submit a dataset to Timefold through the API or UI the input is validated and if there are issues, you will see the following depending on the type of validation issue:
1. Invalid JSON
The submitted JSON file is validated to make sure the JSON is syntactically valid and 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.
2. Validation errors
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.
The dataset’s state will clearly indicate that it is invalid.
Validation errors include:
-
Resources of different types have the same ID.
-
A job references a non-existing job type ID.
-
A job uses a resource that does not exist.
-
A job has an invalid duration.
-
A job has invalid dependencies.
-
A tag defined by an
inputResourcereferences a non-existing tag ID. -
A tag defined by a resource is available across multiple time spans (Only a single availability time span is supported).
-
An InputResource has overlapping unavailable time spans.
-
An InputResource references a non-existing inputResource type ID.
-
A jobTransition references a non-existing job type ID.
-
A jobTransition references a non-existing inputResource type ID.
Solution: Review the error message and resubmit the dataset.
Next
-
See the full API spec or try the online API.