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
I've removed the mapFromJson call from my template (copied today from the master) and I haven't found any issues with the dart analyzer.. but I haven't tested it in runtime either, so I'm not sure.
Another way to fix it could be to add the mapFromJson as an extension method for maps.. but I'm not sure how it would work
Fun fact (?): I've copied all the dart generator sources, converted them to kotlin and generated a client just to see if could fix the issue.. but the project is too complex for me to understand how/where that Map was generated, and I found out that some of my problems were solved yesterday on the templates 😆 (😢)
The text was updated successfully, but these errors were encountered:
Bug Report Checklist
Description
Dart generator may have a problem dealing with a
Map
ofMap
s (something likeMap<String, Map<String>>
), here's a screenshot from a generated code:There's no such thing as
Map.mapFromJson
(at least I couldn't find it in dart 1 or 2 docs), so maybe there's a problem with the generator template.openapi-generator version
5.0.0-beta3
OpenAPI declaration file content or url
https://gist.github.com/Grohden/13d012470a9860f3dc26c219c4674361
Steps to reproduce
Download the gist json, and run:
Related issues/PRs
Probably #7850 (?)
Suggest a fix
The problem may be here:
openapi-generator/modules/openapi-generator/src/main/resources/dart2/class.mustache
Lines 149 to 152 in 4dc8d2a
I've removed the
mapFromJson
call from my template (copied today from the master) and I haven't found any issues with the dart analyzer.. but I haven't tested it in runtime either, so I'm not sure.Another way to fix it could be to add the
mapFromJson
as an extension method for maps.. but I'm not sure how it would workFun fact (?): I've copied all the dart generator sources, converted them to kotlin and generated a client just to see if could fix the issue.. but the project is too complex for me to understand how/where that
Map
was generated, and I found out that some of my problems were solved yesterday on the templates 😆 (😢)The text was updated successfully, but these errors were encountered: