The postulate that the velocity of light in a vacuum is the same in all inertial frames, can be exploited to establish that the spacetime interval between two events $x^\mu=(ct,{\bf r})$ and $x^\mu+dx^\mu=(ct+cdt,{\bf r}+d{\bf r})$ defined as $$ds^2=\eta_{\mu\nu}dx^\mu dx^\nu=c^2dt^2-d{\bf r}^2\tag{1}$$ remains invariant.
In general relativity, we require $$ds^2=g_{\mu\nu}(x)dx^\mu dx^\nu \tag{2}$$ to be invariant. Which postulate of general relativity gives rise to this requirement?