apidoc.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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. * Laravel config 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
  112. * during the documentation API calls
  113. */
  114. 'config' => [
  115. 'app.env' => 'documentation',
  116. 'app.debug' => false,
  117. // 'service.key' => 'value',
  118. ],
  119. /*
  120. * Headers which should be sent with the API call.
  121. */
  122. 'headers' => [
  123. 'Content-Type' => 'application/json',
  124. 'Accept' => 'application/json',
  125. // 'key' => 'value',
  126. ],
  127. /*
  128. * Cookies which should be sent with the API call.
  129. */
  130. 'cookies' => [
  131. // 'name' => 'value'
  132. ],
  133. /*
  134. * Query parameters which should be sent with the API call.
  135. */
  136. 'query' => [
  137. // 'key' => 'value',
  138. ],
  139. /*
  140. * Body parameters which should be sent with the API call.
  141. */
  142. 'body' => [
  143. // 'key' => 'value',
  144. ],
  145. ],
  146. ],
  147. ],
  148. ],
  149. /*
  150. * Custom logo path. Will be copied during generate command. Set this to false to use the default logo.
  151. *
  152. * Change to an absolute path to use your custom logo. For example:
  153. * 'logo' => resource_path('views') . '/api/logo.png'
  154. *
  155. * If you want to use this, please be aware of the following rules:
  156. * - size: 230 x 52
  157. */
  158. 'logo' => false,
  159. /*
  160. * Name for the group of routes which do not have a @group set.
  161. */
  162. 'ungrouped_name' => 'general',
  163. /*
  164. * Configure how responses are transformed using @transformer and @transformerCollection
  165. * Requires league/fractal package: composer require league/fractal
  166. *
  167. * If you are using a custom serializer with league/fractal,
  168. * you can specify it here.
  169. *
  170. * Serializers included with league/fractal:
  171. * - \League\Fractal\Serializer\ArraySerializer::class
  172. * - \League\Fractal\Serializer\DataArraySerializer::class
  173. * - \League\Fractal\Serializer\JsonApiSerializer::class
  174. *
  175. * Leave as null to use no serializer or return a simple JSON.
  176. */
  177. 'fractal' => [
  178. 'serializer' => null,
  179. ],
  180. ];