clients generated with --enable-runtime-response-validation try to validate empty responses, such as a 204 as being undefined, eg: z.undefined().
unfortunately axios actually returns an empty string "" instead of undefined, and thus the runtime validation fails, whilst fetch chokes on SyntaxError: Unexpected end of JSON input when calling .json()
Workarounds
- For
axios we can workaround by using a response interceptor for axios that converts "" to undefined
- For
fetch we should simply not call json() if the status code is 204