Bug Report Checklist
Description
Issue:
When generating fromJson in native_class.mustache has a complexType "Object" (happens when a Schema has a List), then you will get the Error: Error: Member not found: 'Object.listFromJson' within the fromJson of the Model.

Suggestion:
Change Line:
{{{name}}}: {{{complexType}}}.listFromJson(json[r'{{{baseName}}}']){{#uniqueItems}}.toSet(){{/uniqueItems}},
With Lines:
{{#items.complexType}}
{{{name}}}: {{{complexType}}}.listFromJson(json[r'{{{baseName}}}']){{#uniqueItems}}.toSet(){{/uniqueItems}},
{{/items.complexType}}
{{^items.complexType}}
{{{name}}}: (json[r'{{{baseName}}}'] as List).map((e) => e as {{{complexType}}}){{#uniqueItems}}.toSet(){{/uniqueItems}}{{^uniqueItems}}.toList(){{/uniqueItems}},
{{/items.complexType}}
openapi-generator version
7.10.0
OpenAPI declaration file content or url
{
"openapi": "3.0.1",
"components": {
"schemas": {
"Test": {
"required": [
"name"
],
"type": "object",
"properties": {
"name": {
"type": "string"
},
"values": {
"type": "array",
"items": {
"type": "object"
}
}
}
}
}
}
}
Steps to reproduce
docker-compose.yml:
services:
openapi-dart-generator:
image: openapitools/openapi-generator-cli:latest
volumes:
- .:/workspace
working_dir: /workspace
command: [
"generate",
"-i", "/workspace/test.json",
"-g", "dart",
"-o", "/workspace/output/v1",
"--additional-properties", "pubName=api_client",
"--skip-validate-spec",
# "-t", "/workspace/custom-templates"
]
Run: docker-compose up
Import Output into PubSpec:
api_client:
path: \OpenAPI\output\v1
Use Import in main.dart:
import 'package:api_client/api.dart';
Run Flutter and this Error:

Bug Report Checklist
Description
Issue:

When generating fromJson in native_class.mustache has a complexType "Object" (happens when a Schema has a List), then you will get the Error: Error: Member not found: 'Object.listFromJson' within the fromJson of the Model.
Suggestion:
Change Line:
{{{name}}}: {{{complexType}}}.listFromJson(json[r'{{{baseName}}}']){{#uniqueItems}}.toSet(){{/uniqueItems}},With Lines:
openapi-generator version
7.10.0
OpenAPI declaration file content or url
Steps to reproduce
docker-compose.yml:
Run: docker-compose up
Import Output into PubSpec:
Use Import in main.dart:
import 'package:api_client/api.dart';Run Flutter and this Error:
