Description
Maybe this already exists and I don't find it but I'd have a POST route I'd like to return a respond with either a 200 or a 202 status code.
Currently this does not seems to be supported since the Operation::getStatusCode is a single integer.
Does it exists @soyuka ? Are you ok with such feature ?
What do you recommend for this ?
I'm not sure but if the status is coming for here
|
$status = $this->getStatus($request, $operation, $context); |
It could be easy to change here
|
$status = $operation->getStatus(); |
into
$status = $request->attributes('_api_response_status', $operation->getStatus());
Example
class MyProcessor
{
public function process()
{
if ($count > 25) {
$request->attributes->set('_api_response_status', 202);
$dispatcher->publish(...);
} else {
// default status will be 200
$service->execute(...);
}
return $output;
}
}
Description
Maybe this already exists and I don't find it but I'd have a POST route I'd like to return a respond with either a 200 or a 202 status code.
Currently this does not seems to be supported since the Operation::getStatusCode is a single integer.
Does it exists @soyuka ? Are you ok with such feature ?
What do you recommend for this ?
I'm not sure but if the status is coming for here
core/src/State/Processor/RespondProcessor.php
Line 64 in 61c6dee
It could be easy to change here
core/src/State/Util/HttpResponseStatusTrait.php
Line 40 in 61c6dee
into
Example