OpenAPITools / OpenAPITools/openapi-generator

[BUG] Generated resources with wrong package name

Open
#7,343 1 comment 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

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 issuue still exists?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)

Generated resources with wrong package name

openapi-generator version

4.3.1

Generation Details

After put generation details in pom files, the sources can be generated. However, after generate all classes/interface have the wrong package name. An extra fre-fix "openapi.src.main.java" is added to the generated package deceleration.

plugin config in pom.xml are shown below
image

difference between generated package name and actual package name are shown in figs below:
image
image

Steps to reproduce
  1. put plugin in pom.xml file
  2. run mvn clean
  3. run mvn generate-sources

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 plugin configuration in pom.xml and reproduce the issue using mvn clean followed by mvn generate-sources. Compare the generated class and interface package declarations with the configured package name; done means the extra "openapi.src.main.java" prefix is no longer present.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.