Seb35 has submitted this change and it was merged. 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(-) Approvals: Seb35: Verified; Looks good to me, approved 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: merged Gerrit-Change-Id: Ib9dab5b8606b579c9ecf591965c607490759fc6f Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/MediaWikiFarm Gerrit-Branch: master Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com> Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com> Gerrit-Reviewer: Seb35 <seb35wikipe...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits