[DART-DIO] Dart dio generated code can't handle binary upload
See original GitHub issueDescription
The code generated by dart dio generator is wrong for the type string binary (for files).
"/api/v1/shops/{shop_id}/transactions/{id}/signature":
patch:
operationId: patch_shops_transaction_signature_partial
description: ""
requestBody:
content:
image/png:
schema:
type: string
nullable: true
format: binary
description: signature image to upload
required: true
responses:
"201":
description: All good
tags:
- transactions
parameters:
- name: id
in: path
required: true
schema:
type: integer
- name: shop_id
in: path
required: true
schema:
type: integer
openapi-generator version
I’ve tried with the 5.0.0
Details
The generated code compile with no issues, but once you tried to do the call you get an error saying there is no serializer for Uint8list
Suggest a fix
isPrimitiveType
should be true for Uint8list, like this they will be no usage of built_value as it’s not needed for Uint8list
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Flutter DIO: upload image using binary body with Dio package
Couldn't implement using the DIO plugin, I resolved the issue using the DART HTTP package, Below is a sample code.
Read more >Documentation for the dart-dio Generator
Generates a Dart Dio client library with null-safety. #CONFIG OPTIONS. These options may be applied as additional-properties (cli) or ...
Read more >10 things that are wrong with Flutter - Vladimir Ivanov Dev Blog
Dart is called a statically typed language. It also has this dynamic keyword which basically mean, not so statically. I know this depends...
Read more >Flutter Tutorials | Upload Image to Server using Dio | Dart
In this video, I'll show you how we can upload image to a server using API from our Flutter App. You might not...
Read more >[Solved]-Could not upload image with Dio-Flutter
This was definitely a problem from the backend because they were expecting the key to be file . Changed that and it all...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Look like this one is fixed too on master ^^ Thanks !
So
json.encode
probably has no effect for aUint8List
, well that works. I guess this was fixed with https://github.com/OpenAPITools/openapi-generator/pull/8367You can try the current master.