Skip to content

Commit

Permalink
Revert "An email is a string, not much else." (#373)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
erayd authored and bighappyface committed Mar 17, 2017
1 parent 14a04dc commit 5de03d4
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/JsonSchema/Constraints/TypeConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,6 @@ protected function validateType(&$value, $type)
return is_string($value);
}

if ('email' === $type) {
return is_string($value);
}

if ('null' === $type) {
return is_null($value);
}
Expand Down

0 comments on commit 5de03d4

Please sign in to comment.