Open fauxbytes opened 1 year ago
I think ideally it should by enabling an option (e.g. --remove-outdated-files) to clean up outdated files that are no longer in FILES.
Would you like to contribute a PR or sponsor this feature request?
I was having the same issue and would like to implement it in the generator but, in the meantime, I was able to work around this by saving and comparing the .openapi-generator/FILES
before and after generating:
# If FILES doesn't exist, i.e. the generator hasn't run, touch the temporary file to ensure it exists
cp .openapi-generator/FILES FILES.tmp || touch FILES.tmp
# Generate client...
# Remove the files that generating the client removed from the FILES list
comm -2 -3 FILES.tmp .openapi-generator/FILES | xargs rm
rm FILES.tmp
Hi. More a question at this point than a FR: when an api change translates to a removal of a file entry from
.openapi/FILES
, is there a way to make the generator remove that file?If not, shouldn't there be? Or instead, a clarifying note on the matter on the docs ("files showing as removed from FILES - aren't. If you want them gone, remove manually")?