protected function toArray($data, $type, $format)
    {

        // load the serializer builde
        $serializer = SerializerBuilder::create()->build();

        // deserialize the data, convert it into an array and return it
        return $serializer->toArray($serializer->deserialize($data, $type, $format));
    }