Skip to content

Commit

Permalink
Switch from ungrouped_name to default_group
Browse files Browse the repository at this point in the history
  • Loading branch information
shalvah committed Apr 28, 2019
1 parent 6d81690 commit 72b5f54
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
33 changes: 15 additions & 18 deletions config/apidoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

/*
* The output path for the generated documentation.
* This path should be relative to the root of your application.
*/
'output' => 'public/docs',

Expand Down Expand Up @@ -168,42 +169,38 @@
],

/*
* Custom logo path. Will be copied during generate command. Set this to false to use the default logo.
* Custom logo path. The logo will be copied from this location
* during the generate process. Set this to false to use the default logo.
*
* Change to an absolute path to use your custom logo. For example:
* 'logo' => resource_path('views') . '/api/logo.png'
*
* If you want to use this, please be aware of the following rules:
* - size: 230 x 52
* - the image size must be 230 x 52
*/
'logo' => false,

/*
* Name for the group of routes which do not have a @group set.
*/
'ungrouped_name' => 'general',
'default_group' => 'general',

/*
* Configure how responses are transformed using @transformer and @transformerCollection
* Requires league/fractal package: composer require league/fractal
*
* If you are using a custom serializer with league/fractal,
* you can specify it here.
*
* Serializers included with league/fractal:
* - \League\Fractal\Serializer\ArraySerializer::class
* - \League\Fractal\Serializer\DataArraySerializer::class
* - \League\Fractal\Serializer\JsonApiSerializer::class
*
* Leave as null to use no serializer or return a simple JSON.
*/
'fractal' => [
/* If you are using a custom serializer with league/fractal,
* you can specify it here.
*
* Serializers included with league/fractal:
* - \League\Fractal\Serializer\ArraySerializer::class
* - \League\Fractal\Serializer\DataArraySerializer::class
* - \League\Fractal\Serializer\JsonApiSerializer::class
*
* Leave as null to use no serializer or return a simple JSON.
*/
'serializer' => null,
],

/*
* If you would like the package to generate the same example values for parameters on each run,
* set this to any number (eg. 1234)
*/
'faker_seed' => null,

This comment has been minimized.

Copy link
@nanaya

nanaya May 23, 2019

accidentally removed?

This comment has been minimized.

Copy link
@shalvah

shalvah May 23, 2019

Author Contributor

Oooh shit.

This comment has been minimized.

Copy link
@shalvah

shalvah May 23, 2019

Author Contributor

This is why you should have tests.😕

This comment has been minimized.

Copy link
@shalvah

shalvah May 23, 2019

Author Contributor

Fixed

];
3 changes: 2 additions & 1 deletion src/Tools/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ protected function getRouteGroup(ReflectionClass $controller, ReflectionMethod $
}
}

return config('apidoc.ungrouped_name') ?: 'general';
// TODO: get rid of ungrouped_name in next major release
return config('apidoc.default_group', config('apidoc.ungrouped_name', 'general'));
}

private function normalizeParameterType($type)
Expand Down

0 comments on commit 72b5f54

Please sign in to comment.