From 5cb0915f66793797414a5890aec8c0828cd973b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dalibor=20Karlovi=C4=87?= <dalibor.karlovic@flexolabs.io> Date: Mon, 23 Jul 2018 08:54:57 +0200 Subject: [PATCH] SwaggerCommand with --yaml now properly serializes nested objects --- src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php b/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php index c2de9c74814..2373d089ee7 100644 --- a/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php +++ b/src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php @@ -67,7 +67,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { $documentation = new Documentation($this->resourceNameCollectionFactory->create(), $this->apiTitle, $this->apiDescription, $this->apiVersion, $this->apiFormats); $data = $this->documentationNormalizer->normalize($documentation); - $content = $input->getOption('yaml') ? Yaml::dump($data) : json_encode($data, JSON_PRETTY_PRINT); + $content = $input->getOption('yaml') ? Yaml::dump($data, Yaml::DUMP_OBJECT_AS_MAP) : json_encode($data, JSON_PRETTY_PRINT); if (!empty($input->getOption('output'))) { file_put_contents($input->getOption('output'), $content);