jms / fos paramconverter - deserialize multiple objects from single payload

20 Views Asked by At

i'd like to use the fos / jms bodyconverter in symfony to deserialize two objects from one request payload:

{ "object_data_1": ..., "object_data_2" : ...}

and then capture like so:

#[ParamConverter('obj1', options: ['configure starting node here?'], converter: 'fos_rest.request_body')]
#[ParamConverter('obj2', options: ['configure starting node here?'], converter: 'fos_rest.request_body')]
public function controllerMethod(Obj1 $obj1, Obj2 $obj2) : Response
{...}

i cant find any documentation regarding this. does anyone know if this is possible, or if there is any smart way to do this?

0

There are 0 best solutions below