From 73ef463f5ee1d50db9f01069c5a060a3d354888a Mon Sep 17 00:00:00 2001 From: Jonathan Sundqvist Date: Tue, 15 Dec 2015 19:16:01 +0000 Subject: [PATCH] An email is a string, not much else. --- src/JsonSchema/Constraints/TypeConstraint.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/JsonSchema/Constraints/TypeConstraint.php b/src/JsonSchema/Constraints/TypeConstraint.php index 504aff4c..837cfd8b 100644 --- a/src/JsonSchema/Constraints/TypeConstraint.php +++ b/src/JsonSchema/Constraints/TypeConstraint.php @@ -127,6 +127,10 @@ protected function validateType($value, $type) if ('string' === $type) { return is_string($value); } + + if ('email' === $type) { + return is_string($value); + } if ('null' === $type) { return is_null($value);