Types and schema constraints
hclapi features a strongly typed schema and configuration system. Types are verified at boot time during manifest parsing and enforced at request ingress before pipeline execution.
Schema data types
Used inside schema and request field definitions (field "<name>" { type = <type> }):
Examples
Scalar configuration types
hclapi provides specialized scalar types that parse human-readable strings into typed units at startup and fail fast on invalid syntax.
Duration
Backed by Go's time.Duration.
Units can be combined (e.g. "1h30m", "2m45s").
Usage in manifests:
ByteSize
Backed by a 64-bit integer representing byte quantities. Both decimal (1,000-based) and binary (1,024-based) units are accepted case-insensitively.
Fractional quantities and raw integer bytes are both supported:
Compile-time diagnostics
Invalid type or scalar formats fail fast during hclapi serve boot: