We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8dd48f0 commit 428a47cCopy full SHA for 428a47c
1 file changed
config/common/routes.php
@@ -11,6 +11,7 @@
11
use Yiisoft\Router\Route;
12
use Yiisoft\Swagger\Middleware\SwaggerJson;
13
use Yiisoft\Swagger\Middleware\SwaggerUi;
14
+use Yiisoft\Yii\Middleware\CorsAllowAll;
15
16
return [
17
Route::get('/')
@@ -34,6 +35,7 @@
34
35
->action(fn (SwaggerUi $swaggerUi) => $swaggerUi->withJsonUrl('/docs/openapi.json')),
36
Route::get('/openapi.json')
37
->middleware(FormatDataResponseAsJson::class)
- ->action(SwaggerJson::class),
38
+ ->middleware(CorsAllowAll::class)
39
+ ->action([SwaggerJson::class, 'handle']),
40
),
41
];
0 commit comments