Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External schema cannot be loaded #122

Open
mxr576 opened this issue Oct 27, 2022 · 0 comments
Open

External schema cannot be loaded #122

mxr576 opened this issue Oct 27, 2022 · 0 comments

Comments

@mxr576
Copy link

mxr576 commented Oct 27, 2022

I am following the official documentation but I have bumped into a fundamental issue at the first try

<?php
require "vendor/autoload.php";

use Opis\JsonSchema\{
    Validator,
    ValidationResult,
    Helper,
};

$validator = new Validator();

$result = $validator->validate('{}', 'https://github.com/raw/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://github.com/raw/OAI/OpenAPI-Specification/main/schemas/v3.0/schema.json#'
@mxr576 mxr576 changed the title External schema cannot be oaded External schema cannot be loaded Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant