Skip to content

Commit

Permalink
Merge pull request #371 from dedoc/fix/post-document-generation-seria…
Browse files Browse the repository at this point in the history
…lization

Fixed routes serialization issue
  • Loading branch information
romalytvynenko committed May 15, 2024
2 parents 4efa098 + 673d6a0 commit fad3fb9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Scramble.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ public static function registerUiRoute(string $path, string $api = 'default'): R
{
$config = static::getGeneratorConfig($api);

return RouteFacade::get($path, function (Generator $generator) use ($config) {
return RouteFacade::get($path, function (Generator $generator) use ($api) {
$config = static::getGeneratorConfig($api);

return view('scramble::docs', [
'spec' => $generator($config),
'config' => $config,
Expand All @@ -102,7 +104,9 @@ public static function registerJsonSpecificationRoute(string $path, string $api
{
$config = static::getGeneratorConfig($api);

return RouteFacade::get($path, function (Generator $generator) use ($config) {
return RouteFacade::get($path, function (Generator $generator) use ($api) {
$config = static::getGeneratorConfig($api);

return response()->json($generator($config), options: JSON_PRETTY_PRINT);
})
->middleware($config->get('middleware', [RestrictedDocsAccess::class]));
Expand Down

0 comments on commit fad3fb9

Please sign in to comment.