1
0
Fork 0

Workaround for json schema bug, fixes #2726

pull/2728/merge
Jordi Boggiano 2014-02-19 17:21:54 +01:00
parent 17ff267505
commit 41afc8324e
1 changed files with 3 additions and 1 deletions

View File

@ -13,6 +13,7 @@
namespace Composer\Json;
use JsonSchema\Validator;
use JsonSchema\Uri\UriRetriever;
use Seld\JsonLint\JsonParser;
use Seld\JsonLint\ParsingException;
use Composer\Util\RemoteFilesystem;
@ -153,7 +154,8 @@ class JsonFile
$schemaData = json_decode(file_get_contents($schemaFile));
if ($schema === self::LAX_SCHEMA) {
$schemaData->additionalProperties = true;
// TODO this should just be set to true, but this is a workaround for https://github.com/justinrainbow/json-schema/pull/94
$schemaData->additionalProperties = (object) array('type' => array('object', 'string', 'array', 'number', 'null', 'boolean'));
$schemaData->properties->name->required = false;
$schemaData->properties->description->required = false;
}