Skip to content

Commit

Permalink
Added: JWT security scheme to openapi (adding token in swagger ui wit…
Browse files Browse the repository at this point in the history
…hout `Bearer ` prefix)
  • Loading branch information
Ninos committed Sep 22, 2023
1 parent 2db3658 commit 8bce00c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions OpenApi/OpenApiFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ public function __invoke(array $context = []): OpenApi
{
$openApi = ($this->decorated)($context);

$openApi
->getComponents()->getSecuritySchemes()->offsetSet(
'JWT',
new \ArrayObject([
'type' => 'http',
'scheme' => 'bearer',
'bearerFormat' => 'JWT',
]
)
);

$openApi
->getPaths()
->addPath($this->checkPath, (new PathItem())->withPost(
Expand Down

0 comments on commit 8bce00c

Please sign in to comment.