Preheat the oven to 400°F(200°C). Oil a baking dish just large enough to hold the fish in a single layer. Spread the onion slices in an even layer in the prepared dish and place in the oven as it preheats. Place the fish fillets on a plate and season lightly on both sides with salt. Squeeze the lime halves over the fish.
Cook the fish
Remove the baking dish from the oven and arrange the fillets, skin side down, on top of the onion. Top with the tomatoes, then scatter with the olives, capers, and chiles. Cover the dish tightly with aluminum foil and cook until the fillets are opaque throughout, about 10 minutes for thin fillets or 12–15 minutes for fillets about 1inch (2.5cm) thick. Sprinkle with the cilantro, if using, and serve.