openapi-generator
openapi-generator copied to clipboard
[dart2] [client] Adds correct deserialization of octet-streams into Uint8List
fix #12161
This PR is part of the effort to split PR https://github.com/OpenAPITools/openapi-generator/pull/17548
This PR is a bit meatier than the others -- I copied much of the logic for adding uint8list support to the AbstractDartCodegen from the Dart-dio generator.
The big changes to look out for are:
- octet streams now correctly deserde into Uint8List, instead of the previous MultipartFile (which was fine for uploads, but invalid for downloads)
-
decodeBodyBytes()anddeserialize()now returnsdynamicinstead of String, which lets us switch on thecontent-typeto return either a string, or a Uint8List.
@jaumard (2018/09) @josh-burton (2019/12) @amondnet (2019/12) @sbu-WBT (2020/12) @kuhnroyal (2020/12) @agilob (2020/12) @ahmednfwela (2021/08)