OpenAPITools / OpenAPITools/openapi-generator
[BUG] OneOf java classes not getting generated as part of codeGen in gradle plugin 4.0.0
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
When I generate sever stub for spec having OneOf tags, the code generation gradle task is successful , but in the generated models package OneOf*.java classes are missing.
I am using org.openapitools:openapi-generator-gradle-plugin:4.0.0 for "jaxrs-jersey" generatorName.
For example for below YAML file class "OneOfSofa1Sofa2" is not getting generated , but it is referred for variable "sofaStyle" in generated class Home.java
I have attached the YML as txt
home.txt
Below gradle task was used:
openApiGenerate {
generatorName = "jaxrs-jersey"
inputSpec = "$rootDir/src/main/resources/home.yml".toString()
outputDir = "$rootDir".toString()
apiPackage = "com.home.rest.resources"
invokerPackage = "com.home.rest"
modelPackage = "com.home.rest.model"
modelFilesConstrainedTo = []
configOptions = [
dateLibrary: "java8"
]
}
Screenshot of how it looks in editor
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
Reproduce the issue with the attached home.yml and the shown openApiGenerate Gradle configuration using the jaxrs-jersey generator. Inspect the generated model package, including Home.java and the missing OneOfSofa1Sofa2.java class. Done means the OneOf class is generated and the sofaStyle reference resolves successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, backend, build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100