acacode / acacode/swagger-typescript-api
Throws on formatter JSON when 204 No Content
- Lenguaje dominante
- TypeScript
- Estrellas
- 4.1k
- Forks
- 436
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.