apidoc.php 7.0 KB

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