Skip to content

Commit 2b51e14

Browse files
committed
Fix 2285 - force Yaml::dump to dump empty array as actual empty array
1 parent c569c0f commit 2b51e14

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, 6, 4, Yaml::DUMP_OBJECT_AS_MAP) : json_encode($data, JSON_PRETTY_PRINT);
70+
$content = $input->getOption('yaml') ? Yaml::dump($data, 6, 4, Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE) : json_encode($data, JSON_PRETTY_PRINT);
7171
if (!empty($input->getOption('output'))) {
7272
file_put_contents($input->getOption('output'), $content);
7373
$output->writeln(

0 commit comments

Comments
 (0)