Onions and shallots roast brilliantly; their sugars caramelise to an almost toffee-like sweetness. All that’s needed is a bit of time.
Put them whole, skins on or off, drizzled with oil, in an oven tray and bake at 200°C/Gas 6 for 45–60 minutes (depending on size), until tender.
Alternatively peel, drizzle with olive oil, and start them off with foil on top for the first 30 minutes to trap the steam, then remove the foil and continue roasting for a further 30–45 minutes to caramelise.
For a quicker cook, peel, slice into wedges, toss with oil, salt and pepper, and roast for 45 minutes at 190°C/Gas 5, turning them over once. Experiment with different fats, vinegars and herbs, or a little sugar or honey. For more ideas, see Whole Roasted Onions with Thyme.