Skip to content

Commit 58da69e

Browse files
committed
Fix validation
1 parent 76a8ce7 commit 58da69e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## 0.4.1
4+
5+
* Make sure validation does not fail be setting an empty value if no body is present in the request
6+
37
## 0.4.0
48

59
* Complete rewrite of ZfrRest. All the concepts have been changed in favour of an explicit module, please read the

src/Mvc/Controller/Plugin/ValidateIncomingData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function __invoke($inputFilterName, array $validationGroup = [], $context
6262
$inputFilter->setValidationGroup($validationGroup);
6363
}
6464

65-
$data = json_decode($this->controller->getRequest()->getContent(), true);
65+
$data = json_decode($this->controller->getRequest()->getContent(), true) ?: [];
6666
$inputFilter->setData($data);
6767

6868
if ($inputFilter->isValid($context)) {

0 commit comments

Comments
 (0)