Florianschmidtwelzow has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/305344

Change subject: Synchronize JsonSchema with mediawiki/core
......................................................................

Synchronize JsonSchema with mediawiki/core

See: Ie37e2ebc48684783abf8d99d2f775ee6a5988da7

Bug: T141281
Change-Id: Ib9dab5b8606b579c9ecf591965c607490759fc6f
---
M composer.json
M scripts/validate-schema.php
2 files changed, 3 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MediaWikiFarm 
refs/changes/44/305344/1

diff --git a/composer.json b/composer.json
index 7326a3a..8feeb8e 100644
--- a/composer.json
+++ b/composer.json
@@ -15,7 +15,7 @@
                "symfony/yaml": "^2.0 || ^3.0"
        },
        "require-dev": {
-               "justinrainbow/json-schema": "*",
+               "justinrainbow/json-schema": "~3.0",
                "phpdocumentor/phpdocumentor": "*",
                "jakub-onderka/php-parallel-lint": "*",
                "phpmd/phpmd": "*",
diff --git a/scripts/validate-schema.php b/scripts/validate-schema.php
index bf41119..8832e14 100644
--- a/scripts/validate-schema.php
+++ b/scripts/validate-schema.php
@@ -36,18 +36,10 @@
                $data = json_decode( $dataJSON );
        }
        
-       // Initialise objects
-       $resolver = new JsonSchema\Uri\UriResolver();
-       $retriever = new JsonSchema\Uri\UriRetriever();
-       
-       // If you use $ref or if you are unsure, resolve those references here
-       // This modifies the $schema object
-       $refResolver = new JsonSchema\RefResolver( $retriever, $resolver );
-       $schema = $refResolver->resolve( 'file://' . realpath( 
'docs/farms-schema.json' ) );
-       
        // Validate
        $validator = new JsonSchema\Validator();
-       $validator->check( $data, $schema );
+       $validator->check( $data, (object) array( '$ref' =>
+               'file://' . realpath( 'docs/farms-schema.json' ) ) );
        
        if( $validator->isValid() ) {
                echo "The supplied JSON validates against the schema.\n";

-- 
To view, visit https://gerrit.wikimedia.org/r/305344
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9dab5b8606b579c9ecf591965c607490759fc6f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MediaWikiFarm
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to