openapi-generator
openapi-generator copied to clipboard
[BUG] [JAVA] Cannot use oneOf as query parameter
Bug Report Checklist
- [x] Have you provided a full/minimal spec to reproduce the issue?
- [ ] Have you validated the input using an OpenAPI validator (example)?
- [x] Have you tested with the latest master to confirm the issue still exists?
- [x] Have you searched for related issues/PRs?
- [x] What's the actual output vs expected output?
- [ ] [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
openapi-generator version
7.6.0-SNAPSHOT
OpenAPI declaration file content or url
parameters:
name: myParameter
in: query
required: false
schema:
oneOf:
- type: number
- type: string
will result in name of openapi class as actual query parameter instead of my string or number
org.openapitools.client.model.myParameter
as a workaround, what about simplifying the schema to the following instead?
parameters:
name: myParameter
in: query
required: false
schema:
- type: string
as number and string make no difference in the query parameter in most cases.