Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-8992

Nuget odata orderby Version Packages query performs lexical string comparison of versions instead of semantic ordering

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.11.3, 3.0.0-m7
    • Fix Version/s: None
    • Component/s: Repository
    • Labels:
      None
    • Environment:
      Windows server 2012

      Description

      When accessing the REST api, using ODATA parameters to filter out the latest version of a specific nuget package, the order by version compares the semantic version number of the packages by string comparison instead of a more correct numerical comparison for the major.minor.revision parts.

      Example:
      I have two versions of package in my repro.
      myPackage 1.0.9
      myPackage 1.0.10

      I try to get the latest version (1.0.10) using the following REST url

      http://localhost:8081/nexus/service/local/nuget/myFeed/Packages?$filter=Id%20eq%20%27myPackage%27&$top=1&$orderby=Version%20desc

      This returns the 1.0.9 package instead, since it performs lexical comparison.

      I think this issue would be trivial to fix but it does have a great impact when we rely on the REST api to return the latest verision of a specific package.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                dan@meridium.se Dan Händevik
                Last Updated By:
                Peter Lynch
              • Votes:
                1 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: