Skip to content

Commit c315666

Browse files
committed
fix(laravel): api_doc route regex
1 parent 402220f commit c315666

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/Laravel/ApiPlatformProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,7 @@ public function boot(ResourceNameCollectionFactoryInterface $resourceNameCollect
811811

812812
return $entrypointAction->__invoke($request);
813813
});
814+
$route->where('index', 'index');
814815
$route->name('api_entrypoint')->middleware(ApiPlatformMiddleware::class);
815816
$routeCollection->add($route);
816817
$route = new Route(['GET'], $prefix.'/.well-known/genid/{id}', function (): void {

src/Laravel/Tests/JsonLdTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,4 +269,10 @@ public function testSluggable(): void
269269
$response = $this->get($iri, ['accept' => 'application/ld+json']);
270270
$response->assertStatus(200);
271271
}
272+
273+
public function testApiDocsRegex(): void
274+
{
275+
$response = $this->get('/api/notexists', ['accept' => 'application/ld+json']);
276+
$response->assertNotFound();
277+
}
272278
}

0 commit comments

Comments
 (0)