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

invalid JSON schema with https?:// #300

Closed
fritzmg opened this issue Jan 2, 2017 · 5 comments
Closed

invalid JSON schema with https?:// #300

fritzmg opened this issue Jan 2, 2017 · 5 comments

Comments

@fritzmg
Copy link
Contributor

fritzmg commented Jan 2, 2017

As of version 0.16.4, the composer-client initializes the composer.json with the following information for the legacy repository:

{
    "type": "composer",
    "url": "https?://legacy-packages-via.contao-community-alliance.org",
    "allow_ssl_downgrade": false
}

(see also contao-community-alliance/composer-plugin#64)

However, with composer 1.3.0 this leads to the following error:

Fatal error: Uncaught exception Composer\Json\JsonValidationException with message "./composer.json" does not match the expected JSON schema thrown in phar://…/composer/composer.phar/src/Composer/Json/JsonFile.php on line 183

#0 phar://…/composer/composer.phar/src/Composer/Factory.php(287): Composer\Json\JsonFile->validateSchema(1)
#1 [internal function]: Composer\Factory->createComposer(Object(Composer\IO\BufferIO))
#2 phar://…/composer/composer.phar/src/Composer/Util/Silencer.php(67): call_user_func_array(Array, Array)
#3 system\modules\!composer\src\Runtime.php(585): Composer\Util\Silencer::call(Array, Object(Composer\IO\BufferIO))
#4 system\modules\!composer\src\ClientBackend.php(300): ContaoCommunityAlliance\Contao\Composer\Runtime::createComposer(Object(Composer\IO\BufferIO))
#5 system\modules\!composer\src\ClientBackend.php(125): ContaoCommunityAlliance\Contao\Composer\ClientBackend->loadComposer()
#6 system\modules\core\classes\Backend.php(423): ContaoCommunityAlliance\Contao\Composer\ClientBackend->generate()
#7 system\modules\core\controllers\BackendMain.php(131): Contao\Backend->getBackendModule('composer')
#8 contao\main.php(20): Contao\BackendMain->run()
#9 {main}

If you remove the ? from the URL, the fatal error will not occur anymore.

@fritzmg
Copy link
Contributor Author

fritzmg commented Jan 3, 2017

Can't these lines simply be removed?

        {
            "type": "composer",
            "url": "https?://legacy-packages-via.contao-community-alliance.org",
            "allow_ssl_downgrade": false
        },

The legacy repository is added by the composer-plugin anyway (see contao-community-alliance/composer-plugin#64), albeit in a different, but working version.

@discordier
Copy link
Member

You may safely remove these lines.
We will have to update the client to add them in the same format as the plugin.

@discordier discordier added this to the 0.16.5 milestone Jan 5, 2017
@fritzmg
Copy link
Contributor Author

fritzmg commented Jan 5, 2017

You may safely remove these lines.

Well, I meant remove them from the composer-client in Runtime.php#L84-L88.

@rflx
Copy link

rflx commented Jan 10, 2017

I'm also running into this issue while installing the composer-plugin on a fresh Contao 3.5.21 installation. Removing the mentioned lines above from composer.json and run a composer.phar update helped me out.

discordier added a commit that referenced this issue Jan 12, 2017
@discordier
Copy link
Member

Fixed in 3bab0ec

discordier added a commit that referenced this issue Jan 12, 2017
Bugfix release.

Fix #300 This restores compatibility with composer 1.3.
Our repository URL did not pass the schema check.

Fix #296 Always honor the "preferred-install" method.
discordier added a commit that referenced this issue Jan 12, 2017
Bugfix release.

Fix #300 This restores compatibility with composer 1.3.
Our repository URL did not pass the schema check.

Fix #296 Always honor the "preferred-install" method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants