In a medium skillet, heat olive oil and saute onion until tender, about 5 minutes. Add garlic, and saute for 1 minute. Stir in tomatoes, capers, black olives, red pepper flakes, and parsley. Bring to a boil, and simmer for 10 minutes.
Spread 1/2 cup of the sauce in a 11x7 inch baking dish, and arrange the snapper fillets in a single layer in the dish. Drizzle lemon juice over the fillets, and then pour the remaining sauce over all.
Bake for 15 minutes for 1/2 inch thick fillets, or 30 minutes for 1 inch thick fillets. Baste once with the sauce while baking. Snapper is done when it flakes easily with a fork.