Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    Issue with proget native API and package IDs that contain _

    Scheduled Pinned Locked Moved Support
    progetapi
    4 Posts 2 Posters 42 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? This user is from outside of this forum
      Guest
      last edited by

      In our CI-system, we use the Proget native API to retrieve information about out NuGet packages, like the latest available version. This mostly works as expected, but we have trouble with NuGet packages whose ID contains underscores ( _ ).

      Given the following query, a json structure containing information about the package is returned as expected:

      http://<url>/api/json/NuGetPackages_GetLatestStable?Feed_Id=10&PackageIds_Psv=some-package-id&API_Key=<key>
      

      But if the pacakge ID contains an underscore, like the following query, the returned json structure is just an empty list:

      http://<url>/api/json/NuGetPackages_GetLatestStable?Feed_Id=10&PackageIds_Psv=some_package_id&API_Key=<key>
      

      We get the same result also for NuGetPackages_GetLatest, so it does not matter if the package exists only in prerelease versions. The result is also the same across different feeds.

      Is this a bug in the native API? Are there any possible workarounds for fetching version information for packages whose ID contains an underscore?

      Product: ProGet
      Version: 4.6.7

      1 Reply Last reply Reply Quote 0
      • benB Offline
        ben inedo-engineer
        last edited by

        I tried with secp256k1_openssl_vc120 and the JSON API works as expected. Is there a specific package name that exhibits this problem that you can share?

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          We have now also verified that package names that contain underscores work.

          When investigating further, we noticed that the packages in question were all added to the feed through a connector. After pulling the package from the connected feed into the feed we query with the API, these also work as expected.

          Follow-up question: is this behavior intended? If a package is available in a feed, even if it is through a connector, should it not be queryable?

          Seems it was a very unlikely coincidence that all the package IDs with underscores we tested on were added through connectors.

          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

            The native API is a database wrapper, and thus would only be able to return local/cached packages.

            You should consider using the NuGet API instead.

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post
            Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation