Skip to content

Commit 2e0dd61

Browse files
authored
Merge pull request #29 from nathanaelhoun/fix-application-in-subpath
fix: use full url for Swagger Ui bundles urls
2 parents bdd46ec + 9c71cea commit 2e0dd61

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

resources/views/index.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
urls: [
4040
@foreach ($data['versions'] as $version => $path)
4141
{
42-
url: '/{{ $data['path'] }}/{{ $version }}',
42+
url: '{{ url("{$data['path']}/{$version}") }}',
4343
name: '{{ $version }}',
4444
},
4545
@endforeach

tests/SwaggerUiRouteTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function it_provides_openapi_route_as_url()
2929
{
3030
$this->get('swagger')
3131
->assertStatus(200)
32-
->assertSee('url: \'/swagger/v1\'', false);
32+
->assertSee('url: \'http://localhost/swagger/v1\'', false);
3333
}
3434

3535
/** @test */
@@ -46,17 +46,17 @@ public function it_supports_multiple_versions()
4646
{
4747
$this->get('swagger-with-versions')
4848
->assertStatus(200)
49-
->assertSee('url: \'/swagger-with-versions/v1\'', false)
50-
->assertSee('url: \'/swagger-with-versions/v2\'', false);
49+
->assertSee('url: \'http://localhost/swagger-with-versions/v1\'', false)
50+
->assertSee('url: \'http://localhost/swagger-with-versions/v2\'', false);
5151
}
5252

5353
/** @test */
5454
public function it_supports_multiple_versions_with_sub_path()
5555
{
5656
$this->get('path/with/multiple/segments/swagger-with-versions')
5757
->assertStatus(200)
58-
->assertSee('url: \'/path/with/multiple/segments/swagger-with-versions/v1\'', false)
59-
->assertSee('url: \'/path/with/multiple/segments/swagger-with-versions/v2\'', false);
58+
->assertSee('url: \'http://localhost/path/with/multiple/segments/swagger-with-versions/v1\'', false)
59+
->assertSee('url: \'http://localhost/path/with/multiple/segments/swagger-with-versions/v2\'', false);
6060
}
6161

6262
/** @test */

0 commit comments

Comments
 (0)