acacode / acacode/swagger-typescript-api

Throws on formatter JSON when 204 No Content

未關閉
#270 0 則留言 3 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
4.1k
分支
436
PR 合併指標
30 天內沒有已合併 PR

描述

In general it makes sense to always set your formatter to JSON as most of the methods are JSON responses.

The only exception that would make sense to generally skip the formating step would be if the http response is a 204 NO CONTENT. This makes sense basically in all `DELETE` HTTP calls and in some other scenarios.

This would also comply with the case that a HttpResponse type could be void, which in general in our swagger scenario is the case for DELETE. I am not 100% sure how the standard is, but I think in general if the swagger definition can define the Response Type as void and it still tries to format to JSON, it is clear that it will not work out.

https://github.com/acacode/swagger-typescript-api/blob/37efbb9e5deb5f60b680994ad908332033f03fa8/templates/base/http-clients/fetch-http-client.eta#L194

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。