You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Now that we have the correct schema to validate against,
459
+
// we will perform the actual validation either for all files in a folder, or for a single file
445
460
if (property_exists($validation, 'sourceFolder')) {
461
+
// If the 'sourceFolder' property is set, then we are validating a folder of i18n files
446
462
$files = glob($dataPath . '/*.json');
447
463
if (false === $files || empty($files)) {
448
464
$message = new \stdClass();
@@ -525,6 +541,7 @@ private function executeValidation(object $validation, ConnectionInterface $to)
525
541
$this->sendMessage($to, $message);
526
542
}
527
543
} else {
544
+
// If the 'sourceFolder' property is not set, then we are validating a single source file or API path
528
545
$matches = null;
529
546
if (preg_match("/^diocesan-calendar-([a-z]{6}_[a-z]{2})$/", $pathForSchema, $matches)) {
530
547
$dioceseId = $matches[1];
@@ -543,6 +560,8 @@ private function executeValidation(object $validation, ConnectionInterface $to)
543
560
]);
544
561
}
545
562
563
+
// If we are validating an API path, we check for a 200 OK HTTP response from the API
564
+
// rather than checking for existence of the file in the filesystem
546
565
if ($validation->category === 'resourceDataCheck') {
547
566
$headers = get_headers($dataPath);
548
567
if (!$headers || strpos($headers[0], '200') === false) {
@@ -563,11 +582,12 @@ private function executeValidation(object $validation, ConnectionInterface $to)
563
582
$message->text = "Unable to verify schema for dataPath {$dataPath} and category {$validation->category} since Data file $dataPath does not exist or is not readable";
0 commit comments