4 ms·
Completely agree on the axios part - one implication of that is you can't statically type the error response shapes (since exceptions can't be typed). Where as
by mnahkies 5mo ago
Completely agree on the axios part - one implication of that is you can't statically type the error response shapes (since exceptions can't be typed). Where as with fetch you can have a discriminated union based on the status code (eg: https://github.com/mnahkies/openapi-code-generator/blob/main/integration-tests%2Ftypescript-fetch%2Fsrc%2Fgenerated%2Ftodo-lists.yaml%2Fclient.ts#L196-L198 https://github.com/mnahkies/openapi-code-generator/blob/main...)
Although I do feel like I've seen too many instances of a 404 being used for an empty collection where it would make more sense to return `[]` and treat it as an expected (successful) state.
- deleted 5mo ago[deleted]