Validate a value against a dtype
POST /Platform/dtypes/validate
Validate a value against a dtype.
dtype uses the Python dtype class name (== the @hilus/ui
registry key): email, phonenumber, color,
scheduling_rule, hql_query, url, integer, ...
Returns {valid, normalized, failures} where normalized is the
value the dtype would actually store (e.g. e164 phone numbers,
normalized hex colors).
Validation never stores the value. A few dtypes check differently:
secretchecks shape only. Asecret-…id or a reference ({"type": "secret", "id": "…"}) is valid and normalized to the reference, without checking that the secret exists. Any other non-empty value is a raw secret: valid, with nonormalized, because its reference only exists once it is written; it is neither stored nor echoed.addressis geocoded (a map lookup, cached) to normalize it.openapitakes the spec itself (JSON or YAML) or anhttp(s)URL, which is fetched like any outside URL; a path is invalid.
A handle of dtype itself (markdown-… for markdown) is
read like any handle: one you cannot see is invalid exactly as one
that does not exist. A handle of another dtype is plain text here.
Body parameters
dtype: optional str. Dtype name, e.g.email,phonenumber,url.value: optional str. The candidate value. Forsecret, the raw value or a reference to a stored one; it is never stored here.
Returns
DtypeValidateResult
valid: bool. Whether the value is valid for the dtype.normalized: optional Any or null. JSON-safe normalized value the dtype would store, when valid.failures: optional List[str]. Why the value is invalid.
Example request
curl -X POST "https://api.hilus.ai/Platform/dtypes/validate" \
-H "Authorization: Bearer $HILUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'