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][QUARKUS] 7.11.0 version introduces springframework Nullable annotation in Quarkus project. #20580

Open
5 of 6 tasks
catagreu opened this issue Feb 3, 2025 · 0 comments

Comments

@catagreu
Copy link

catagreu commented Feb 3, 2025

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

With the new version 7.11.0 of the openapi-generator, a @Nullable annotation was introduced in the SpringCodegen.java from org.springframework.lang
Since we are using the JavaCamelServerCodegen.java in our Quarkus project, which extends the SpringCodegen.java, these annotations are introduced in our generated pojo's, causing a compilation failure.

openapi-generator version

7.11.0

Generation Details

Example of generation. The @Nullable is only added to non-required attributes.

@Generated(value = "org.openapitools.codegen.languages.JavaCamelServerCodegen", date = "2025-02-03T10:45:30.354153+01:00[Europe/Madrid]", comments = "Generator version: 7.11.0")
public class Pojo {

  private String name;

  private String code;

  private @Nullable String attr1;

  private @Nullable String attr2;
Related issues/PRs

This is related with the PR merged recently:
1742b93#diff-9de34b4aad5de707e8aa0c031f20a6573f8f50826a437f0652c54b3788b37d41
Coming from issue: #17382

Suggest a fix

We propose to switch to a more neutral annotation like jakarta.annotation.Nullable which is compatible across frameworks.

@catagreu catagreu changed the title [BUG][JAVA][QUARKUS] Version 7.11.0 introduces springframework Nullable annotation in Quarkus project. [BUG][JAVA][QUARKUS] 7.11.0 version introduces springframework Nullable annotation in Quarkus project. Feb 3, 2025
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