OpenAPITools / OpenAPITools/openapi-generator
[BUG] Generated java class name prefixed with Model
Open
Nobody has claimed this yet.
Issue: Bug
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
I am generating yml to java classes in spring boot project
my yml as below:
openapi: 3.0.1
info:
title: Common Device Input
termsOfService: 'https://www.XXXX.com'
contact:
url: 'https://www.XXXX.com'
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
version: 1.0.2
paths: {}
components:
schemas:
Log4j2Configuration:
type: object
properties:
configuration:
$ref: '#/components/schemas/Configuration'
description: Contains information about device broker log configuration
Configuration:
type: object
properties:
status:
type: string
description: Contains information about device broker log configuration
It is generating all Java classes perfectly , but one class generated as ModelConfiguration.java , I am expecting Configuration.java
Any Idea how to avoid this prefix ('Model*)
Thanks
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
Start with the supplied OpenAPI schema, especially the Configuration component and the generator options used for the Spring Boot output. Trace how that schema name becomes ModelConfiguration.java and verify the fix by regenerating the classes so the output is Configuration.java without breaking Log4j2Configuration.java.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100