Check a calculation for syntax and language errors. The response indicates whether the calculation is valid and describes the first problem found. See About Custom Calculations for calculation syntax and examples.
Validation checks the calculation itself. It does not check whether the selected model and initialization contain a variable, pressure level, or forecast hour. Those checks happen when the calculation runs.
| Name | Type | Description |
|---|---|---|
| calculation Required | string | Custom calculation expression to validate. See About Custom Calculations for syntax and examples. |
| Field | Type | Description |
|---|---|---|
| valid | boolean | Whether the calculation follows the language rules. |
| errors | array | Validation errors. Empty when valid is true . |
| code | string | Error category, such as INVALID_CALCULATION , INVALID_LEVEL_SELECTION , or INVALID_TIME_WINDOW . |
| message | string | Description of the problem, including its location in the calculation when available. |
A well-formed request returns HTTP 200 whether the calculation is valid or invalid. Use valid to determine the result.