forked from koel/koel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapidoc.php
170 lines (152 loc) · 5.75 KB
/
apidoc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?php
return [
/*
* The output path for the generated documentation.
*/
'output' => 'api-docs',
/*
* The router to be used (Laravel or Dingo).
*/
'router' => 'laravel',
/*
* Generate a Postman collection in addition to HTML docs.
*/
'postman' => true,
/*
* The routes for which documentation should be generated.
* Each group contains rules defining which routes should be included ('match', 'include' and 'exclude' sections)
* and rules which should be applied to them ('apply' section).
*/
'routes' => [
[
'include' => [
'auth.login',
's3.*',
'song.play',
],
],
[
/*
* 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).
*/
'domains' => [
'*',
// 'domain1.*',
],
/*
* Match only routes whose paths match this pattern (use * as a wildcard to match any characters).
*/
'prefixes' => [
'*',
// 'users/*',
],
/*
* Match only routes registered under this version. This option is ignored for Laravel router.
* Note that wildcards are not supported.
*/
'versions' => [
'v1',
],
],
/*
* Include these routes when generating documentation,
* even if they did not match the rules above.
* Note that the route must be referenced by name here (wildcards are supported).
*/
'include' => [
// 'users.index', 'healthcheck*'
],
/*
* Exclude these routes when generating documentation,
* even if they matched the rules above.
* Note that the route must be referenced by name here (wildcards are supported).
*/
'exclude' => [
'broadcasting.auth',
'iTunes.viewSong',
'*.deprecated',
'auth.login',
's3.*',
'song.play',
'lastfm.*',
],
/*
* 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' => [
'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'],
/*
* For URLs which have parameters (/users/{user}, /orders/{id?}),
* specify what values the parameters should be replaced with.
* Note that you must specify the full parameter, including curly brackets and question marks if any.
*/
'bindings' => [
// '{user}' => 1
],
/*
* Environment 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
*/
'env' => [
'APP_ENV' => 'documentation',
'APP_DEBUG' => false,
// 'env_var' => 'value',
],
/*
* Headers which should be sent with the API call.
*/
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
// 'key' => 'value',
],
/*
* Query parameters which should be sent with the API call.
*/
'query' => [
// 'key' => 'value',
],
/*
* Body parameters which should be sent with the API call.
*/
'body' => [
// 'key' => 'value',
],
],
],
],
],
/*
* Custom logo path. Will be copied during generate command. 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
*/
'logo' => false,
];