Preheat the oven to 190C/gas 5/fan 170C.
Peel the onions leaving them whole, removing the first layer of onion as you peel. Cut them in half across the middle and remove several layers from the centre of each using a teaspoon. Fill any holes with a small slice of onion taken from the centre layers. Arrange onion halves, cut side up in a small ovenproof dish. Pour a splash of water into the dish and brush the onions with some of the oil. Cover the dish tightly with foil and bake for 45-50 minutes until they are tender.
Meanwhile, finely chop the inner layers. Heat the remaining oil in a medium sized saucepan and fry the chopped onion, stirring occasionally, for 10 minutes until soft and beginning to brown, leave to cool.
Mix the cooled chopped onions in a bowl with half the feta, the breadcrumbs, chilli, sun-dried tomatoes, chopped thyme and parsley,walnuts, beaten egg and some salt and freshly ground black pepper. Stir well until everything’s combined.
Increase the oven to 200C/gas 6/fan 180C. Divide the feta stuffing between the onions, then scatter over the remaining cheese and sprinkle over a few thyme sprigs.
Drizzle over a little oil from the tomato jar and cook for 25 minutes until the stuffing is bubbling and the feta is golden brown.