In production code, this could lead to out of bounds access. Maybe use `attr_size` as iteration boundary so that we can't overshoot on too long JSON inputs?