Preheat the oven to 360 degrees F.
At the bottom of a casserole dish put pieces of onion and garlic. Wash chicken legs, dry and sprinkle with salt and smear each with 1 tablespoon oil. Under the skin put one flat tablespoon of cheese and a piece of rosemary.
Lay the chicken legs on the onions and put into the preheated oven and bake, uncovered, in the middle rack for about 60 - 70 minutes. Let it first bake for 50 minutes, then cover it with foil and close oven for another 15 minutes.
Pour the juices over the top if desired and serve warm.