Skip to content

Fortified IDDocs

Typed expansion

Typed expansion reference and configuration shared across Fortified ID products.

By default, expansion always produces a string. A type directive converts the result to a specific type — necessary when a configuration property requires a non-string value such as a number, boolean, or JSON object.

@<type>:<value>

The value can be a literal or an expression:

@int:99
@boolean:${config.debug}
@json:${data.object}
DirectiveResult
@stringString (default, same as no directive)
@intInteger
@longLarge integer
@floatDecimal number
@doubleDouble-precision decimal
@numberNumber — automatically selects integer or decimal type based on value
@boolBoolean
@booleanBoolean
@jsonJSON object or array
@json-objectJSON object
@json-arrayJSON array

No directive — value is treated as a string, including any ${...} expressions:

${user.name} → "Alice" (string)
@string:${user.name} → "Alice" (same)

Unknown directive — if the directive is not recognised, the entire value is treated as a plain string without error:

@typo:99 → "@typo:99" (string, no error)

Invalid conversion — if the value cannot be converted to the specified type (e.g. @int:hello), an error is raised. For booleans, only true (case-insensitive) is true — all other values are false.

JSON — the value must be valid JSON. An invalid JSON string raises an error. Use @json: when the result may be either an object or an array; use @json-object: or @json-array: when the type is known.