OpenAPITools / OpenAPITools/openapi-generator
[BUG] [JAVA/SPRING][3.1.0] Model names are not working when coming from another file.
Nobody has claimed this yet.
- 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 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
The generated model has a wrong name, when the model comes from another file.
E.g. in my example the model is named AddRequest, but should be named UserDto
openapi-generator version
I am using 7.10.0. It is somewhat of a regression. This issue is not happening when I use openapi: "3.0.3", but it is happening with openapi: "3.1.0"
OpenAPI declaration file content or url
Generation Details
git clone git@github.com:aminabromand/openapi.git
and follow the readme
Steps to reproduce
git clone git@github.com:aminabromand/openapi.git
and follow the readme
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Clone the repository linked in the issue and follow its README to reproduce the Java/Spring generation with the OpenAPI 3.1.0 and 3.0.3 examples. Compare the generated model names and trace how the external model reference is resolved. Done means the 3.1.0 example generates UserDto rather than AddRequest, without regressing the 3.0.3 behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi, spring
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100