Skip to content

Commit

Permalink
Merge pull request #48 from RonasIT/42-drivers-feature
Browse files Browse the repository at this point in the history
fix: bug with sending cut json;
  • Loading branch information
DenTray committed May 12, 2022
2 parents 0d997f6 + 2f41a6f commit 9e49322
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions config/auto-doc.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
| `RonasIT\Support\AutoDoc\Interfaces\SwaggerDriverInterface` interface,
| or one of our drivers from the `drivers` config:
*/
'driver' => 'local',
'driver' => env('SWAGGER_DRIVER', 'local'),

'drivers' => [
'local' => [
Expand All @@ -101,8 +101,8 @@
],
'remote' => [
'class' => RemoteDriver::class,
'key' => 'project_name',
'url' => 'https://example.com'
'key' => env('SWAGGER_REMOTE_DRIVER_KEY', 'project_name'),
'url' => env('SWAGGER_REMOTE_DRIVER_URL', 'https://example.com')
],
'storage' => [
'class' => StorageDriver::class,
Expand All @@ -114,7 +114,7 @@
|
| One of the filesystems.disks config value
*/
'disk' => 'public',
'disk' => env('SWAGGER_STORAGE_DRIVER_DISK', 'public'),
'production_path' => 'documentation.json'
]
],
Expand All @@ -131,5 +131,5 @@
'development'
],

'config_version' => '2.0'
'config_version' => '2.1'
];
3 changes: 2 additions & 1 deletion src/Drivers/RemoteDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ public function saveData()

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

curl_exec($curl);
curl_close($curl);
Expand Down

0 comments on commit 9e49322

Please sign in to comment.