When a player strikes the Ender Dragon with any sword, the sword will not lose its durability.
Steps to Reproduce:
1. Make a new Creative world.
2. Contruct an End Portal and enter it.
3. Equip yourself with diamond armour and any sword.
4. When the Ender Dragon gets close, hit it with your sword and notice the sword takes no damage.
Confirmed.