We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
4.38
8.3.12
Laravel
11.29
title => "The Fabric API" base_url => "http://127.0.0.1:8000" type => "external_static" theme => "scalar" static.output_path => "storage/scribe/docs" laravel.add_routes => false auth.enabled => true auth.default => true auth.name => "Authorization" logo => "https://assets.whatsfabric.com/images/fabric-red-horizontal.svg" strategies.queryParameters => added App\Docs\Strategies\QueryParameters\AddJsonApiQueryParameters
My openapi.yaml file is failing validation and is not able to be used by some third party tools for easier front end developement.
openapi.yaml
OpenAPI can be represented canonically in either JSON or YAML, as you say in JSON only strings can be keys. With regard to YAML: This field MUST be enclosed in quotation marks (for example, "200") for compatibility between JSON and YAML. This has the effect that the key is always a string type.
OpenAPI can be represented canonically in either JSON or YAML, as you say in JSON only strings can be keys. With regard to YAML:
This field MUST be enclosed in quotation marks (for example, "200") for compatibility between JSON and YAML.
This has the effect that the key is always a string type.
See OAI/OpenAPI-Specification#1752
The good news is this is a very easy fix.
Knuckles\Scribe\Writing\Writer:27
Current: 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);
New: return Yaml::dump($spec, 20, 2, Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE | Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_NUMERIC_KEY_AS_STRING);
return Yaml::dump($spec, 20, 2, Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE | Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_NUMERIC_KEY_AS_STRING);
I would also recommend allowing OAS contact info to be added optionally: config\scribe.php
config\scribe.php
'contact' => [ 'name' => 'Company Name', 'url' => 'URL', 'email' => 'EMAIL', ],
Knuckles\Scribe\Writing\OpenAPISpecWriter Current:
Knuckles\Scribe\Writing\OpenAPISpecWriter
'info' => [ 'title' => $this->config->get('title') ?: config('app.name', ''), 'description' => $this->config->get('description', ''), 'version' => '1.0.0', ],
New:
'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', ''), ], ],
The text was updated successfully, but these errors were encountered:
PR submitted #908
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Scribe version
4.38
PHP version
8.3.12
Framework
Laravel
Framework version
11.29
Scribe config
What happened?
My
openapi.yaml
file is failing validation and is not able to be used by some third party tools for easier front end developement.See OAI/OpenAPI-Specification#1752
The good news is this is a very easy fix.
Knuckles\Scribe\Writing\Writer:27
Current:
return Yaml::dump($spec, 20, 2, Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE | Yaml::DUMP_OBJECT_AS_MAP);
New:
return Yaml::dump($spec, 20, 2, Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE | Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_NUMERIC_KEY_AS_STRING);
I would also recommend allowing OAS contact info to be added optionally:
config\scribe.php
Knuckles\Scribe\Writing\OpenAPISpecWriter
Current:
New:
Docs
The text was updated successfully, but these errors were encountered: