瀏覽代碼

Document FormRequests

shalvah 5 年之前
父節點
當前提交
ff18ff9223
共有 2 個文件被更改,包括 4 次插入5 次删除
  1. 4 5
      docs/documenting-endpoint-body-parameters.md
  2. 二進制
      docs/images/endpoint-bodyparams-3.png

+ 4 - 5
docs/documenting-endpoint-body-parameters.md

@@ -102,23 +102,22 @@ If you're using Laravel or Dingo FormRequests in your controller method, Scribe
 - `image`
 - `in`
 
-Custom rules are not supported.
+Custom rules are not supported. Scribe will ignore any rules it does not support.
 
 For each parameter in `rules()` it encounters, Scribe will:
 - generate an example value that passes all the supported rules. Note that if you have rules that are not supported, the generated value might not pass them. You can get around that by specifying an example in the `bodyParameters()` method.
-- generate a description that combines the validation rules with any description you specify in `bodyParameters()` 
+- generate a description that combines the supported validation rules with any description you specify in `bodyParameters()` 
 
 Here's an example:
 
 ```php
-
 class CreatePostRequest extends FormRequest
 {
     public function rules()
     {
         return [
-            'content' => 'string|required',
-            'title' => 'string|required',
+            'content' => 'string|required|min:100',
+            'title' => 'string|required|max:400',
             'author_display_name' => 'string',
             'author_homepage' => 'url',
             'author_timezone' => 'timezone',

二進制
docs/images/endpoint-bodyparams-3.png