static function check(Typed $object) { $mapping = new XmlMapping(); $rootName = $mapping->getRootName($object); $o = new \stdClass(); $o->{$rootName} = $object; $validator = new JsonSchemaValidator($object->getType()); return $validator->check($o); }
/** * @param string $schemaName e.g. "MobilePayment" for /json/MobilePayment.json or "sale" for /json/sale.json * @param Object $object the instance to validate against the json schema * @return mixed array containing errors or false */ static function validate($schemaName, $object) { $validator = new JsonSchemaValidator($schemaName); return $validator->check($object); }