Serde
Serde copied to clipboard
2-level object arrays
Problem: Multi-level object arrays
I'm running into another limit with a 2-level array like this:
class Ledger {
/**
* @param InfoObject[][] $info,
*/
public function __contruct(
private readonly array $info,
) {}
public function getInfo(string $account, string $currencyCode) {
return $this->info[$account][$currencyCode];
}
}
I don't see how to describe this to serde, and am going to work around it w/ some boilerplate for an internal intermediate object that limits the arrays to 1 level.