swagger-typescript-api
swagger-typescript-api copied to clipboard
Doesn't evaluate response format type for every endpoint.
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;
@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;
/**
* No description
*
* @tags functionality-web-service
* @name ListConfigsUsingGet
* @summary listConfigs
* @request GET:/functionality/configs
* @secure
*/
listConfigsUsingGet: (params: RequestParams = {}) =>
this.request<string, any>({
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.