We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 58b9b24 commit 39c391bCopy full SHA for 39c391b
1 file changed
packages/validation/src/Rules/IsJsonString.php
@@ -6,6 +6,9 @@
6
7
use Attribute;
8
use Tempest\Validation\Rule;
9
+use ValueError;
10
+
11
+use const JSON_INVALID_UTF8_IGNORE;
12
13
/**
14
* Validates that the value is a valid JSON string.
@@ -31,6 +34,10 @@ public function isValid(mixed $value): bool
31
34
}
32
35
33
36
if ($this->flags !== null) {
37
+ if ($this->flags !== JSON_INVALID_UTF8_IGNORE) {
38
+ throw new ValueError('Invalid JSON validation flags provided.');
39
+ }
40
41
$arguments['flags'] = $this->flags;
42
43
0 commit comments