You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
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}}
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:
The text was updated successfully, but these errors were encountered: