Skip to content
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

Format OpenAPI response codes as strings #908

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

twickstrom
Copy link

This pull request fixes #907

By making sure the the responses status code keys are formatted as a string

It also adds contact to the info section of the openapi.yaml file.
It also correctly injects the version into the info section (previously it was static 1.0.0).

'info' => [
    'title' => $this->config->get('title') ?: config('app.name', ''),
    'description' => $this->config->get('description', ''),
    'version' => config('app.version', ''),
    'contact' => [
        'name' => $this->config->get('contact.name', ''),
        'url' => $this->config->get('contact.url', ''),
        'email' => $this->config->get('contact.email', ''),
    ],
],

@shalvah shalvah changed the title Fixes knuckleswtf/scribe/issues#907 Format OpenAPI response codes as strings Nov 5, 2024
Copy link
Contributor

@shalvah shalvah left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! I can't accept the contact change, though, as any addition to the config file is an important change that should be considered separately. Please propose it in a separate PR. Better yet, open an issue to discuss it first, as I'm not likely to accept it, since this functionality is covered by the openapi.overrides config.

@@ -41,7 +41,12 @@ public function generateSpecContent(array $groupedEndpoints): array
'info' => [
'title' => $this->config->get('title') ?: config('app.name', ''),
'description' => $this->config->get('description', ''),
'version' => '1.0.0',
'version' => config('app.version', ''),
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not a standard Laravel config variable, is it?

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.

OpenAPI Response YAML file response status codes most be a string
2 participants