async-stripe
async-stripe copied to clipboard
Sticky Deleted API structs
So, the current system has a problem when a struct becomes deprecated. The code gen (correctly) will not build a file when it's been "deleted" in the openapi, but that means that an old out of date output file is left in the "out" folder of the openapi code gen. So on "openapi-install" that old file will be copied into resources/generated and cause problems.
This is not a problem for people who pull down a clean build, but it is slightly annoying for someone who is incrmentally upgrading and any build systems that do not pull down clean.
We can add the out directory to the openapi-delete command, but that still leaves us with the annoying problem of the copied generated files in the main directory. So...what to do here? Do we just live with this issue or do we look for some other Rust solution to make this a little more automated? Normally, I'd add a special make target to do a deep clean, but this is Rust and Cargo so we would need the equivalent. It's not breaking, but I thought I'd raise it since it did screw up my pull this morning when I started working on this again.
I have been occasionally manually deleting the generated folder to deal with this. There was a conscious design decision to make that folder deletable so I am happy with adding a step in cargo make to clean the out folder and the generated folder in the repo.
See e9a70a192a9e2a9cdf9687a5339e7af4ca660c86 for an example. There is still a manual step involved in deleting the export lines, but it may be enough until we move to a fully generated solution (including exports).
Since the change in #231 is merged I will close
Actually I misunderstood, we of course need to handle the generated
folder as well.