OpenAPITools / OpenAPITools/openapi-generator
Unknown Java type created when using oneOf
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
I am seeing an issue in Java for one of the fields. We have a field called ipAddress and the description in swagger is as below.
ipAddress:
description: The location the content is trying to be played from
type: string
oneOf: [
{format: ipv4},
{format: ipv6}
]
Instead of creating it as a String, the openapi-generator-maven-plugin is creating it as OneOfAnyTypeAnyType
Also it is creating an import in API class for CollectionFormats.* which doesn't exist
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 provided OpenAPI schema and reproduce generation through the openapi-generator-maven-plugin. Inspect the generated Java field type and API imports for the oneOf ipAddress case. Done means the field is generated as String and the nonexistent CollectionFormats.* import is absent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100