swagger-api / swagger-api/swagger-codegen

[Regression] Import mappings not correctly handled

Open
#2,248 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted Issue: Bug Server: Java
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

I updated my Swagger Codegen project today and remake a build of a project using it to generate code (Java CXF).

I'm now facing an issue, using the "import mappings" feature.
In my pom.xml, I specify:

<configOptions>
                                <sourceFolder>src/gen/java/main</sourceFolder>
                                <import-mappings>Event=foo.provided.Event</import-mappings>
                            </configOptions>

but in the generated code, the Event class used is not the foo.provided.Event. It's the generated one.

This was OK before my update (I can't remember when I made my last update before today).

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

Start with the pom.xml configuration shown in the issue and reproduce generation for the Java CXF project using the import-mappings setting. Compare the generated code's Event reference with foo.provided.Event; the work is done when the mapping is honored instead of using a generated Event class.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.