File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/Builders/Paths/Operation Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
-
3
2
namespace Vyuldashev \LaravelOpenApi \Builders \Paths \Operation ;
4
3
4
+ use Vyuldashev \LaravelOpenApi \RouteInformation ;
5
5
use GoldSpecDigital \ObjectOrientedOAS \Objects \SecurityRequirement ;
6
6
use Vyuldashev \LaravelOpenApi \Attributes \Operation as OperationAttribute ;
7
- use Vyuldashev \LaravelOpenApi \RouteInformation ;
8
7
9
8
class SecurityBuilder
10
9
{
@@ -14,6 +13,10 @@ public function build(RouteInformation $route): array
14
13
->filter (static fn (object $ attribute ) => $ attribute instanceof OperationAttribute)
15
14
->filter (static fn (OperationAttribute $ attribute ) => isset ($ attribute ->security ))
16
15
->map (static function (OperationAttribute $ attribute ) {
16
+ // return a null scheme if the security is set to ''
17
+ if ($ attribute ->security === '' ) {
18
+ return SecurityRequirement::create ()->securityScheme (null );
19
+ }
17
20
$ security = app ($ attribute ->security );
18
21
$ scheme = $ security ->build ();
19
22
You can’t perform that action at this time.
0 commit comments