public function validate(Json $json, Validator $validator, RefResolver $refResolver)
 {
     $schema = $refResolver->resolve('file://' . realpath($this->filename));
     $validator->check($json->getRawContent(), $schema);
     if (!$validator->isValid()) {
         $msg = "JSON does not validate. Violations:" . PHP_EOL;
         foreach ($validator->getErrors() as $error) {
             $msg .= sprintf("  - [%s] %s" . PHP_EOL, $error['property'], $error['message']);
         }
         throw new \Exception($msg);
     }
     return true;
 }
 public function validate(Json $json, Validator $validator)
 {
     if ($this->hasUri()) {
         $this->resolve(new RefResolver(new UriRetriever()));
     }
     $validator->check($json->getRawContent(), $this->getRawContent());
     if (!$validator->isValid()) {
         $msg = "JSON does not validate. Violations:" . PHP_EOL;
         foreach ($validator->getErrors() as $error) {
             $msg .= sprintf("  - [%s] %s" . PHP_EOL, $error['property'], $error['message']);
         }
         throw new \Exception($msg);
     }
     return true;
 }