-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Retrieving JSON arrays via fields
selector is broken in Ditto 3.5.1
#1888
Comments
Looks like the same behavior is also observed for /api/2/things API: Request: /api/2/things/sample.eclipse.com:test_1?fields=features/values/properties/a Request: /api/2/things/sample.eclipse.com:test_1?fields=features/values/properties |
fields
selector is broken in Ditto 3.5.1
Thanks a lot @AkshayKumarCB for the bugreport. |
I assume this bug was introduced in PR #1860 |
…rays-in-fieldselectors #1888 fix retrieving simple arrays via field selectors
The GET /api/2/search/things API is currently broken on the release Ditto 3.5.1 when we attempt to fetch an array property.
A sample scenario is given below.
Sample data stored in Ditto:
API query to fetch only the array 'a' from the Ditto thing:
/api/2/search/things?namespaces=sample.eclipse.com&fields=features/values/properties/a
Response on Ditto 3.4.4: (Returns array with values for "a")
{"items":[{"features":{"values":{"properties":{"a":[1,2,3]}}}}],"nextPageOffset":-1}
Response on Ditto 3.5.1: (Returns an empty array for "a")
{"items":[{"features": { "values": { "properties": { "a": [] }}}}],"nextPageOffset": -1}
However, if we were to update the fields query parameter in the request from
features/values/properties/a
tofeatures/values/properties
, we get the correct response - similar to what was observed in 3.4.4.Looks like we have a bug for search/things API for arrays in 3.5.1 that needs to be fixed.
Reproducibility rate: 100% (5/5)
The text was updated successfully, but these errors were encountered: