Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [JAVA/SPRING][3.1.0] Model names are not working when coming from another file. #20365

Open
3 of 6 tasks
aminabromand opened this issue Dec 21, 2024 · 1 comment
Open
3 of 6 tasks

Comments

@aminabromand
Copy link

aminabromand commented Dec 21, 2024

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

Openapi 3.1.0 Not working

Openapi 3.0.3 Working

Generation Details

git clone [email protected]:aminabromand/openapi.git
and follow the readme

Steps to reproduce

git clone [email protected]:aminabromand/openapi.git
and follow the readme

@wing328
Copy link
Member

wing328 commented Dec 21, 2024

thanks for reporting the issue

as a workaround, you can try the modelNameMappings option to have complete control of the model naming: https://github.com/openapitools/openapi-generator/blob/master/docs/customization.md#name-mapping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants