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!

    Wrong NuGet API response code for package with no versions available

    Scheduled Pinned Locked Moved Support
    2 Posts 2 Posters 10 Views 1 Watching
    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.
    • S Offline
      ssuenaga_1020
      last edited by

      Microsoft's NuGet server API documentation for enumerating package versions says the API response should be 404 when the package source has no versions of the requested package:
      https://learn.microsoft.com/en-us/nuget/api/package-base-address-resource#enumerate-package-versions

      But ProGet currently returns 200 with an empty array:

      {
          "versions": []
      }
      

      The documentation doesn't say the 404 should have specific body content, but just for comparison, api.nuget.org returns an XML body:

      <?xml version="1.0" encoding="utf-8"?>
      <Error>
          <Code>BlobNotFound</Code>
          <Message>The specified blob does not exist.
      RequestId:d5844934-501e-000f-5804-f3cb9b000000
      Time:2023-09-29T18:43:32.7072199Z</Message>
      </Error>
      

      The reason this is an issue for me is because I use the Version Lens extension for VS Code, which currently relies on the documented 404 behavior:
      https://marketplace.visualstudio.com/items?itemName=pflannery.vscode-versionlens

      atrippA 1 Reply Last reply Reply Quote 0
      • atrippA Offline
        atripp inedo-engineer @ssuenaga_1020
        last edited by

        Hi @ssuenaga_1020 ,

        Thanks for the detailed report; this seems easy enough to fix, so we'll get this addressed in the next maintenance release (2023.20) via PG-2499.

        Cheers,
        Alana

        1 Reply Last reply Reply Quote 1

        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