Bug Report Checklist
Description
openapi-generator version
oneOf block in this spec produces undefined model OneOfarraystring. I have tried and reproduced this with Java and Go generators and looks like this behavior is consistent for all the generators.
OpenAPI declaration file content or url
{
"openapi": "3.0.0",
"info": {
"title": "",
"version": "v2"
},
"servers": [
{
"url": ""
}
],
"externalDocs": {
"description": "",
"x-amf-title": "About",
"url": ""
},
"paths": {
"/database/databases": {
"get": {
"description": "List databases.",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/database_databases_query"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/database_databases"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"database_databases": {
"description": ".",
"type": "array",
"items": {}
},
"database_databases_query": {
"description": ".",
"type": "object",
"additionalProperties": false,
"properties": {
"uuid": {
"description": "Database uuid filter",
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "string"
}
]
},
"status": {
"description": "Database status filter",
"oneOf": [
{
"type": "array",
"items": {
"enum": [
"CREATE_IN_PROGRESS",
"CREATED",
"UPDATE_IN_PROGRESS",
"DELETE_IN_PROGRESS",
"DELETED"
],
"type": "string"
}
},
{
"enum": [
"CREATE_IN_PROGRESS",
"CREATED",
"UPDATE_IN_PROGRESS",
"DELETE_IN_PROGRESS",
"DELETED"
]
}
]
}
}
}
}
}
}
Generation Details
openapi-generator-cli generate -i api-oas3-modified.json -g go-server -o generated-sdk/go-server --enable-post-process-file
openapi-generator-cli generate -i api-oas3-modified.json -g go -o generated-sdk/go --enable-post-process-file
openapi-generator-cli generate -i api-oas3-modified.json -g java -o generated-sdk/java --enable-post-process-file
Steps to reproduce
- Put spec in a file
- Run generation cli commands above
- Search for
OneOfarraystring in DatabaseDatabasesQuery model in generated code
Related issues/PRs
Suggest a fix
Bug Report Checklist
Description
openapi-generator version
oneOf block in this spec produces undefined model
OneOfarraystring. I have tried and reproduced this with Java and Go generators and looks like this behavior is consistent for all the generators.OpenAPI declaration file content or url
{ "openapi": "3.0.0", "info": { "title": "", "version": "v2" }, "servers": [ { "url": "" } ], "externalDocs": { "description": "", "x-amf-title": "About", "url": "" }, "paths": { "/database/databases": { "get": { "description": "List databases.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/database_databases_query" } } } }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/database_databases" } } } } } } } }, "components": { "schemas": { "database_databases": { "description": ".", "type": "array", "items": {} }, "database_databases_query": { "description": ".", "type": "object", "additionalProperties": false, "properties": { "uuid": { "description": "Database uuid filter", "oneOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "string" } ] }, "status": { "description": "Database status filter", "oneOf": [ { "type": "array", "items": { "enum": [ "CREATE_IN_PROGRESS", "CREATED", "UPDATE_IN_PROGRESS", "DELETE_IN_PROGRESS", "DELETED" ], "type": "string" } }, { "enum": [ "CREATE_IN_PROGRESS", "CREATED", "UPDATE_IN_PROGRESS", "DELETE_IN_PROGRESS", "DELETED" ] } ] } } } } } }Generation Details
Steps to reproduce
OneOfarraystringinDatabaseDatabasesQuerymodel in generated codeRelated issues/PRs
Suggest a fix