Skip to content

Commit

Permalink
Merge pull request #2 from biigle/mzur-patch-1
Browse files Browse the repository at this point in the history
Fix schema path and strict flag forwarding
  • Loading branch information
mzur authored Apr 24, 2024
2 parents 3edfcdc + d1c52ca commit 531ba5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Ifdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static function fromFile($path, $strict = false): Ifdo

public static function fromString($data, $strict = false): Ifdo
{
return new Ifdo($data, true);
return new Ifdo($data, $strict);
}

public function __construct($json, $strict = false)
Expand Down Expand Up @@ -49,7 +49,7 @@ public function revalidate(): void
$this->validator = new \JsonSchema\Validator;
$version = $this->getIfdoVersion();
$decoded = json_decode($this->toString());
$this->validator->validate($decoded, (object) ['$ref' => 'file://' . realpath("assets/ifdo-$version.json")]);
$this->validator->validate($decoded, (object) ['$ref' => 'file://'.__DIR__."/../assets/ifdo-$version.json"]);

if ($this->getDebug() && ! empty($this->getErrors()))
{
Expand Down

0 comments on commit 531ba5a

Please sign in to comment.