It is a common motif in medieval and folk literature, especially fairy tales.
[5] Bible: Mark 6.14-29: the beheading of John the Baptist involves a rash promise of king Herod Antipas to Salome, the daughter of his second wife Herodias, who, by her mother's advice asked for the head of John.
[6] Geoffrey Chaucer's "The Franklin's Tale", itself partly based on Boccaccio's The Filocolo: Dorigen, a married woman whose husband is absent, promises another suitor that he may have her if he makes the rocks on the coast of Brittany disappear.
[5][7] Chaucer's "The Wife of Bath's Tale": the main character, a young rapist knight threatened with execution if he cannot answer the question "What do women want?," promises an older woman (the proverbial "loathly lady") anything she desires if she can provide the answer (she desires to marry him).
You can help Wikipedia by expanding it.This literary criticism-related article is a stub.