Skip to content

fix(nuget): Visual Studio NuGet package search discovery - #500

Merged
M0Rf30 merged 3 commits into
openartifact:mainfrom
zhaowenquan131:main
Nov 17, 2026
Merged

M0Rf30 merged 3 commits into
openartifact:mainfrom
zhaowenquan131:main

Conversation

@zhaowenquan131

Copy link
Copy Markdown
Contributor

Summary

Add versioned resource type identifiers for NuGet search and autocomplete services in the NuGet v3 service index.

Motivation

Visual Studio's NuGet Package Manager could not search packages from the OpenArtifact NuGet feed when the service index advertised the unversioned SearchQueryService and SearchAutocompleteService resource types.

Changing these resource types to their versioned aliases resolves the service discovery issue and allows Visual Studio to use the search and autocomplete endpoints.

Changes

  • Change SearchQueryService to SearchQueryService/3.0.0-beta.
  • Change SearchAutocompleteService to SearchAutocompleteService/3.0.0-beta.

Testing

  • Verified that Visual Studio's NuGet Package Manager can search packages from the OpenArtifact NuGet feed after the change.
  • Verified that the search endpoint returns package results with the expected NuGet search response structure.

Compatibility

This change only updates the resource type identifiers advertised in the service index. It does not change the search or autocomplete endpoint implementations, nor does it claim support for the additional capabilities introduced by newer API versions such as SearchAutocompleteService/3.5.0.

@M0Rf30 M0Rf30 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Two things before this can go in:

  1. Replacing the bare types breaks TestServiceIndexUsesDerivedOrigin (internal/format/nuget/urls_test.go:139), and drops aliases other clients look for. Please keep the bare entries and add the versioned ones next to them, same @id, as nuget.org does:
{"@id": baseURL + "/v3/query", "@type": "SearchQueryService"},
{"@id": baseURL + "/v3/query", "@type": "SearchQueryService/3.0.0-beta"},
{"@id": baseURL + "/v3/query", "@type": "SearchQueryService/3.0.0-rc"},
{"@id": baseURL + "/v3/autocomplete", "@type": "SearchAutocompleteService"},
{"@id": baseURL + "/v3/autocomplete", "@type": "SearchAutocompleteService/3.0.0-beta"},
{"@id": baseURL + "/v3/autocomplete", "@type": "SearchAutocompleteService/3.0.0-rc"},

Not /3.5.0: the endpoint doesn't implement it.

  1. Add a test that the bare and versioned types resolve to the same URL.

@M0Rf30 M0Rf30 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@M0Rf30
M0Rf30 merged commit aecebb6 into openartifact:main Nov 17, 2026
24 of 45 checks passed
@M0Rf30 M0Rf30 mentioned this pull request Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants