Caliph Harun al-Rashid cannot sleep and calls for amusement, so his Vizier brings in Ali the Persian. Ali tells the Caliph a story of the time he went to a city. A Kurd stole his wallet and claimed it was his, so the people took them to the Kazi (Qadi) for a trial. The Kurd described ridiculous things in the bag, like buildings and people, so Ali described even more outlandish contents. The contest continued and finally the Kazi said they were making fun of Kazis. He opened the bag only to find some bread and other food.
The Caliph rewards Ali for the story.