Depending on your problem domain, you might be able to flatten it by just combining keys together (subject to keys being combinable like with string concatenation, using separators to ensure uniqueness of combined keys, etc.)<p>E.g., turn {&quot;foo&quot;: {&quot;bar&quot;: &quot;moop&quot;}} into {&quot;foo-bar&quot;: &quot;moop&quot;}. This also requires writing accessor fns, but it might be worth it, depending.