acacode / acacode/swagger-typescript-api
Doesn't evaluate response format type for every endpoint.
- 主要言語
- TypeScript
- スター
- 4.1k
- フォーク
- 436
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
It can evaluate format type to json for some endpoints and can't tell anything for some even though both was json.
So I decided to configure default format type as json from baseApiParams. And checked whether it can produce other format types correctly so rolling back to json format wouldn't be problem. However, it can't produce correct format type for application/text as I will demonstrate below.
I have an endpoint whose return type is application/text. And swagger-ui shows it as application/text correctly. But the file generated by swagger-typescript-api can't tell that this endpoint's format is "text".
Here is my endpoint;
```java
@GetMapping(value = "/configs", produces = "application/text")
public String listConfigs() {
return "some text";
}
```
And here is my swagger-ui output. It correctly displays the response format as application/text as seen below;

However, when I run the swagger-typescript-api command on this, resulting file contains the part below for the relevant endpoint;
```javascript
/**
* No description
*
* @tags functionality-web-service
* @name ListConfigsUsingGet
* @summary listConfigs
* @request GET:/functionality/configs
* @secure
*/
listConfigsUsingGet: (params: RequestParams = {}) =>
this.request({
path: `/functionality/configs`,
method: "GET",
secure: true,
...params,
})
```
I tried -r flag but it didn't change anything.
Is there any config I am probably missing? Thanks.
By the way I am using 9.1.2 but it's the same on 9.1.0 as well.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。