Skip to content

Commit

Permalink
Merge pull request #2121 from dkarlovi/swagger-yaml-dump-object
Browse files Browse the repository at this point in the history
fix #2115 SwaggerCommand with --yaml now properly serializes nested objects
  • Loading branch information
dunglas authored Sep 11, 2018
2 parents f07f251 + 5cb0915 commit b8bec07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Bridge/Symfony/Bundle/Command/SwaggerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b8bec07

Please sign in to comment.