You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -181,9 +181,7 @@ All you have to do is configure the API key in the `value` field.
181
181
By default, [only the authorization header mode is enabled](https://github.com/lexik/LexikJWTAuthenticationBundle/blob/master/Resources/doc/index.md#2-use-the-token) in LexikJWTAuthenticationBundle.
182
182
You must set the [JWT token](https://github.com/lexik/LexikJWTAuthenticationBundle/blob/master/Resources/doc/index.md#1-obtain-the-token) as below and click on the "Authorize" button.
183
183
184
-
```
185
-
Bearer MY_NEW_TOKEN
186
-
```
184
+
Bearer MY_NEW_TOKEN
187
185
188
186

189
187
@@ -193,35 +191,32 @@ We can add a `POST /authentication_token` endpoint to SwaggerUI to conveniently
193
191
194
192

195
193
196
-
To do it, we need to create a `SwaggerDecorator`:
194
+
To do it, we need to create a decorator:
197
195
198
196
```php
199
197
<?php
198
+
// api/src/OpenApi/JwtDecorator.php
200
199
201
200
declare(strict_types=1);
202
201
203
-
namespace App\Swagger;
202
+
namespace App\OpenApi;
204
203
205
204
use ApiPlatform\Core\OpenApi\Factory\OpenApiFactoryInterface;
206
205
use ApiPlatform\Core\OpenApi\OpenApi;
207
206
use ApiPlatform\Core\OpenApi\Model;
208
-
use ArrayObject;
209
-
use Symfony\Component\HttpFoundation\Response;
210
207
211
-
final class JWTSwaggerDecorator implements OpenApiFactoryInterface
208
+
final class JwtDecorator implements OpenApiFactoryInterface
212
209
{
213
-
private OpenApiFactoryInterface $decorated;
214
-
215
-
public function __construct(OpenApiFactoryInterface $decorated)
216
-
{
217
-
$this->decorated = $decorated;
218
-
}
210
+
public function __construct(
211
+
private OpenApiFactoryInterface $decorated
212
+
) {}
219
213
220
214
public function __invoke(array $context = []): OpenApi
0 commit comments