custom keys: changed folding example with cast_to and wildcard support