When trading with a villager if the first trade requires for example emeralds to get an item, and the next trade requires an item to get emeralds you can place the item in the first trade and get the second trade.
This don't have a limit of how many you can trade, and it happens no matter what items you need for the second trade.
Here are some screenshots
Duplicate of MC-3980 , please use the search function to see if your bug has already been submitted. Currently over 35% of tickets are being closed as duplicate.