mgechev / mgechev/swagger-typescript-fetch-api

retrieving binary data

Open
#2 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
33
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Hi,

How can I process binary Data using this typescript-fetch generation tool?

I saw in the code:
https://github.com/mgechev/swagger-typescript-fetch-api/blob/ae1c883e59858f40dae4e65971aca0125ea0db99/src/main/resources/typescript-fetch-api/api.mustache#L137
at .json - But sometimes the backend is returning binary data.
How to process there?

Did I miss something?

Here is my hopefully working swagger configuration:
/store/product/{id}/pic:
summary: Image
get:
parameters:
- in: path
required: true
name: id
schema:
type: number
tags:
- shop
responses:
200:
description: Alles ok
content:
image/png:
schema:
$ref: '#/components/schemas/BinaryPic'
components:
BinaryPic:
description: Binary Image file
type: string
format: binary

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/main/resources/typescript-fetch-api/api.mustache at the referenced .json handling around line 137, then compare it with the supplied image/png and format: binary Swagger configuration. Inspect the generated client for this response and define done as binary data being handled without forcing JSON parsing.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.