204 response types are not exposed in the generated API, even if they are in the OpenAPI schema. This is surprising as 4xx errors are clearly exposed - at minimum it'd be good for the generated client to give some indication to users that they should handle 204 as a possible response type.
Also a 204 without content is handled a bit ungracefully - we get an AxiosError: maxContentLength size of -1 exceeded error - (actually this might be an Axios bug - https://github.com/axios/axios/issues/5286 )
This might be a showstopper for us - we have quite a few existing services that return 204 responses, rightly or wrongly!
So possibly the only fix might be to add this to the README to save people time who have this need. (and we will try typed-openapi and an alternative fetcher )
Expected behavior
A client which might return 204 would return an .optional() schema so it was clear to developers that they need to handle 204 responses (though we'd also need a way to identify that the response was not a 200)
(also this might not work still due to https://github.com/axios/axios/issues/5286 )
204 response types are not exposed in the generated API, even if they are in the OpenAPI schema. This is surprising as 4xx errors are clearly exposed - at minimum it'd be good for the generated client to give some indication to users that they should handle 204 as a possible response type.
Also a 204 without content is handled a bit ungracefully - we get an
AxiosError: maxContentLength size of -1 exceeded
error - (actually this might be an Axios bug - https://github.com/axios/axios/issues/5286 )UPDATE: half way through writing this I found https://github.com/ecyrbe/zodios/issues/307 marked as 'wontfix' :(
This might be a showstopper for us - we have quite a few existing services that return 204 responses, rightly or wrongly!
So possibly the only fix might be to add this to the README to save people time who have this need. (and we will try typed-openapi and an alternative fetcher )
Minimal reproduction
Expected behavior A client which might return 204 would return an
.optional()
schema so it was clear to developers that they need to handle 204 responses (though we'd also need a way to identify that the response was not a 200) (also this might not work still due to https://github.com/axios/axios/issues/5286 )