-
Type:
Bug
-
Status: Done
-
Resolution: Done
-
Affects Version/s: 5.10.0, 5.11.0, 6.0.0
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Severity:Medium
-
Regression:Yes
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" :
,
"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 }}