diff --git a/src/Api/Serializer/MailDriverSerializer.php b/src/Api/Serializer/MailDriverSerializer.php index 6cdbad75c..03a23dcfe 100644 --- a/src/Api/Serializer/MailDriverSerializer.php +++ b/src/Api/Serializer/MailDriverSerializer.php @@ -33,10 +33,20 @@ class MailDriverSerializer extends AbstractSerializer ); } - $driver = $driver['driver']; + $settings = $driver['driver']->availableSettings(); + + if (key($settings) === 0) { + // BACKWARDS COMPATIBILITY: Support a simple list of fields (without + // type or additional metadata). + // Turns ["f1", "f2"] into {"f1": "", "f2": ""} + // @deprecated since 0.1.0-beta.12 + $settings = array_reduce($settings, function ($memo, $key) { + return [$key => ''] + $memo; + }, []); + } return [ - 'fields' => $driver->availableSettings(), + 'fields' => $settings, ]; }