Skip to content

Commit 30ee3e0

Browse files
authored
Merge pull request #63 from RusiPapazov/patch-1
Add JSON_PRESERVE_ZERO_FRACTION flag
2 parents 5402137 + 528e880 commit 30ee3e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Codeception/Module/REST.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ protected function execute($method, $url, $parameters = [], $files = [])
663663
$this->debugSection("Request", "$method $url");
664664
$files = [];
665665
} else {
666-
$this->debugSection("Request", "$method $url " . json_encode($parameters));
666+
$this->debugSection("Request", "$method $url " . json_encode($parameters, JSON_PRESERVE_ZERO_FRACTION));
667667
$files = $this->formatFilesArray($files);
668668
}
669669
$this->response = (string)$this->connectionModule->_request($method, $url, $parameters, $files);
@@ -721,11 +721,11 @@ protected function encodeApplicationJson($method, $parameters)
721721
)
722722
) {
723723
if ($parameters instanceof \JsonSerializable) {
724-
return json_encode($parameters);
724+
return json_encode($parameters, JSON_PRESERVE_ZERO_FRACTION);
725725
}
726726
if (is_array($parameters) || $parameters instanceof \ArrayAccess) {
727727
$parameters = $this->scalarizeArray($parameters);
728-
return json_encode($parameters);
728+
return json_encode($parameters, JSON_PRESERVE_ZERO_FRACTION);
729729
}
730730
}
731731

0 commit comments

Comments
 (0)