I believe there were lawsuits over IBM clones, way back when, amd the clones won, based on interoperability. Apis are software, not hardware, but you'd expect this to be the same, because of the same underlying policy considerations.
Sometimes courts uphold the letter of the law, but say the legislature should change it.