It was not all that obvious from a legal point of view. Google vs Oracle was the first US Supreme Court case directly testing whether copying API declarations can violate copyright. It was
also decided later in the EU as well in that SAS vs WPL case where the EU Court of Justice finally ruled that software functionality, programming languages, and file formats are not copyrightable.
These famous cases set the legal tone for the entire world actually.