-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add bearer access token in docs via decorator, disable webby
- Loading branch information
Showing
3 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - GNU General Public License version 3 (GPLv3) | ||
* - Pimcore Commercial License (PCL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license GPLv3 and PCL | ||
*/ | ||
|
||
namespace Pimcore\Bundle\StudioApiBundle\ApiPlatform; | ||
|
||
use ApiPlatform\OpenApi\Factory\OpenApiFactoryInterface; | ||
use ApiPlatform\OpenApi\Model\SecurityScheme; | ||
use ApiPlatform\OpenApi\OpenApi; | ||
|
||
|
||
final readonly class OpenApiFactoryDecorator implements OpenApiFactoryInterface | ||
{ | ||
public function __construct(private OpenApiFactoryInterface $decorated) | ||
{ | ||
} | ||
|
||
public function __invoke(array $context = []): OpenApi | ||
{ | ||
$openApi = $this->decorated->__invoke($context); | ||
|
||
$securitySchemes = $openApi->getComponents()->getSecuritySchemes() ?: new \ArrayObject(); | ||
Check notice on line 34 in src/ApiPlatform/OpenApiFactoryDecorator.php GitHub Actions / Qodana for PHPFully qualified name usage
|
||
$securitySchemes['access_token'] = new SecurityScheme( | ||
Check notice on line 35 in src/ApiPlatform/OpenApiFactoryDecorator.php GitHub Actions / Qodana for PHPParameter/variable is not used
|
||
type: 'http', | ||
scheme: 'bearer', | ||
); | ||
|
||
return $openApi; | ||
} | ||
} |