acacode / acacode/swagger-typescript-api

Doesn't evaluate response format type for every endpoint.

Đang mở
#274 0 bình luận 2 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
4.1k
Fork
436
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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;
![image](https://user-images.githubusercontent.com/15721059/122916308-68e61980-d365-11eb-9aee-6bdbfec1111f.png)

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.