Skip to content

[BUG][JAVA][QUARKUS] 7.11.0 version introduces springframework Nullable annotation in Quarkus project. #20580

Description

@catagreu

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions