In your current code ApiProblemResponse class have this constructor
public function __construct(ApiProblem $apiProblem)
{
$this->apiProblem = $apiProblem;
$this->setCustomStatusCode($apiProblem->status);
$this->setReasonPhrase($apiProblem->title);
$this->jsonFlags = JSON_UNESCAPED_SLASHES | JSON_PARTIAL_OUTPUT_ON_ERROR;
}
Could you please add one more property in jsonFlags JSON_FORCE_OBJECT
Like this
public function __construct(ApiProblem $apiProblem)
{
$this->apiProblem = $apiProblem;
$this->setCustomStatusCode($apiProblem->status);
$this->setReasonPhrase($apiProblem->title);
$this->jsonFlags = JSON_UNESCAPED_SLASHES | JSON_PARTIAL_OUTPUT_ON_ERROR | JSON_FORCE_OBJECT;
}
This will give api response to send non associated arrays keys for example during validation message generation, when keys are number and not string
like this
array(
3 =>'message1',
5 =>'message2',
7 =>'message3',
)
Originally posted by @developer-devPHP at zfcampus/zf-api-problem#56
In your current code ApiProblemResponse class have this constructor
Could you please add one more property in jsonFlags JSON_FORCE_OBJECT
Like this
This will give api response to send non associated arrays keys for example during validation message generation, when keys are number and not string
like this
Originally posted by @developer-devPHP at zfcampus/zf-api-problem#56