Skip to content

Commit 9e49322

Browse files
authored
Merge pull request #48 from RonasIT/42-drivers-feature
fix: bug with sending cut json;
2 parents 0d997f6 + 2f41a6f commit 9e49322

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

config/auto-doc.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
| `RonasIT\Support\AutoDoc\Interfaces\SwaggerDriverInterface` interface,
9393
| or one of our drivers from the `drivers` config:
9494
*/
95-
'driver' => 'local',
95+
'driver' => env('SWAGGER_DRIVER', 'local'),
9696

9797
'drivers' => [
9898
'local' => [
@@ -101,8 +101,8 @@
101101
],
102102
'remote' => [
103103
'class' => RemoteDriver::class,
104-
'key' => 'project_name',
105-
'url' => 'https://example.com'
104+
'key' => env('SWAGGER_REMOTE_DRIVER_KEY', 'project_name'),
105+
'url' => env('SWAGGER_REMOTE_DRIVER_URL', 'https://example.com')
106106
],
107107
'storage' => [
108108
'class' => StorageDriver::class,
@@ -114,7 +114,7 @@
114114
|
115115
| One of the filesystems.disks config value
116116
*/
117-
'disk' => 'public',
117+
'disk' => env('SWAGGER_STORAGE_DRIVER_DISK', 'public'),
118118
'production_path' => 'documentation.json'
119119
]
120120
],
@@ -131,5 +131,5 @@
131131
'development'
132132
],
133133

134-
'config_version' => '2.0'
134+
'config_version' => '2.1'
135135
];

src/Drivers/RemoteDriver.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ public function saveData()
4040

4141
curl_setopt($curl, CURLOPT_URL, $this->getUrl());
4242
curl_setopt($curl, CURLOPT_POST, true);
43-
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($this->getTmpData()));
43+
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($this->getTmpData()));
4444
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
45+
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
4546

4647
curl_exec($curl);
4748
curl_close($curl);

0 commit comments

Comments
 (0)