Skip to content

Commit 9355063

Browse files
authored
add JSON_NUMERIC_CHECK to json encode options
linked to #3286 This allows encoding to make numeric data more true to its type (not enclose them with "", making the receiving system identify the types easier. Note making the options variable configurable might be handy in the future depending on the needs of the users people they interface with they might need additional options added here
1 parent 748ec9a commit 9355063

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

system/Format/JSONFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class JSONFormatter implements FormatterInterface
5656
*/
5757
public function format($data)
5858
{
59-
$options = JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PARTIAL_OUTPUT_ON_ERROR;
59+
$options = JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PARTIAL_OUTPUT_ON_ERROR | JSON_NUMERIC_CHECK;
6060

6161
$options = ENVIRONMENT === 'production' ? $options : $options | JSON_PRETTY_PRINT;
6262

0 commit comments

Comments
 (0)