OpenAPITools / OpenAPITools/openapi-generator

[BUG][KOTLIN-SPRING] Invalid FeignClient is generated

Open
#15,854 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Description

Generated FeignClient is wrong:
@RequestMapping annotation not allowed on @FeignClient interfaces

openapi-generator version

6.6.0

Generation Details
openApiGenerate {
    generatorName.set("kotlin-spring")
    inputSpec.set("$projectDir/src/main/resources/registry_api.yaml")
    outputDir.set("$buildDir/generated")
    modelNameSuffix.set("Resource")
    importMappings.put("java.time.OffsetDateTime", "java.time.Instant")
    typeMappings.put("OffsetDateTime", "Instant")
    configOptions.put("basePackage", apiBasePackage)
    configOptions.put("apiPackage", apiBasePackage)
    configOptions.put("modelPackage", "$apiBasePackage.resource")
    configOptions.put("gradleBuildFile", "false")
    configOptions.put("exceptionHandler", "false")
    // configOptions.put("interfaceOnly", "true")
    configOptions.put("generateSupportingFiles", "false")
    configOptions.put("documentationProvider", "none")
    configOptions.put("annotationLibrary", "swagger2")
    configOptions.put("skipDefaultInterface", "true")
    configOptions.put("useSpringBoot3", "true")
    configOptions.put("library", "spring-cloud")
}

When I start to test the generated client, I get the above runtime error about @RequestMapping

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the generation using the kotlin-spring generator, version 6.6.0, and the referenced registry_api.yaml with the listed Gradle options. Inspect the generated FeignClient and verify that starting the client no longer raises the reported @RequestMapping annotation not allowed on @FeignClient interfaces error.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, openapi, spring
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.