Preheat the oven to 200°C.
Wash the duck with cold water and then pat- dry with kitchen paper. Remove any remaining feathers with a tweezer. Season with the salt and freshly ground black pepper inside and out, then put most of the thyme in the cavity together with 1 star anise and 1 cinnamon stick.
Wash the apples, cut them into 4 wedges and remove the core. Peel the onions and cut them into wedges.
Put the wild duck (chest facing downwards) in a greased baking dish. Scatter the onion and apple pieces around it, then add the cinnamon (torn into pieces) and the star anise. Drizzle everything with olive oil, then pour in the cider. Cover the dish with foil.
Turn the oven down to 160°C and bake the duck for 90 minutes in the middle of the oven. After about 45 minutes turn over the duck.
After 90 minutes take off the foil, turn up the heat a bit and bake until the skin is golden and crispy.
Let it rest for 10 minutes before carving, then serve with the apple and onion, drizzled with the cooking jus.