Skip to content

Format OpenAPI response codes as strings #979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: v5
Choose a base branch
from

Conversation

poldixd
Copy link

@poldixd poldixd commented Apr 8, 2025

This is a smaller pull request derived from #908 .

More information can be found in issue/pull request #907 and #908.

@@ -142,7 +142,7 @@ public function generateOpenAPISpec(array $groupedEndpoints): string
/** @var OpenAPISpecWriter $writer */
$writer = app()->makeWith(OpenAPISpecWriter::class, ['config' => $this->config]);
$spec = $writer->generateSpecContent($groupedEndpoints);
return Yaml::dump($spec, 20, 2, Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE | Yaml::DUMP_OBJECT_AS_MAP);
return Yaml::dump($spec, 20, 2, Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE | Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_NUMERIC_KEY_AS_STRING);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, are we sure this doesn't break anything else? I'd much rather go the route of ensuring that the response status codes are actually strings, so they get dumped as strings without needing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants