Skip to content

SearchFilter changing PackageTypes to PackageType #14941

Closed
NuGet/NuGet.Client
#7469

Description

@zivkan

The way that NuGet.Protocol works with package type filtering is changing.

Previously:

  • SearchFilter.PackageTypes was data type IEnumerable<string>
  • Each value would result in &packageTypeFilter={value} being appended to the URL.

Now:

  • SearchFilter.PackageTypes is removed
  • string SearchFilter.PackageType is added (so, a singular version of the previous property)
  • When non-empty, &packageType={value} will be appended to the string.
  • PackageSearchResource.SearchAsync will throw on feeds that don't support package type filtering if SearchFilter.PackageType is not null or empty. Use PackageSearchResource.SupportsPackageTypeFiltering to decide whether to use PackageType in the search.

The reason is that nuget.org never supported the old packageTypeFilter={value} query parameter. When they implemented package type filtering, they look for the parameter name packageType. While it's possible that different NuGet server implementations might have used packageTypeFilter, we believe it's unlikely. There have been multiple customers, including the .NET SDK itself, which want to use nuget.org's package type filtering, so supporting nuget.org's syntax will be valuable.

nuget.org's implementation also only allows a single value to be filtered, hence removing the old collection property and adding the new single value property.

So, the APIs were modified to align with what nuget.org actually implemented. Although the .NET SDK has supported package type filtering with dotnet tool search for several years now, they only support nuget.org's query syntax (without using NuGet.Protocol). The NuGet team's Visual Studio integration (Package Manager UI and Console) never supported any package type filtering, not did any NuGet.exe or NuGet team owned dotnet CLI commands. We therefore believe it's unlikely any other NuGet server has implemented packageTypeFilter, or that many apps referencing NuGet.Protocol will be attempting to use SearchFilter.PackageTypes. With all of this considered, we decided not to provide backwards compatibility for the API.

Activity

  1. self-assigned this
    on Jun 10, 2026
  2. added
    Functionality:SDK
    Priority:2
    Area:Protocol
    Breaking-Change
    on Jun 10, 2026
  3. dotnet-policy-service commented on Jun 11, 2026

    @dotnet-policy-service
    Contributor

    Issue is missing Type label, remember to add a Type label

  4. added
    missing-required-type
    on Jun 11, 2026
  5. removed
    missing-required-type
    on Jun 11, 2026
  6. added this to the 7.9 milestone on Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area:ProtocolBreaking-ChangeFunctionality:SDKPriority:2Type:Bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions