We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
The text was updated successfully, but these errors were encountered:
@weierophinney If you have a moment, please have a look to this. I think this would be helpful for others too.
Originally posted by @developer-devPHP at zfcampus/zf-api-problem#56 (comment)
Sorry, something went wrong.
Can someone have a look on this and tell me can this changes part of new version?
any updates @weierophinney ? If you want I can create this simple changes and did a pull request.
@developer-devPHP have you already prepare a PR for this ? It would be helpful here too
Originally posted by @NicolasCayet at zfcampus/zf-api-problem#56 (comment)
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: