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

Breaking change due to use-bean-validation and cannot be deactivated #819

Closed
andrejpetras opened this issue Oct 12, 2024 · 3 comments · Fixed by #820
Closed

Breaking change due to use-bean-validation and cannot be deactivated #819

andrejpetras opened this issue Oct 12, 2024 · 3 comments · Fixed by #820
Assignees
Labels
area:client This item is related to the client extension bug Something isn't working

Comments

@andrejpetras
Copy link
Member

andrejpetras commented Oct 12, 2024

  1. The new use-bean-validation feature in version 2.5.0 is enabled by default. Currently, we need to disable it on a per-project as a breaking change to existing source code. I would like to suggest disabling this feature by default, as none breaking change.
        this.embeddedTemplateDir = "templates";

        Boolean beanValidation = (Boolean) this.additionalProperties.getOrDefault("use-bean-validation", true);
        this.setUseBeanValidation(beanValidation);

Source code: https://github.com/quarkiverse/quarkus-openapi-generator/blob/2.5.0/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/wrapper/QuarkusJavaClientCodegen.java#L56

  1. Import of the class jakarta.validation.Valid is not disabled when use-bean-validation is disabled globally or per client.
{! https://github.com/OpenAPITools/openapi-generator/issues/18974 !}
import jakarta.validation.Valid;

{#for imp in imports}
import {imp.import};

Source code: https://github.com/quarkiverse/quarkus-openapi-generator/blob/2.5.0/client/deployment/src/main/resources/templates/libraries/microprofile/model.qute#L4

Example breaking PR to update from 2.4.7 to 2.5.0 onecx/onecx-quarkus#214

@andrejpetras andrejpetras changed the title Unable to disable use-bean-validation Breaking change due to use-bean-validation and cannot be deactivated Oct 12, 2024
@mcruzdev
Copy link
Member

Thank you for reporting it @andrejpetras, I will take care of it tomorrow ASAP.

@gwydionmv
Copy link
Contributor

Hello @hbelmiro! We just faced this issue with the breaking change of the mandatory Jakarta import. I can see that it's already fixed but no release has been generated, right? What's the ETA for it? Thanks!

@ricardozanini
Copy link
Member

@gwydionmv we have another breaking change that I'm waiting to get fixed before releasing a new one: #824

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:client This item is related to the client extension bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants