Skip to content

Commit 7f610e6

Browse files
author
RobertGroot
committed
ToArray fix
1 parent d25dd45 commit 7f610e6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Data/OpenApi.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Routing\Route;
77
use Illuminate\Support\Facades\Log;
88
use Spatie\LaravelData\Data;
9+
use Spatie\LaravelData\Support\Wrapping\WrapExecutionType;
910
use stdClass;
1011

1112
class OpenApi extends Data
@@ -62,7 +63,10 @@ public static function fromRoutes(array $routes, Command $command): self
6263
);
6364
}
6465

65-
public function toArray(): array
66+
/**
67+
* @return array<string,mixed>
68+
*/
69+
public function transform(bool $transformValues = true, WrapExecutionType $wrapExecutionType = WrapExecutionType::Disabled): array
6670
{
6771
// Double call to make sure all schemas are resolved
6872
$this->resolveSchemas();
@@ -77,7 +81,7 @@ public function toArray(): array
7781
) : new stdClass(), ];
7882

7983
return array_merge(
80-
parent::toArray(),
84+
parent::transform($transformValues, $wrapExecutionType),
8185
$paths,
8286
[
8387
'components' => [

0 commit comments

Comments
 (0)