openapi-processor / openapi-processor-base

re-usable code of openapi-processor
https://openapiprocessor.io
Apache License 2.0
2 stars 3 forks source link

Optionally clear output directory (or not) #123

Closed nuvitong closed 5 months ago

nuvitong commented 6 months ago

With #42 you added the feature, to clear the output directory automatically. But what, if you process two APIs into the same output directory? In this case only the code of the latest execution will stay.

So, it would be great, if the automatic directory clearing could be disabled by option (e.g. system variable of mvn call).

What do you think?

hauner commented 6 months ago

I could add an option to disable the auto delete but I would like to understand your use case.

Generating multiple apis into the same directory will overwrite interfaces and dtos if they contain identical names. To avoid this I recommend to use one target dir (and java package) for each api.

What is the reasoning behind using the same target directory?

nuvitong commented 6 months ago

Our target directory is generated/src/main/java as we check in the generated api code into the code repository. The separation of the generated classes is only by package.

Does that clarify our use case?

hauner commented 6 months ago

ok, I will add an option to disable it.

nuvitong commented 6 months ago

That is great news for us. Thank you very much.

hauner commented 5 months ago

released with openapi-processor-spring/micronaut 2024.2