-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a sample for listing package ids from a feed. #41
Add a sample for listing package ids from a feed. #41
Conversation
I wasn't able to find documentation for ListResource so perhaps worth adding to the docs as well? |
ListResource is V2 based, it always falls back to the search/packages OData endpoint. Those are capable of switching between implementations properly. |
I started writing this before Nikolche replied, but I was too slow because I was checking some server implementations and getting links: This only works for v3 feeds when the service index contains a While nuget.org, Azure DevOps, and MyGet implement it, I know that Sleet and BaGet do not. I don't know about GitHub Package Repository, or all the other servers listed in NuGet doc's hosting a package page. A Nikolche wrote, that sample will not work for all NuGet server implementations. |
So is there a canonical way to do this properly for any feed? Or should we publish this with a disclaimer explaining that it's only for feeds that support V2, and won't work in certain servers such as Sleet and BaGet? |
There's no resource to list all package ids in v3 today. NuGet/NuGetGallery#3878 is the ask afaik. |
Then let's add this sample and add a snippet in the docs clarifying the situation. It's useful in most scenarios and better than nothing. |
FYI, some V3 servers like nuget.org provide a catalog resource which can be used to discover all packages (see this tutorial). Here's a tool I wrote to do exactly just that: https://github.com/loic-sharma/nuget-mirror For NuGet servers that do not support V2 and the catalog resource, I would recommend falling back to the search resource. |
So let's see if I'm getting this right.
So there's no reliable way to do what I want for all feeds but some combination of ListResource and catalog resource can together provide it for most feeds. Does this sound about right? |
That's right. For scenario 4, this suggestion can be used:
In hindsight, this may be a little too complex for the SDK samples 😅 |
Let's either merge this or close it, and I'm OK with either :) Thanks! |
No description provided.