Every time I watched a Shrek movie, I constantly wondered what fairy tale the talking donkey came from. I mean, an ogre is a common monster in fantasy-type stuff. It's an archetype. But a talking donkey?
The only talking donkey from any story I could think of was Balaam's. Which was a Bible story. Surely that's not where they got it and are they demoting the story to just a fairy tale? Surely DreamWorks wasn't brave enough to put that in their film!
"The Bremen Town Musicians" by the Grimms Brothers (I think it's attributed to them, anyway) features a talking, singing, clever donkey, the inspiration for Donkey's character. Which, Donkey sings for his supper in the last film since it's a World Gone Wrong.
Quite frankly, I thought "The Bremen Town Musicains" was a stupid story. It may have just been a bad translation, but I really didn't like it.
But that's where they got it. Thank you, Google.