Skip to content
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

[BUG][JAVA][SPRING] When using lombok generators and generatedConstructorWithRequiredArgs build fails #16250

Open
dpozinen opened this issue Aug 3, 2023 · 0 comments

Comments

@dpozinen
Copy link

dpozinen commented Aug 3, 2023

Description

we use the spring generator with the below config

<openapi.producer.generator.config.additionalModelTypeAnnotations.default>
    @com.fasterxml.jackson.annotation.JsonIgnoreProperties(ignoreUnknown = true)
    @lombok.Builder(toBuilder = true)
    @lombok.NoArgsConstructor
    @lombok.AllArgsConstructor
</openapi.producer.generator.config.additionalModelTypeAnnotations.default>

to generate constructors & builders.

WIth the new generatedConstructorWithRequiredArgs parameter the build fails because lombok has already generated the constructor. Then the generator attempts to do the same and fails with a constructor already exists error.

openapi-generator version

6.6.0

Suggest a fix

I think it would be best to identify already generated constructors and just ignore them, instead of failing, since ultimately there already is a suitable constructor and hence the goal is achieved.

Not Duplicate

please note I am aware of #15494 and we have applied this workaround, but in my opinion this should work out of the box. Users shouldn't have to configure another property to work around this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant