Portfolio duration and convexity

Two of the assumptions we make when calculating portfolio duration/convexity using a weighted average is that the yield curve is flat and there is a parallel shift in the yield curve. I understand why the second assumption must hold for the YTMs of all bonds to change by the same amount but why is it necessary the first assumption must hold?