<?php
require "vendor/autoload.php";
use Opis\JsonSchema\{
Validator,
ValidationResult,
Helper,
};
$validator = new Validator();
$result = $validator->validate('{}', 'https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.0/schema.json');
if ($result->isValid()) {
echo 'valid';
}
// Checking if there is an error
if ($result->hasError()) {
// Get the error
echo $result->error();
}
Unexpected result:
RuntimeException with message 'Schema not found: https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.0/schema.json#'
I am following the official documentation but I have bumped into a fundamental issue at the first try
Unexpected result: