acacode / acacode/swagger-typescript-api

No result from methods that do not have an explicit content type

オープン
#527 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
4.1k
フォーク
436
PR マージ指標
30日以内にマージされた PR はありません

説明

When generating an api from a spec that does not define the content, the generated code does not return anything.

IMO, since a result type is defined it should return a result.

e.g. from https://github.com/gothinkster/realworld/blob/main/api/openapi.yml

```
responses:
'200':
$ref: '#/components/responses/MultipleArticlesResponse'
```

will generate

```
this.request({
path: `/articles`,
method: "GET",
query: query,
...params,
}),
```

The problem is that this method will not return anything.

If I manually change the spec:

```
'200':
content:
application/json:
$ref: '#/components/responses/MultipleArticlesResponse'
```

I get the correct result with:

```
this.request({
path: `/articles`,
method: "GET",
query: query,
format: "json",
...params,
}),
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。