laravel-openapi
laravel-openapi copied to clipboard
No option to resolve custom collection.
Right now the package has the functionality to create multiple collections, but there is no option to serve them on multiple routes. Example:
/api/public/docs
/api/private/docs
Because OpenApiController does not receive a collection flag and uses a "default" one.
class OpenApiController
{
public function show(Generator $generator): OpenApi
{
return $generator->generate();
}
}
There should be a way to pass collection:
public function show(Generator $generator): OpenApi
{
return $generator->generate($collectionName);
}
Or it should take from config. I can help, but which way would be preferable? Or add a custom controller setting to the config?
Right now the package has the functionality to create multiple collections, but there is no option to serve them on multiple routes. Example:
/api/public/docs /api/private/docsBecause OpenApiController does not receive a collection flag and uses a "default" one.
class OpenApiController { public function show(Generator $generator): OpenApi { return $generator->generate(); } } There should be a way to pass collection:
public function show(Generator $generator): OpenApi { return $generator->generate($collectionName); }Or it should take from config. I can help, but which way would be preferable? Or add a custom controller setting to the config?
Unfortunately, it seems this package may have been abandoned, but I've put some notes together on how I've managed to use the Collections feature here in case anyone else stumbles upon this: https://github.com/vyuldashev/laravel-openapi/pull/118