openapi-processor/openapi-processor-spring

Don't add the @Generated annotation (configurable)

Closed this issue · 4 comments

I don't understand the need to add the noise of the @Generated annotation to every class. It would be nice if there was a configuration option to not add it.

I don't need @Generated(value = "openapi-processor-spring", version = "2024.3") in the generated classes.

The @Generated annotation helps some tools to ignore the generated code. jacoco for example doesn't report code coverage of @Generated classes. For this reason many generators add it.

The generated code has a lot of required annotations already. Where is the benefit removing this single annotation?

In my case I sometimes move the generated code into src/main/java if the generated code almost never changes (I just need the model files). In that case I also have to move the support package (or remove the generated annotation).

Ok, sounds like a valid use case. 😄 What is wrong with the interfaces?

What is wrong with the interfaces?

I am creating a client, so I only need the models. Although I have implemented a API using this as well and in that case I removed the interfaces because I didn't like switch between the interface and the implementation to see the mappings. Easier if it is all in one file.