Skip to content

[BUG] [java][restclient] Fix missing javax validation imports with list validation #19437

Description

@tdschwebach

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

Similar to #18332, building a rest client does not include the import statements.

List<@Valid AccountRequest> accountRequest

In the above sample, Valid is not found.

openapi-generator version

7.8.0

Generation Details

Spring Boot 3, Spring Framework 6, openapi generator 7.8.0, java17

{
  "groupId":"com.test",
  "artificactId": "account-client",
  "modelPackage": "com.test.model",
  "apiPackage": "com.test.api",
  "useBeanValidation": "true,
  "useTags": true,
  "hideGenerationTimeStamp": true,
  "dateLibrary": "java8-localdatetime",
  "library": "restclient",
  "useJakartaEe": true
}
Steps to reproduce

When using the openapi generator gradle plugin:

./gradlew build

Related issues/PRs

#18332

Suggest a fix

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions