123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- <?php
- return [
- /*
- * The type of documentation output to generate.
- * - "static" will generate a static HTMl page in the /public/docs folder,
- * - "laravel" will generate the documentation as a Blade view, so you can add routing and authentication.
- */
- 'type' => 'static',
- /*
- * Settings for `laravel` type output.
- */
- 'laravel' => [
- /*
- * Whether to automatically create a docs endpoint for you to view your generated docs.
- * If this is false, you can still set up routing manually.
- */
- 'add_routes' => true,
- /*
- * URL path to use for the docs endpoint (if `add_routes` is true).
- * By default, `/doc` opens the HTML page, and `/doc.json` downloads the Postman collection.
- */
- 'url' => '/doc',
- /*
- * Middleware to attach to the docs endpoint (if `add_routes` is true).
- */
- 'middleware' => [],
- ],
- /*
- * Example requests for each endpoint will be shown in each of these languages.
- * Supported options are: bash, javascript, php, python
- * You can add a language of your own, but you must publish the package's views
- * and define a corresponding view for it in the partials/example-requests directory.
- * See https://scribe.readthedocs.io/en/latest/generating-documentation.html
- *
- */
- 'example_languages' => [
- 'bash',
- 'javascript',
- ],
- /*
- * The base URL to be used in examples and the Postman collection.
- * By default, this will be the value of config('app.url').
- */
- 'base_url' => null,
- /*
- * Generate a Postman collection in addition to HTML docs.
- * For 'static' docs, the collection will be generated to public/docs/collection.json.
- * For 'laravel' docs, it will be generated to storage/app/scribe/collection.json.
- * Setting `laravel.autoload` to true (above) will add routes for both the HTML and the Postman collection.
- */
- 'postman' => [
- /*
- * Specify whether the Postman collection should be generated.
- */
- 'enabled' => true,
- /*
- * The name for the exported Postman collection. Default: config('app.name')." API"
- */
- 'name' => null,
- /*
- * The description for the exported Postman collection.
- */
- 'description' => null,
- /*
- * The "Auth" section that should appear in the postman collection. See the schema docs for more information:
- * https://schema.getpostman.com/json/collection/v2.0.0/docs/index.html
- */
- 'auth' => null,
- ],
- /*
- * Name for the group of routes which do not have a @group set.
- */
- 'default_group' => 'Endpoints',
- /*
- * Custom logo path. The will be used as the value of the src attribute for the <img> tag,
- * so make sure it points to a public URL or path accessible from your web server. For best results the image width should be 230px.
- * Set this to false to not use a logo.
- *
- * For example, if your logo is in public/img:
- * - 'logo' => '../img/logo.png' // for `static` type (output folder is public/docs)
- * - 'logo' => 'img/logo.png' // for `laravel` type
- *
- */
- 'logo' => false,
- /*
- * The router your API is using (Laravel or Dingo).
- */
- 'router' => 'laravel',
- /*
- * The routes for which documentation should be generated.
- * Each group contains rules defining which routes should be included ('match', 'include' and 'exclude' sections)
- * and settings which should be applied to them ('apply' section).
- */
- 'routes' => [
- [
- /*
- * Specify conditions to determine what routes will be parsed in this group.
- * A route must fulfill ALL conditions to pass.
- */
- 'match' => [
- /*
- * Match only routes whose domains match this pattern (use * as a wildcard to match any characters). Example: 'api.*'.
- */
- 'domains' => ['*'],
- /*
- * Match only routes whose paths match this pattern (use * as a wildcard to match any characters). Example: 'users/*'.
- */
- 'prefixes' => ['*'],
- /*
- * (Dingo router only) Match only routes registered under this version.
- * Note that wildcards are not supported.
- */
- 'versions' => ['v1'],
- ],
- /*
- * Include these routes when generating documentation, even if they did not match the rules above.
- * The route can be referenced by name or path here. Wildcards are supported.
- */
- 'include' => [
- // 'users.index', 'healthcheck*'
- ],
- /*
- * Exclude these routes when generating documentation, even if they matched the rules above.
- * The route can be referenced by name or path here. Wildcards are supported.
- */
- 'exclude' => [
- // '/health', 'admin.*'
- ],
- /*
- * Specify rules to be applied to all the routes in this group when generating documentation
- */
- 'apply' => [
- /*
- * Specify headers to be added to the example requests
- */
- 'headers' => [
- 'Content-Type' => 'application/json',
- 'Accept' => 'application/json',
- // 'Authorization' => 'Bearer {token}',
- // 'Api-Version' => 'v2',
- ],
- /*
- * If no @response or @transformer declarations are found for the route,
- * we'll try to get a sample response by attempting an API call.
- * Configure the settings for the API call here.
- */
- 'response_calls' => [
- /*
- * API calls will be made only for routes in this group matching these HTTP methods (GET, POST, etc).
- * List the methods here or use '*' to mean all methods. Leave empty to disable API calls.
- */
- 'methods' => ['GET'],
- /*
- * Laravel config variables which should be set for the API call.
- * This is a good place to ensure that notifications, emails
- * and other external services are not triggered
- * during the documentation API calls
- */
- 'config' => [
- 'app.env' => 'documentation',
- 'app.debug' => false,
- // 'service.key' => 'value',
- ],
- /*
- * Cookies which should be sent with the API call.
- */
- 'cookies' => [
- // 'name' => 'value'
- ],
- /*
- * Query parameters which should be sent with the API call.
- */
- 'queryParams' => [
- // 'key' => 'value',
- ],
- /*
- * Body parameters which should be sent with the API call.
- */
- 'bodyParams' => [
- // 'key' => 'value',
- ],
- ],
- ],
- ],
- ],
- /*
- * Configure how responses are transformed using @transformer and @transformerCollection (requires league/fractal package)
- */
- 'fractal' => [
- /* If you are using a custom serializer with league/fractal, you can specify it here.
- * Leave as null to use no serializer or return 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,
- 'strategies' => [
- 'metadata' => [
- \Knuckles\Scribe\Extracting\Strategies\Metadata\GetFromDocBlocks::class,
- ],
- 'urlParameters' => [
- \Knuckles\Scribe\Extracting\Strategies\UrlParameters\GetFromUrlParamTag::class,
- ],
- 'queryParameters' => [
- \Knuckles\Scribe\Extracting\Strategies\QueryParameters\GetFromQueryParamTag::class,
- ],
- 'headers' => [
- \Knuckles\Scribe\Extracting\Strategies\Headers\GetFromRouteRules::class,
- ],
- 'bodyParameters' => [
- \Knuckles\Scribe\Extracting\Strategies\BodyParameters\GetFromBodyParamTag::class,
- ],
- 'responses' => [
- \Knuckles\Scribe\Extracting\Strategies\Responses\UseTransformerTags::class,
- \Knuckles\Scribe\Extracting\Strategies\Responses\UseResponseTag::class,
- \Knuckles\Scribe\Extracting\Strategies\Responses\UseResponseFileTag::class,
- \Knuckles\Scribe\Extracting\Strategies\Responses\UseApiResourceTags::class,
- \Knuckles\Scribe\Extracting\Strategies\Responses\ResponseCalls::class,
- ],
- 'responseFields' => [
- \Knuckles\Scribe\Extracting\Strategies\ResponseFields\GetFromResponseFieldTag::class,
- ],
- ],
- /*
- * [Advanced usage] If you would like to customize how routes are matched beyond the route configuration you may
- * declare your own implementation of RouteMatcherInterface
- *
- */
- 'routeMatcher' => \Knuckles\Scribe\Matching\RouteMatcher::class,
- ];
|