-
Notifications
You must be signed in to change notification settings - Fork 2
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
Allow multiple package versions inside of the package repository #6
Comments
Here is a link on section about package repository in schema specification. "package": {
"oneOf": [
{ "$ref": "#/definitions/inline-package" },
{
"type": "array",
"items": { "$ref": "#/definitions/inline-package" }
}
]
} Specification says, it should be |
And one more note about the package repository: it is the only one type of repositories which doesn't have I think in v2 it will be good to revise |
I've removed |
Sorry for responding this late, I really got little time at the moment. |
The
"package"
key in apackage
repository may be set to an array to define multiple versions of a package: https://getcomposer.org/doc/05-repositories.md#package-2Here is a payload for the test:
As output I assumed to see repository with array of packages.
Personally I have never seen any project which defines repository packages in this way. Just keep in mind that these changes are breaking because
getPackage
returns?ComposerJson
right now, but may start to return an array of ComposerJson instances too. I don't really like it because return type becomes mixedComposerJson|ComposerJson[]|null
and will require additional checks in user application to determine what we have inside: is it array or one instance only.As possible solutions to prevent mixed return type I think it could return array even when there is only one package instance defined. To prevent introduction of breaking changes in v1 this feature could be delayed for the v2 version.
The text was updated successfully, but these errors were encountered: