Pārlūkot izejas kodu

Fix style issues

shalvah 6 gadi atpakaļ
vecāks
revīzija
10994ed36e

+ 2 - 0
src/Generators/AbstractGenerator.php

@@ -148,6 +148,7 @@ abstract class AbstractGenerator
             ->first(function ($tag) {
                 return $tag instanceof Tag && strtolower($tag->getName()) === 'authenticated';
             });
+
         return (bool) $authTag;
     }
 
@@ -446,6 +447,7 @@ abstract class AbstractGenerator
         ];
 
         $fake = $fakes[$type] ?? $fakes['string'];
+
         return $fake();
     }
 }

+ 6 - 5
tests/Fixtures/TestController.php

@@ -23,11 +23,12 @@ class TestController extends Controller
     }
 
     /**
-     * @bodyParam title string required The title of the post.
-     * @bodyParam body string required The title of the post.
-     * @bodyParam type string The type of post to create. Defaults to 'textophonious'.
-    @bodyParam author_id int the ID of the author
-     * @bodyParam thumbnail image This is required if the post type is 'imagelicious
+     * @bodyParam user_id int required The id of the user.
+     * @bodyParam room_id string The id of the room.
+     * @bodyParam forever boolean Whether to ban the user forever.
+     * @bodyParam another_one number Just need something here.
+     * @bodyParam yet_another_param object required
+     * @bodyParam even_more_param array
      */
     public function withBodyParameters()
     {

+ 62 - 11
tests/Fixtures/index.md

@@ -23,7 +23,7 @@ Welcome to the generated API reference.
 #general
 <!-- START_264ee15c728df32e7ca6eedce5e42dcb -->
 ## Example title.
-
+ 
 This will be the long description.
 It can also be multiple lines long.
 
@@ -68,7 +68,7 @@ null
 
 <!-- START_9cedd363be06f5512f9e844b100fcc9d -->
 ## api/withResponseTag
-
+ 
 > Example request:
 
 ```bash
@@ -116,7 +116,7 @@ $.ajax(settings).done(function (response) {
 
 <!-- START_a25cb3b490fa579d7d77b386bbb7ec03 -->
 ## api/withBodyParameters
-
+ 
 > Example request:
 
 ```bash
@@ -124,10 +124,10 @@ curl -X GET -G "http://localhost/api/withBodyParameters" \
     -H "Accept: application/json" \
     -H "Authorization: customAuthToken" \
         -H "Custom-Header: NotSoCustom"  \
-    -d "user_id"=14 \
-        -d "room_id"=KHEnlMeSksAYgNtw \
-        -d "forever"=1 \
-        -d "another_one"=4919.5 \
+    -d "user_id"=20 \
+        -d "room_id"=6DZyNcBgezdjdAIs \
+        -d "forever"= \
+        -d "another_one"=2153.4 \
         -d "yet_another_param"={} \
         -d "even_more_param"=[] 
 ```
@@ -139,10 +139,10 @@ var settings = {
     "url": "http://localhost/api/withBodyParameters",
     "method": "GET",
     "data": {
-        "user_id": 14,
-        "room_id": "KHEnlMeSksAYgNtw",
-        "forever": true,
-        "another_one": 4919.5,
+        "user_id": 20,
+        "room_id": "6DZyNcBgezdjdAIs",
+        "forever": false,
+        "another_one": 2153.4,
         "yet_another_param": "{}",
         "even_more_param": "[]"
     },
@@ -180,4 +180,55 @@ Parameter | Type | Status | Description
 
 <!-- END_a25cb3b490fa579d7d77b386bbb7ec03 -->
 
+<!-- START_5c08cc4d72b6e5830f6814c64086e197 -->
+## api/withAuthTag
+ <small style="
+  padding: 1px 9px 2px;
+  font-weight: bold;
+  white-space: nowrap;
+  color: #ffffff;
+  -webkit-border-radius: 9px;
+  -moz-border-radius: 9px;
+  border-radius: 9px;
+  background-color: #3a87ad;">Requires authentication</small>
+
+> Example request:
+
+```bash
+curl -X GET -G "http://localhost/api/withAuthTag" \
+    -H "Accept: application/json" \
+    -H "Authorization: customAuthToken" \
+        -H "Custom-Header: NotSoCustom" 
+```
+
+```javascript
+var settings = {
+    "async": true,
+    "crossDomain": true,
+    "url": "http://localhost/api/withAuthTag",
+    "method": "GET",
+    "headers": {
+        "accept": "application/json",
+        "Authorization": "customAuthToken",
+        "Custom-Header": "NotSoCustom",
+    }
+}
+
+$.ajax(settings).done(function (response) {
+    console.log(response);
+});
+```
+
+> Example response:
+
+```json
+null
+```
+
+### HTTP Request
+`GET api/withAuthTag`
+
+
+<!-- END_5c08cc4d72b6e5830f6814c64086e197 -->
+