We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'd like to consume endpoint that generates .pdf file. This is OpenAPI schema for such endpoint:
"/api/transfers/export.pdf": { "get": { "operationId": "exportPdf", "summary": "", "parameters": [ { "name": "filter", "required": false, "in": "query", "style": "deepObject", "explode": true, "schema": { "$ref": "#/components/schemas/ExportTransfersFilters" } } ], "responses": { "200": { "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } } }, "description": "" } }, "tags": [ "Transfers" ], "security": [ { "oauth2": [ ] } ] } },
Currently swagger_parser generates such method:
@GET('/api/transfers/export.pdf') Future<String> exportPdf({ @Query('filter') ExportTransfersFilters? filter, });
which in turn generates Dio.fetch call with ResponseType == ResponseType.json. In case of PDF, this yields corrupted file.
ResponseType == ResponseType.json
Such Retrofit definition will generate correct Dio.fetch call:
@GET('/api/transfers/export.pdf') @DioResponseType(ResponseType.bytes) Future<HttpResponse> exportPdf({ @Query('filter') ExportTransfersFilters? filter, });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Use case
I'd like to consume endpoint that generates .pdf file. This is OpenAPI schema for such endpoint:
Currently swagger_parser generates such method:
which in turn generates Dio.fetch call with
ResponseType == ResponseType.json
. In case of PDF, this yields corrupted file.Proposal
Such Retrofit definition will generate correct Dio.fetch call:
The text was updated successfully, but these errors were encountered: