Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-16910

AQL: if an artifact does not have any properties it will be serialized as a json list with an empty object.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 5.10.0, 5.11.0, 6.0.0
    • Fix Version/s: 6.1.0
    • Component/s: None
    • Labels:
      None

      Description

       

      In 6.0.1 when using AQL if an artifact does not have any properties it will be serialized as a json list with an empty object. This is incorrect. It should be an empty list. It appears to have changed between 5.4.5 and 6.0.1.

       

      Expected:

      "properties" : [ ]

       

        

      Actual:

        "properties" : [

      {   }

      ]

       

       

      Steps to reproduce:

      1. Create a file testfile.txt in myrepo

      2. Use the rest api with the following AQL to get information about the file (curl -H "Content-Type: text/plain" -X POST "http://artifactory.com:8081/artifactory/api/search/aql" -d "@aql.txt")

      aql.txt:

      items.find(

      { "repo" :

      { "$eq" : "myrepo" }

       ,

      "type" : { "$eq" : "file" },

      "name" : { "$eq" : "testfile.txt" }}

      ).include("repo", "name", "path", "type", "property")

       

      3. Look at the results and observe how the properties are not serialized properly (there is an empty json object { } within it:

      {

      "results": [

      { "repo": "eba-test-etc-hen", "path": ".", "name": "testfile.txt", "type": "file", "properties": [\{    }

      ]

      }

      ],

      "range":

      { "start_pos": 0, "end_pos": 1, "total": 1 }

      }

       

       

      Result from 5.4.5:

      {

      "results": [

      { "repo": "eba-test-etc-hen", "path": ".", "name": "testfile.txt", "type": "file" }

      ],

      "range":

      { "start_pos": 0, "end_pos": 1, "total": 1 }

      }

        Attachments

          Activity

            People

            • Assignee:
              nadavy Nadav Yogev
              Reporter:
              davids David Shin
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: