Skip to content

Commit 5cb0915

Browse files
committed
SwaggerCommand with --yaml now properly serializes nested objects
1 parent b4e5c21 commit 5cb0915

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
6767
{
6868
$documentation = new Documentation($this->resourceNameCollectionFactory->create(), $this->apiTitle, $this->apiDescription, $this->apiVersion, $this->apiFormats);
6969
$data = $this->documentationNormalizer->normalize($documentation);
70-
$content = $input->getOption('yaml') ? Yaml::dump($data) : json_encode($data, JSON_PRETTY_PRINT);
70+
$content = $input->getOption('yaml') ? Yaml::dump($data, Yaml::DUMP_OBJECT_AS_MAP) : json_encode($data, JSON_PRETTY_PRINT);
7171

7272
if (!empty($input->getOption('output'))) {
7373
file_put_contents($input->getOption('output'), $content);

0 commit comments

Comments
 (0)