Skip to content

Commit 3aead21

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 8e20159 commit 3aead21

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/JsonSchema/Constraints/TypeConstraint.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,6 @@ protected function validateType(&$value, $type)
206206
return is_string($value);
207207
}
208208

209-
if ('email' === $type) {
210-
return is_string($value);
211-
}
212-
213209
if ('null' === $type) {
214210
return is_null($value);
215211
}

0 commit comments

Comments
 (0)