Skip to content

Commit

Permalink
more sensible defaults so data_get can work based on given path
Browse files Browse the repository at this point in the history
  • Loading branch information
romalytvynenko committed Jun 4, 2024
1 parent d89528a commit 652348b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/OpenApiTraverser.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public function __construct(
) {
}

public function traverse($type, $path = ['#']): void
public function traverse($type, $path = []): void
{
if (is_scalar($type) || $type === null) {
return;
Expand Down
10 changes: 5 additions & 5 deletions tests/OpenApiTraverserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public function enter($object, $path = [])
$traverser->traverse($document);

expect($visitor->paths)->toBe([
'#',
'#.info',
'#.components',
'#.paths.0',
'#.paths.0.operations.GET',
'',
'info',
'components',
'paths.0',
'paths.0.operations.GET',
]);
});

0 comments on commit 652348b

Please sign in to comment.