Created by: adg-mh
When an endpoint with a response format of binary
is used, the generator sets the return type to Future<Response<Uint8List>>
, but attempts to deserialize the response as JSON, and does not set the ResponseType
in the dio request Options
. This PR fixes both of these issues so the response is returned directly as bytes without any attempt to deserialize.
(I was unsure of whether I should use isResponseBinary
vs isResponseFile
, but when I searched other generators I could find no real usage of isResponseBinary
so I went with File.
PR checklist
-
Read the contribution guidelines. -
If contributing template-only or documentation-only changes which will change sample output, build the project before. -
Run the shell script(s) under ./bin/
(or Windows batch scripts under.\bin\windows
) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run./bin/{LANG}-petstore.sh
,./bin/openapi3/{LANG}-petstore.sh
if updating the code or mustache templates for a language ({LANG}
) (e.g. php, ruby, python, etc). -
File the PR against the correct branch: master
,4.3.x
,5.0.x
. Default:master
. -
Copy the technical committee to review the pull request if your PR is targeting a particular programming language.
@ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09) @nickmeinhold (2019/09) @athornz (2019/12) @amondnet (2019/12)