What happened?
A method with an optional return value gets generated as method(…): Promise<T | null>. That's correct if the server returns a JSON result of null. If the server responds with a 204 instead, the return value is undefined as the runtime is currently implemented. An alternative would be to change the runtime to return null in the 204 case, but I believe the runtime is correct here since 204 means "no content", which I'd translate as "the return value is not defined".
What did you want to happen?
The correct definition encompassing both cases should be method(…): Promise<T | null | undefined>.
What happened?
A method with an optional return value gets generated as
method(…): Promise<T | null>. That's correct if the server returns a JSON result ofnull. If the server responds with a 204 instead, the return value isundefinedas the runtime is currently implemented. An alternative would be to change the runtime to returnnullin the 204 case, but I believe the runtime is correct here since 204 means "no content", which I'd translate as "the return value is not defined".What did you want to happen?
The correct definition encompassing both cases should be
method(…): Promise<T | null | undefined>.