generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
security
implementation according OpenAPI 3.1.0 specification (#717)
* make security implementation follow the specification * make security the same for openapi and operation objects * Fix styling * handle missing security in secure method --------- Co-authored-by: romalytvynenko <[email protected]>
- Loading branch information
1 parent
544fa34
commit 88314d2
Showing
7 changed files
with
85 additions
and
45 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 was deleted.
Oops, something went wrong.
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,28 @@ | ||
<?php | ||
|
||
namespace Dedoc\Scramble\Support\Generator; | ||
|
||
class SecurityRequirement | ||
{ | ||
/** | ||
* @var array<string, string[]> | ||
*/ | ||
private array $items = []; | ||
|
||
public function __construct(array|string $items) | ||
{ | ||
if (is_string($items)) { // keeping backward compatibility with synthetic Security object | ||
$this->items[$items] = []; | ||
} else { | ||
$this->items = $items; | ||
} | ||
} | ||
|
||
public function toArray() | ||
{ | ||
return count($this->items) ? $this->items : (object) []; | ||
} | ||
} | ||
|
||
// To keep backward compatibility | ||
class_alias(SecurityRequirement::class, 'Dedoc\Scramble\Support\Generator\Security'); |
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