src/Listener/SerializationSubscriber.php
public function onParameterPreDeserialize(PreDeserializeEvent $event)
    {
        $data = $event->getData();

        if (array_key_exists('$ref', $data)) {
            $event->setType(RefParameter::class);
            return;
        }

        $data['class'] = $data['in'];

        if (array_key_exists('type', $data)) {
            $data['class'] = sprintf('%s.%s', $data['in'], $data['type']);
        }

        $event->setData($data);
    }
public function onParameterPreDeserialize(PreDeserializeEvent $event)
    {
        $data = $event->getData();

        if (array_key_exists('$ref', $data)) {
            $event->setType(RefParameter::class);
            return;
        }

        $data['class'] = $data['in'];

        if (array_key_exists('type', $data)) {
            $data['class'] = sprintf('%s.%s', $data['in'], $data['type']);
        }

        $event->setData($data);
    }
public function onParameterPreDeserialize ( PreDeserializeEvent $ event ) { $ data = $ event -> getData ( ) ; if ( array_key_exists ( '$ref' , $ data ) ) { $ event -> setType ( RefParameter :: class ) ; return ; } $ data [ 'class' ] = $ data [ 'in' ] ; if ( array_key_exists ( 'type' , $ data ) ) { $ data [ 'class' ] = sprintf ( '%s.%s' , $ data [ 'in' ] , $ data [ 'type' ] ) ; } $ event -> setData ( $ data ) ; }
Set custom composite discriminator key based on multiple parameter fields
before deserialization to ensure proper discrimination mapping

@param PreDeserializeEvent $event
Set custom composite discriminator key based on multiple parameter fields before deserialization to ensure proper discrimination mapping