In a large baking dish, add the beans, tomatoes, garlic and sliced shallot. Drizzle generously with olive oil and season with salt and pepper. Toss together to combine.
Place the cod fillets into the baking dish and season each piece with salt and pepper.
In a small bowl, combine the pesto and half of the lemon juiced. Spread the pesto over each piece of fish. You can mix any leftover pesto over the veggies.
Slice the other half of the lemon and place it around the dish. Season lightly with olive oil.
Bake for about 15-20 minutes, depending on the thickness of the fish. The cod should flake easily with a fork when ready.