The much more likely alternative in a maximally capitalist / free market maximalist society would be keeping all drug formulas as trade secrets, and thereby having all drugs as branded, no generics whatsoever (or few - perhaps some substances could be reverse engineered). In such a society, having the state force companies to publish their formulas would be seen as unacceptable interference in the free market, almost certainly.
In a pure free market, someone could try to keep the formulas secret, but others can just reverse engineer it into being public, which is basically guaranteed to happen if there's sufficient demand. Given that they aren't wasting money trying to obfuscate the recipe nor the formula, these competitors do have an advantage over the original. As such, I posit that free-to-copy will be default behavior in a pure free market, with trade-scerets being resteicted on niche sectors.
The reason we can't do this today is primarily that reverse engineering is heavily restricted by IP laws.