nilportugues / symfony-jsonapi

JSON API Transformer Bundle for Symfony 2 and Symfony 3
http://nilportugues.com
MIT License
115 stars 19 forks source link

Serializer fails because of old nilportugues/php-serializer dependency #33

Closed chmielot closed 7 years ago

chmielot commented 7 years ago

Hi,

while trying to serialize an object I ran into an issue that was fixed already here: https://github.com/nilportugues/php-serializer/commit/8489eabb7c67a2ef8507f8af22238c135ee9bf3c

This is because symfony-jsonapi relies on "nilportugues/json-api": "^2.4"

which relies on "nilportugues/api-transformer": "^3.0.0"

which relies on "nilportugues/serializer": "~1.1"

I installed the package about 2 days ago. According to https://getcomposer.org/doc/articles/versions.md#tilde version 1.2 of serializer should have been installed, but it wasn't. Instead I have this in my composer.lock file (excerpt): snip snip

{
            "name": "nilportugues/serializer",
            "version": "1.1.5",
            "source": {
                "type": "git",
                "url": "https://github.com/nilportugues/serializer.git",
                "reference": "82ede04c687336aaec5f1c58f3ec986626b05810"
            },
},
{
            "name": "nilportugues/api-transformer",
            "version": "3.0.0",
            "source": {
                "type": "git",
                "url": "https://github.com/nilportugues/php-api-transformer.git",
                "reference": "4e2743527b7deb7af5b4ef55f2ca33146e9fab65"
            },
},
{
            "name": "nilportugues/json-api",
            "version": "2.4.4",
            "source": {
                "type": "git",
                "url": "https://github.com/nilportugues/php-json-api.git",
                "reference": "87d5898dee49670df8c67c81014db3c31cf94202"
            },
},
{
            "name": "nilportugues/jsonapi-bundle",
            "version": "1.5.2",
            "source": {
                "type": "git",
                "url": "https://github.com/nilportugues/symfony-jsonapi.git",
                "reference": "c4bbdfec0bb0b402aa0057fd32d1225447988460"
            },
}

Any idea what's wrong with the dependencies?

chmielot commented 7 years ago

I'm using your bundle together with Symfony 3. The problem was related to the platform requirements. I added the current serializer version explicitly to my composer.json and got the following error:

 Problem 1
    - Installation request for nilportugues/serializer ^1.2 -> satisfiable by nilportugues/serializer[1.2.0].
    - nilportugues/serializer 1.2.0 requires php >=5.6.0 -> your PHP version (7.1.1) overridden by "config.platform.php" version (5.5.9) does not satisfy that requirement.

In my particular use case it's ok to run composer with --ignore-platform-reqs, it works correctly then.

nilportugues commented 7 years ago

I will dig into it, I don't want people using the --ignore-platform-reqs

nilportugues commented 7 years ago

Fixed on the underlying library