openapi-typescript-fetch icon indicating copy to clipboard operation
openapi-typescript-fetch copied to clipboard

some 2xx codes considered error responses

Open mithodin opened this issue 3 years ago • 0 comments
trafficstars

OpErrorType consider only 200 and 201 as "successful" responses (see https://github.com/ajaishankar/openapi-typescript-fetch/blob/2e0d66e8e5c7ef74dd406c810b8b2b61f5f5ae1e/src/types.ts#L67), when according to the HTTP spec, all 2xx status codes signify success. This becomes a problem e.g. for a DELETE request, where a success usually returns status 204 (e.g. https://github.com/OAI/OpenAPI-Specification/blob/main/examples/v3.0/petstore-expanded.json#L158)

mithodin avatar Jun 02 '22 06:06 mithodin