Skip to content

Commit b8bec07

Browse files
authored
Merge pull request #2121 from dkarlovi/swagger-yaml-dump-object
fix #2115 SwaggerCommand with --yaml now properly serializes nested objects
2 parents f07f251 + 5cb0915 commit b8bec07

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)