Skip to content
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

Get by packageid and an api to search by title #2585

Merged

Conversation

yazeedobaid
Copy link
Collaborator

Description

This PR modifies the NuGet feed APIs and opens a new API to search for packages. Fixes #2575

This PR fixes the NuGet feed APIs and ported them to use V3 of the NuGet feed. It uses the title query parameter to get information about a requested package. The issue with the title query parameter is that it doesn't return exact results as intended. For example,

"Pulumi.FSharp.AzureAD" |> NuGet.getLatestPackage (NuGet.getRepoUrl())

Returns results for Azure.Storage.Blobs. Likewise, if the title was replaced by id in the NuGet query endpoint it will behave the same.
To solve this the packageid query parameter is the one that returns exact matches by packageid
So, in this PR, the getPackage and getLatestPackage APIs now use the packageid in the search.
The underlying HTTPS request would be like:

https://azuresearch-usnc.nuget.org/query?q=packageid:Pulumi.FSharp.AzureAD&take=1

To make API more flexible, a new API was added searchByTitle which uses the title query parameter in the search and returns more than one result, unlike the other two APIs which return one result only.

@matthid matthid merged commit 9ab339b into fsprojects:release/next Apr 6, 2021
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.

Fake.DotNet.NuGet.NuGet.getLatestPackage fails with NullReferenceException
2 participants