Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thing API does not support alternative way of specifying list query parameters #1644

Closed
enenuki opened this issue May 29, 2023 · 1 comment · Fixed by #1652
Closed

Thing API does not support alternative way of specifying list query parameters #1644

enenuki opened this issue May 29, 2023 · 1 comment · Fixed by #1652
Assignees
Milestone

Comments

@enenuki
Copy link

enenuki commented May 29, 2023

Ditto thing API supports querying for certain parts of thing, by specifying URL like:
<BASE_URL>/api/2/things/<thingid>?fields=attributes/manufacturer,attributes/type,attributes/productkey

but if we want to use alternative format:
<BASE_URL>/api/2/things/<thingid>?fields=attributes/manufacturer&fields=attributes/type&fields=attributes/productkey

it only returns first attribute (in this case attributes/manufacturer).

While this may seem like minor issue, some libraries (jawax.ws.rs.QueryParam in JAX-RS API) use only the alternative format to serialize their requests, which makes it a bit harder to bypass.

Screenshot from 2023-05-24 16-45-05
Screenshot from 2023-05-24 16-45-18

Ditto version: 3.2.0

@thjaeckle
Copy link
Member

Thanks for reporting, @enenuki
That definitely would be a good and simple enhancement for Ditto.
Will work on that..

@thjaeckle thjaeckle added this to the 3.3.0 milestone May 30, 2023
thjaeckle added a commit that referenced this issue Jun 12, 2023
… used, but duplicated keys

* e.g.: `?fields=thingId&fields=policyId`

Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
thjaeckle added a commit that referenced this issue Jun 13, 2023
… used, but duplicated keys

* e.g.: `?fields=thingId&fields=policyId`

Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
@thjaeckle thjaeckle self-assigned this Jun 16, 2023
thjaeckle added a commit that referenced this issue Jun 22, 2023
Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
thjaeckle added a commit that referenced this issue Jun 22, 2023
…ry-params

#1644 support query params in the style where not comma separation is used, but duplicated keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
2 participants