public function assert($input)
{
$hasReference = $this->hasReference($input);
if ($this->mandatory && !$hasReference) {
throw $this->reportError($input, ['hasReference' => false]);
}
try {
return $this->decision('assert', $hasReference, $input);
} catch (ValidationException $e) {
throw $this->reportError($this->reference, ['hasReference' => true])->addRelated($e);
}
}