openapi-generator
openapi-generator copied to clipboard
[BUG] [JAVA] Array of oneOf should be possible to be empty
Description
When using oneOf for an array it generates in a way that array of single value can not be empy. If you leave out the oneOf and have an array of just strings it can be empty.
if (instance instanceof List) {
List<?> list = (List)instance;
if (list.get(0) instanceof sv) {
super.setActualInstance(instance);
return;
}
}
openapi-generator version
7.6.0 -snapshot default library
OpenAPI declaration file content or url
mv:
oneOf:
- $ref: "#/components/schemas/sv"
- type: array
items:
$ref: "#/components/schemas/sv"
sv:
oneOf:
- type: number
format: double
- type: string
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
Allow it to be empty