We’re able to use structs in some places where we have deterministic fields for a given response. An address is a good example.
But we find ourselves “having” to use normal maps with string keys more often than not because of the amount of JSON data we work with that isn’t easily defined ahead of time. (This is equally problematic in something like TypeScript.)
An example might be running a report that aggregates a bunch of values for every SKU in a system, with the results being returned in the format:
{
"sku_001": { "title": "value", "color", "value", ... },
"sku_002": { "title": "value", "price", "value", ... },
"sku_003": { "width": "value", "height", "value", ... },
}
We also do a layout of layout in HEEX templates where we don’t know the “keys” ahead of time, and structs don’t allow fetching a field based on a key-string.






















