Skip to content

Commit

Permalink
SwaggerCommand with --yaml now properly serializes nested objects
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarlovi committed Jul 23, 2018
1 parent b4e5c21 commit 5cb0915
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 5cb0915

Please sign in to comment.