From 8555ca4cdf016baa22032468f905a729ba2347c4 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Mon, 29 Sep 2025 18:36:28 +0200 Subject: [PATCH] fix(license): Support all allowed identifiers Signed-off-by: provokateurin --- src/Helpers.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Helpers.php b/src/Helpers.php index 741a5e2..4782d11 100644 --- a/src/Helpers.php +++ b/src/Helpers.php @@ -45,11 +45,16 @@ public static function securitySchemes(): array { public static function license(string $openapiVersion, string $license): array { $identifier = match ($license) { 'agpl' => 'AGPL-3.0-only', + 'mit' => 'MIT', + 'mpl' => 'MPL-2.0', + 'apache' => 'Apache-2.0', + 'gpl3' => 'GPL-3.0-only', + '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, default => Logger::panic('license', 'Unable to convert ' . $license . ' to SPDX identifier'), }; $out = [ - 'name' => 'agpl', + 'name' => $license, ]; if (version_compare($openapiVersion, '3.1.0', '>=')) { $out['identifier'] = $identifier;