Route [l5-swagger.<name>.docs] not defined
andrey-helldar opened this issue · comments
- L5-Swagger Version: 8.5.2
- PHP Version: 8.3.3
- OS: Windows 11 Pro
Description:
If two or more documentation files are generated, only the last one is opened.
For example:
return [
'documentations' => [
'foo' => [], // works
],
];
return [
'documentations' => [
'foo' => [], // doesnt works
'bar' => [], // doesnt works
'baz' => [], // works
],
];
Steps To Reproduce:
- Add a new documentation type, change file names. The source of data for generation can be left unchanged.
- Execute the
php artisan l5-swagger:generate --all
console command. - See that the files have been successfully generated.
- Open the documentation URL and see that all but the last one return an error.
I found a crutch solution to the problem.
All you need to do is to add docs
and oauth2_callback
keys in the file configuration, specifying unique values.
For example:
return [
'documentations' => [
'foo' => [
// ...
'docs' => 'docs/foo',
'oauth2_callback' => 'api/foo/oauth2-callback',
],
'bar' => [
// ...
'docs' => 'docs/bar',
'oauth2_callback' => 'api/bar/oauth2-callback',
],
'baz' => [
// ...
'docs' => 'docs/bar',
'oauth2_callback' => 'api/bar/oauth2-callback',
],
],
];