Closed
Description
I ran into this issue for an api call that may return 204.
If i check the returned data i expect it to be null
const { data } = await client.GET("/api/route/204");
if (data === null) {
// do something
}
const { field} = data;
But this library explicitly sets the data to be an empty object?!
openapi-typescript/packages/openapi-fetch/src/index.js
Lines 156 to 160 in 2a4b067
Is there a reason for this?
This also breaks the type system, because it expects data to be the full object, null or undefined but not {}.
Metadata
Metadata
Assignees
Labels
No labels