Preheat your oven to 375°F (190°C).
In a large mixing bowl, combine the zucchini, eggplant, bell pepper, onion, and garlic. Drizzle with olive oil and sprinkle with oregano, basil, salt, and pepper. Toss until the vegetables are well coated.
Spread the vegetable mixture evenly in a large baking dish.
Pour the drained diced tomatoes over the vegetables, then sprinkle the cannellini beans on top.
If using, sprinkle the shredded mozzarella cheese over the top of the dish.
Cover the baking dish with aluminum foil and bake for 30 minutes.
Remove the foil and bake for an additional 15-20 minutes, or until the vegetables are tender and the cheese is bubbly and golden.
Let the ratatouille cool for a few minutes before serving. Garnish with fresh basil leaves if desired.