From b5f08779677d24660ff592583e39bb67d29e82ad Mon Sep 17 00:00:00 2001 From: ChrisJr404 Date: Mon, 4 May 2026 08:51:19 -0400 Subject: [PATCH] fix: map "nuget" purl type to DotnetPkg in TypeByName (#4848) Signed-off-by: Chris (ChrisJr404) <11917633+ChrisJr404@users.noreply.github.com> --- syft/pkg/type.go | 2 +- syft/pkg/type_test.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/syft/pkg/type.go b/syft/pkg/type.go index b9ee19357..d4abe75a6 100644 --- a/syft/pkg/type.go +++ b/syft/pkg/type.go @@ -220,7 +220,7 @@ func TypeByName(name string) Type { return CondaPkg case packageurl.TypePub: return DartPubPkg - case "dotnet": // here to support legacy use cases + case "dotnet", packageurl.TypeNuget: // "dotnet" is here to support legacy use cases; "nuget" is the canonical purl type return DotnetPkg case packageurl.TypeCocoapods: return CocoapodsPkg diff --git a/syft/pkg/type_test.go b/syft/pkg/type_test.go index b58e4ecd5..580ea5c79 100644 --- a/syft/pkg/type_test.go +++ b/syft/pkg/type_test.go @@ -58,6 +58,11 @@ func TestTypeFromPURL(t *testing.T) { purl: "pkg:dotnet/Microsoft.CodeAnalysis.Razor@2.2.0", expected: DotnetPkg, }, + { + name: "nuget purl maps to dotnet", + purl: "pkg:nuget/Minio@7.0.0", + expected: DotnetPkg, + }, { purl: "pkg:composer/laravel/laravel@5.5.0", expected: PhpComposerPkg,