To make the pastry, sift the ﬂour and salt into a mixing bowl. Rub in the butter until the mixture resembles ﬁne breadcrumbs. Add the water and mix to a dough. Knead gently on a lightly ﬂoured surface for a few seconds until smooth, then wrap in plastic wrap and chill for at least 30 minutes.
On a lightly ﬂoured surface, roll out the chilled dough to a square a little larger than 30 cm, trim the edges to that size and place on a large baking tray. Put half the sliced onions, followed by half the apples, in the centre of the dough square and sprinkle with half the sage, salt and pepper. Add the remaining onion, apple and seasonings and spread the sour cream on top.
Brush some beaten egg or milk around the edges of the dough and fold the two opposite corners over the vegetable ﬁlling so that they meet and overlap slightly in the centre. Repeat with the other two corners to make an envelope. Press the joins together gently to seal. Use the trimmings to decorate the pie and chill for at least 30 minutes. Preheat the oven to 220°C.
Brush the chilled pie all over with the remaining beaten egg or milk and bake in the centre of the oven for 40 minutes, or until the pastry is crisp and golden brown. (If the pastry begins to brown too much, protect it by covering the pie loosely with greaseproof paper or aluminium foil.)
Carefully transfer the pie to a serving plate or board and garnish with the sage leaves. Serve hot or cold, on its own or with cold meats, sausages and cheese.