Skip to content

Don't add the @Generated annotation (configurable) #269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mjparme opened this issue May 31, 2024 · 4 comments
Closed

Don't add the @Generated annotation (configurable) #269

mjparme opened this issue May 31, 2024 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@mjparme
Copy link

mjparme commented May 31, 2024

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.

@hauner
Copy link
Member

hauner commented Jun 1, 2024

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?

@mjparme
Copy link
Author

mjparme commented Jun 2, 2024

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).

@hauner hauner added the enhancement New feature or request label Jun 4, 2024
@hauner
Copy link
Member

hauner commented Jun 4, 2024

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

@mjparme
Copy link
Author

mjparme commented Jun 6, 2024

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.

hauner added a commit to openapi-processor/openapi-processor-base that referenced this issue Jun 10, 2024
hauner added a commit to openapi-processor/openapi-processor-base that referenced this issue Jun 10, 2024
hauner added a commit to openapi-processor/openapi-processor-base that referenced this issue Jun 10, 2024
hauner added a commit to openapi-processor/openapi-processor-base that referenced this issue Jun 16, 2024
hauner added a commit that referenced this issue Jun 16, 2024
@hauner hauner added this to the core: 2024.5 milestone Jun 16, 2024
@hauner hauner closed this as completed Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants