How to create a spring between two links

I see that in the dynamics tag for joints you have the friction and damping, but how would one create a spring-like connection between two links? Like what is shown in: PyBullet hopper robot - YouTube.