Skip to content

Commit

Permalink
fix(openapi): yaml openapi export should have numeric keys as string (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
DartCZ authored Jun 27, 2024
1 parent c922ba3 commit af34e72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/OpenApi/Command/OpenApiCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
'spec_version' => $input->getOption('spec-version'),
]);
$content = $input->getOption('yaml')
? Yaml::dump($data, 10, 2, Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE | Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK)
? Yaml::dump($data, 10, 2, Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE | Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK | Yaml::DUMP_NUMERIC_KEY_AS_STRING)
: (json_encode($data, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES) ?: '');

$filename = $input->getOption('output');
Expand Down

0 comments on commit af34e72

Please sign in to comment.