Coder Social home page Coder Social logo

Comments (4)

lhapaipai avatar lhapaipai commented on June 4, 2024

it seems that it works if you use Symfony serialiser

# config/packages/messenger
framework:
    messenger:
        serializer:
            symfony_serializer:
                format: json

        transports:
            async:
                dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
                serializer: messenger.transport.symfony_serializer

from api-platform.

devnix avatar devnix commented on June 4, 2024

I've had this problem, take a look at symfony/symfony-docs#17636 (comment)

from api-platform.

MariusJam avatar MariusJam commented on June 4, 2024

Hi,

I'm having the same problem here. It happens when your framework.yaml contains the following:

framework:
    # Enables session support. Note that the session will ONLY be started if you read or write from it.
    # Remove or comment this section to explicitly disable session support.
    session:
        handler_id: null
        cookie_secure: auto
        cookie_samesite: lax
        storage_factory_id: session.storage.factory.native

If you comment these lines (and correctly configure your api-platform routes as stateless), the issue is fixed.

However, this is not possible every time as you might need this specific configuration in framework.yaml if your app also have some routes that are not stateless.

I've discussed a bit the point on Symfony's support channel on Slack and the original problem is that Symfony does not guarantee that the Request object is serializable. So passing it into an envelope seems problematic in itself. I guess a fix should be made Api-Platform side to ensure the envelope's content is serializable. Removing the Request from the $context before passing it to the envelope seems to be the good way to achieve but this might be a breaking change...

from api-platform.

lhapaipai avatar lhapaipai commented on June 4, 2024

Removing the Request from the $context before passing it to the envelope seems to be the good way to achieve but this might be a breaking change...

I totally agree...

from api-platform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.