Based on the commedia dell'arte play by Count Carlo Gozzi after a supposedly Persian story from the collection Les Mille et un jours (1710–1712) by François Pétis de la Croix (not to be confused with One Thousand and One Nights).