[BUG] [DART] Wrong code generated for List if enums
Created by: gibahjoe
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? Yes -
Have you validated the input using an OpenAPI validator (example)? Yes -
What's the version of OpenAPI Generator used? 4.2.3 -
Have you search for related issues/PRs? YES -
What's the actual output vs expected output? The generated files have compile time errors related to enums
Description
List of Enums are not properly generated in dart model files
openapi-generator version
I used version 4.2.3 jar
OpenAPI declaration file content or url
(here your code)
(for YAML code) or
{
"openapi": "3.0.1",
"info": {
"title": "OpenAPI definition",
"version": "v0"
},
"servers": [
{
"url": "http://localhost",
"description": "Generated server url"
}
],
"paths": {
"/test": {
"get": {
"tags": [
"greeting-controller"
],
"operationId": "sayHello2",
"parameters": [
{
"name": "helloDto",
"in": "query",
"required": true,
"schema": {
"$ref": "#/components/schemas/HelloDto"
}
}
],
"responses": {
"200": {
"description": "default response",
"content": {
"*/*": {
"schema": {
"type": "object"
}
}
}
}
}
}
},
"/test-multiple": {
"get": {
"tags": [
"greeting-controller"
],
"operationId": "searchDummyEntity",
"parameters": [
{
"name": "predicate",
"in": "query",
"required": true,
"schema": {
"$ref": "#/components/schemas/DummyEntityPredicateG"
}
}
],
"responses": {
"200": {
"description": "default response",
"content": {
"*/*": {
"schema": {
"type": "object"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"HelloDto": {
"type": "object",
"properties": {
"enumParams": {
"type": "array",
"items": {
"type": "string",
"enum": [
"ENUM1",
"ENUM2"
]
}
}
}
},
"DummyEntityPredicateG": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"notCode": {
"type": "string"
}
}
}
}
}
}
Command line used for generation
openapi-generator generate -i spec.json -g dart-jaguar
Steps to reproduce
Generate SDK from spec files that have List of enums as fields in their pojo