In the Buddhist tradition, the Sibi Jataka tells this story - in a past life of the Buddha:
King Sibi was a bodhisattva - a being on the path to Buddhahood - who had vowed to give away whatever was asked of him in service of beings.
Indra, the king of the gods, wanted to test this vow to its limit. He disguised himself as a blind Brahmin and came to Sibi's court.
"I am blind," said the Brahmin. "I have heard that the great King Sibi gives whatever is asked. I ask for one of your eyes."
Sibi did not hesitate. He called his surgeon and had one eye removed and placed in the Brahmin's socket. The Brahmin then asked for the second eye.
Sibi gave the second eye. He was now blind.
Indra was moved beyond the capacity of gods to be unmoved. He revealed himself - and offered to restore Sibi's eyes, greater than before.
Sibi said: "I gave my eyes as a gift. A gift given in love does not require restoration. Keep the eyes in your pocket. I am content."
Indra wept and restored the eyes anyway - but what he had witnessed had changed even a god. Sibi received the eyes back - and something more: the full capacity of divine sight, the ability to see the truth of things beyond the physical.