Fry the two onions in a pan and transfer them to an oven tray along with the oil. Cover with peas, the chopped pepper and the carrots drained of their water. Add the rice.
Treat the chicken legs with salt or season as desired and arrange them on top. Cover the tray with aluminum foil. Bake in a preheated oven at 392°F (200 °C) for about 1 hour and 30 minutes.