You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-2Lines changed: 15 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -188,7 +188,7 @@ class UserController extends Controller
188
188
### Specifying request parameters
189
189
190
190
To specify a list of valid parameters your API route accepts, use the `@bodyParam` and `@queryParam` annotations.
191
-
- The `@bodyParam` annotation takes the name of the parameter, its type, an optional "required" label, and then its description.
191
+
- The `@bodyParam` annotation takes the name of the parameter, its type, an optional "required" label, and then its description.
192
192
- The `@queryParam` annotation takes the name of the parameter, an optional "required" label, and then its description
193
193
194
194
@@ -222,6 +222,19 @@ They will be included in the generated documentation text and example requests.
222
222
223
223

224
224
225
+
Note: a random value will be used as the value of each parameter in the example requests. If you'd like to specify an example value, you can do so by adding `Example: your-example` to the end of your description. For instance:
226
+
227
+
```php
228
+
/**
229
+
* @queryParam location_id required The id of the location.
230
+
* @queryParam user_id required The id of the user. Example: me
231
+
* @queryParam page required The page number. Example: 4
232
+
* @bodyParam user_id int required The id of the user. Example: 9
233
+
* @bodyParam room_id string The id of the room.
234
+
* @bodyParam forever boolean Whether to ban the user forever. Example: false
235
+
*/
236
+
```
237
+
225
238
### Indicating auth status
226
239
You can use the `@authenticated` annotation on a method to indicate if the endpoint is authenticated. A "Requires authentication" badge will be added to that route in the generated documentation.
227
240
@@ -299,7 +312,7 @@ If you don't specify an example response using any of the above means, this pack
299
312
- By default, response calls are only made for GET routes, but you can configure this. Set the `methods` key to an array of methods or '*' to mean all methods. Leave it as an empty array to turn off response calls for that route group.
300
313
- Parameters in URLs (example: `/users/{user}`, `/orders/{id?}`) will be replaced with '1' by default. You can configure this, however.Put the parameter names (including curly braces and question marks) as the keys and their replacements as the values in the `bindings` key.
301
314
- You can configure environment variables (this is useful so you can prevent external services like notifications from being triggered). By default the APP_ENV is set to 'documentation'. You can add more variables in the `env` key.
302
-
- By default, the package will generate dummy values for your documented body and query parameters and send in the request. You can configure what headers and additional query and parameters should be sent when making the request (the `headers`, `query`, and `body` keys respectively).
315
+
- By default, the package will generate dummy values for your documented body and query parameters and send in the request. (If you specified example values using `@bodyParam` or `@queryParam`, those will be used instead.) You can configure what headers and additional query and parameters should be sent when making the request (the `headers`, `query`, and `body` keys respectively).
0 commit comments