Skip to content

Commit 922d423

Browse files
committed
Revert "An email is a string, not much else." (jsonrainbow#373)
This reverts commit 73ef463. 'email' is only a valid type attribute in draft-03 (later versions of the spec explicitly limit the value of type to the core primitive types), and this code doesn't validate email addresses anyway. IMO we should be validating it properly or not at all, and noting this went away after draft-03 my opinion is on the not-at-all side of the fence. Note that 'email' is *never* defined as a spec type, in any version - it just slips in under the radar of the draft-03 language which allows users to put arbitrary things in the type field.
1 parent 4c11c17 commit 922d423

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/JsonSchema/Constraints/TypeConstraint.php

-4
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,6 @@ protected function validateType(&$value, $type)
203203
return is_string($value);
204204
}
205205

206-
if ('email' === $type) {
207-
return is_string($value);
208-
}
209-
210206
if ('null' === $type) {
211207
return is_null($value);
212208
}

0 commit comments

Comments
 (0)