Skip to content

Commit

Permalink
fixed serialization issue (maybe)
Browse files Browse the repository at this point in the history
  • Loading branch information
romalytvynenko committed May 15, 2024
1 parent 4efa098 commit 673d6a0
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 673d6a0

Please sign in to comment.