Skip to content

[BUG][JavaSpring] cannot find symbol class AtomicInteger #21566

@Giletka

Description

@Giletka

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator?
  • 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

Spring generator (with returnSuccessCode : "true" option) generates AtomicInteger usage in a code, but not import java.util.concurrent.atomic.AtomicInteger;, which leads to cannot find symbol error

openapi-generator version

versions that doesn't work: 7.13.0, 7.14.0
versions that works: 7.12.0 (it doesn't generate any AtomicInteger in my case)

OpenAPI declaration file content or url

https://gist.github.com/Giletka/57fe7ca315e24be0877f9e6cbbf63f47

Generation Details/Steps to reproduce

Generating using gradle plugin with such configuration:

  generateModelTests = false
  generateModelDocumentation = false
  generateApiTests = false
  generateApiDocumentation = false
  validateSpec = true
  configOptions = [
      dateLibrary         : "java8",
      library             : "spring-boot",
      apiPackage          : "test.bug.api",
      invokerPackage      : "test.bug",
      modelPackage        : "test.bug.api.model",
      useBeanValidation   : "true",
      delegatePattern     : "true",
      useSpringBoot3      : "true",
      returnSuccessCode   : "true"
  ]
  globalProperties = [
      apis                    : '',
      models               : 'TestRequest,TestResponse,ErrorResponse',
      supportingFiles : 'ApiUtil.java',
      skipFormModel : 'false'
  ]

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