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
The problem "fromJson" is not a method on class "File", Also "file" is "MultipartFile", which possibly means "File" should be "MultipartFile". (I am sorry for file and File).
freshteapot
changed the title
[BUG][DART] Using multipart/form-data breaks on File.fromJson
[BUG] [DART] Using multipart/form-data breaks on File.fromJson
Nov 5, 2020
Bug Report Checklist
Description
The generated code.
The problem "fromJson" is not a method on class "File", Also "file" is "MultipartFile", which possibly means "File" should be "MultipartFile". (I am sorry for file and File).
openapi-generator version
OpenAPI declaration file content or url
It should fail with the petstore yaml file
Your more than welcome to try against
https://gist.github.com/freshteapot/2e33445c0a2f88220a156e1f61589590
Generation Details
From what I can understand using the petstore example will trigger this to happen.
Working with https://gist.github.com/freshteapot/2e33445c0a2f88220a156e1f61589590.
Use
DART_POST_PROCESS_FILE="/usr/local/bin/dartfmt -w" \ openapi-generator generate -i /tmp/openapi/one/learnalist.yaml -g dart -o /tmp/openapi/dart \ --additional-properties ensureUniqueParams=false
Related issues/PRs
Will dig up things that remotely link.
Suggest a fix
Maybe not using fromJson and just treat "file" as filename.
file, in this case is "MultipartFile". The below code compiles, not 100% sure if it works, as I haven't used the new api in my flutter app.
Possibly the issue is linked to
openapi-generator/modules/openapi-generator/src/main/resources/dart2/class.mustache
Lines 73 to 75 in 3f18d0f
I suspect this might also effect toJson, as well. But at least it compiles.
The text was updated successfully, but these errors were encountered: