Skip to content

Commit

Permalink
Part of jsonrainbow#62: support relative schema paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Weiske committed Sep 10, 2013
1 parent dc89a61 commit 11ae6e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/validate-json
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ if ($pathSchema === null) {
exit(6);
}
$pathSchema = $data->{'$schema'};
if ($pathSchema{0} != '/') {
$pathSchema = dirname($pathData) . '/' . $pathSchema;
}
}
if (!is_readable($pathSchema)) {
echo "Schema file is not readable.\n";
echo "Schema file '$pathSchema' is not readable.\n";
exit(2);
}

Expand Down

0 comments on commit 11ae6e2

Please sign in to comment.