Closed as not planned
Description
Description
Hi,
in #49518 i realized we have 2 ways of handling null
as a controller result
- json encode as null + http 200
- no content + http 204
i figured having a controller utility builtin creates better autocompletion due the use of $this->...
already
considering #49518, this allows doing:
#[Serialize(201)]
endpoint(): mixed {
if ($someSpecialCase) {
return $this->noContent(); // 204
}
return $someOtherSpecialCase ? ['data' => true] : null; // 201
}
Example
No response