},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
- "justinrainbow/json-schema": "~1.6",
+ "justinrainbow/json-schema": "~3.0",
"mediawiki/mediawiki-codesniffer": "0.7.2",
"monolog/monolog": "~1.18.2",
"nikic/php-parser": "1.4.1",
$this->addArg( 'path', 'Path to extension.json/skin.json file.', true );
}
public function execute() {
- if ( !class_exists( 'JsonSchema\Uri\UriRetriever' ) ) {
+ if ( !class_exists( 'JsonSchema\Validato' ) ) {
$this->error( 'The JsonSchema library cannot be found, please install it through composer.', 1 );
}
$this->output( "Warning: $path is using a deprecated schema, and should be updated to "
. ExtensionRegistry::MANIFEST_VERSION . "\n" );
}
- $retriever = new JsonSchema\Uri\UriRetriever();
- $schema = $retriever->retrieve( 'file://' . $schemaPath );
-
- $validator = new JsonSchema\Validator();
- $validator->check( $data, $schema );
+ $validator = new JsonSchema\Validator;
+ $validator->check( $data, (object) [ '$ref' => 'file://' . $schemaPath ] );
if ( $validator->isValid() ) {
$this->output( "$path validates against the version $version schema!\n" );
} else {
$version <= ExtensionRegistry::MANIFEST_VERSION,
"$path is using a non-supported schema version"
);
- $retriever = new JsonSchema\Uri\UriRetriever();
- $schema = $retriever->retrieve( 'file://' . $schemaPath );
- $validator = new JsonSchema\Validator();
- $validator->check( $data, $schema );
+ $validator = new JsonSchema\Validator;
+ $validator->check( $data, (object) [ '$ref' => 'file://' . $schemaPath ] );
if ( $validator->isValid() ) {
// All good.
$this->assertTrue( true );