Skip to content

Commit 8555ca4

Browse files
committed
fix(license): Support all allowed identifiers
Signed-off-by: provokateurin <kate@provokateurin.de>
1 parent fd948e8 commit 8555ca4

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/Helpers.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,16 @@ public static function securitySchemes(): array {
4545
public static function license(string $openapiVersion, string $license): array {
4646
$identifier = match ($license) {
4747
'agpl' => 'AGPL-3.0-only',
48+
'mit' => 'MIT',
49+
'mpl' => 'MPL-2.0',
50+
'apache' => 'Apache-2.0',
51+
'gpl3' => 'GPL-3.0-only',
52+
'AGPL-3.0-only', 'AGPL-3.0-or-later', 'Apache-2.0', 'GPL-3.0-only', 'GPL-3.0-or-later', 'MIT', 'MPL-2.0' => $license,
4853
default => Logger::panic('license', 'Unable to convert ' . $license . ' to SPDX identifier'),
4954
};
5055

5156
$out = [
52-
'name' => 'agpl',
57+
'name' => $license,
5358
];
5459
if (version_compare($openapiVersion, '3.1.0', '>=')) {
5560
$out['identifier'] = $identifier;

0 commit comments

Comments
 (0)