apidoc.php 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <?php
  2. return [
  3. /*
  4. * The output path for the generated documentation.
  5. */
  6. 'output' => 'public/docs',
  7. /*
  8. * The router to be used (Laravel or Dingo).
  9. */
  10. 'router' => 'laravel',
  11. /*
  12. * Generate a Postman collection in addition to HTML docs.
  13. */
  14. 'postman' => [
  15. /*
  16. * Specify whether the Postman collection should be generated.
  17. */
  18. 'enabled' => true,
  19. /*
  20. * The name for the exported Postman collection. Default: config('APP_NAME')." API"
  21. */
  22. 'name' => null,
  23. /*
  24. * The description for the exported Postman collection.
  25. */
  26. 'description' => null,
  27. ],
  28. /*
  29. * The routes for which documentation should be generated.
  30. * Each group contains rules defining which routes should be included ('match', 'include' and 'exclude' sections)
  31. * and rules which should be applied to them ('apply' section).
  32. */
  33. 'routes' => [
  34. [
  35. /*
  36. * Specify conditions to determine what routes will be parsed in this group.
  37. * A route must fulfill ALL conditions to pass.
  38. */
  39. 'match' => [
  40. /*
  41. * Match only routes whose domains match this pattern (use * as a wildcard to match any characters).
  42. */
  43. 'domains' => [
  44. '*',
  45. // 'domain1.*',
  46. ],
  47. /*
  48. * Match only routes whose paths match this pattern (use * as a wildcard to match any characters).
  49. */
  50. 'prefixes' => [
  51. '*',
  52. // 'users/*',
  53. ],
  54. /*
  55. * Match only routes registered under this version. This option is ignored for Laravel router.
  56. * Note that wildcards are not supported.
  57. */
  58. 'versions' => [
  59. 'v1',
  60. ],
  61. ],
  62. /*
  63. * Include these routes when generating documentation,
  64. * even if they did not match the rules above.
  65. * Note that the route must be referenced by name here (wildcards are supported).
  66. */
  67. 'include' => [
  68. // 'users.index', 'healthcheck*'
  69. ],
  70. /*
  71. * Exclude these routes when generating documentation,
  72. * even if they matched the rules above.
  73. * Note that the route must be referenced by name here (wildcards are supported).
  74. */
  75. 'exclude' => [
  76. // 'users.create', 'admin.*'
  77. ],
  78. /*
  79. * Specify rules to be applied to all the routes in this group when generating documentation
  80. */
  81. 'apply' => [
  82. /*
  83. * Specify headers to be added to the example requests
  84. */
  85. 'headers' => [
  86. // 'Authorization' => 'Bearer {token}',
  87. // 'Api-Version' => 'v2',
  88. ],
  89. /*
  90. * If no @response or @transformer declarations are found for the route,
  91. * we'll try to get a sample response by attempting an API call.
  92. * Configure the settings for the API call here,
  93. */
  94. 'response_calls' => [
  95. /*
  96. * API calls will be made only for routes in this group matching these HTTP methods (GET, POST, etc).
  97. * List the methods here or use '*' to mean all methods. Leave empty to disable API calls.
  98. */
  99. 'methods' => ['GET'],
  100. /*
  101. * For URLs which have parameters (/users/{user}, /orders/{id?}),
  102. * specify what values the parameters should be replaced with.
  103. * Note that you must specify the full parameter, including curly brackets and question marks if any.
  104. */
  105. 'bindings' => [
  106. // '{user}' => 1
  107. ],
  108. /*
  109. * Environment variables which should be set for the API call.
  110. * This is a good place to ensure that notifications, emails
  111. * and other external services are not triggered during the documentation API calls
  112. */
  113. 'env' => [
  114. 'APP_ENV' => 'documentation',
  115. 'APP_DEBUG' => false,
  116. // 'env_var' => 'value',
  117. ],
  118. /*
  119. * Headers which should be sent with the API call.
  120. */
  121. 'headers' => [
  122. 'Content-Type' => 'application/json',
  123. 'Accept' => 'application/json',
  124. // 'key' => 'value',
  125. ],
  126. /*
  127. * Query parameters which should be sent with the API call.
  128. */
  129. 'query' => [
  130. // 'key' => 'value',
  131. ],
  132. /*
  133. * Body parameters which should be sent with the API call.
  134. */
  135. 'body' => [
  136. // 'key' => 'value',
  137. ],
  138. ],
  139. ],
  140. ],
  141. ],
  142. /*
  143. * Custom logo path. Will be copied during generate command. Set this to false to use the default logo.
  144. *
  145. * Change to an absolute path to use your custom logo. For example:
  146. * 'logo' => resource_path('views') . '/api/logo.png'
  147. *
  148. * If you want to use this, please be aware of the following rules:
  149. * - size: 230 x 52
  150. */
  151. 'logo' => false,
  152. /*
  153. * Configure how responses are transformed using @transformer and @transformerCollection
  154. * Requires league/fractal package: composer require league/fractal
  155. *
  156. * If you are using a custom serializer with league/fractal,
  157. * you can specify it here.
  158. *
  159. * Serializers included with league/fractal:
  160. * - \League\Fractal\Serializer\ArraySerializer::class
  161. * - \League\Fractal\Serializer\DataArraySerializer::class
  162. * - \League\Fractal\Serializer\JsonApiSerializer::class
  163. *
  164. * Leave as null to use no serializer or return a simple JSON.
  165. */
  166. 'fractal' => [
  167. 'serializer' => null,
  168. ],
  169. ];