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

Metadata in URL query not being properly parsed #1357

Closed
mteodor opened this issue Feb 5, 2021 · 3 comments · Fixed by #1383
Closed

Metadata in URL query not being properly parsed #1357

mteodor opened this issue Feb 5, 2021 · 3 comments · Fixed by #1383
Assignees
Labels
Milestone

Comments

@mteodor
Copy link
Contributor

mteodor commented Feb 5, 2021

BUG REPORT

  1. What were you trying to achieve?

Search things/users by metadata

  1. What are the expected results?

List of things that match the metadata query

  1. What are the received results?
curl -i  -s -X GET http://localhost:8182/things\?name\=test\&metadata\=\{\"role\":\"manager\"\} -H "Authorization: $TOK" -H 'Content-Type: application/json'

HTTP/1.1 400 Bad Request
Content-Type: application/json
Date: Fri, 05 Feb 2021 20:04:15 GMT
Content-Length: 33

{"error":"invalid query params"}
@manuio
Copy link
Contributor

manuio commented Feb 6, 2021

@mteodor Looks like you have unecessary \. Try with: http://localhost:4200/things?offset=0&limit=100&order=name&dir=asc&metadata={"type":"lora"}

@mteodor
Copy link
Contributor Author

mteodor commented Feb 6, 2021

Actually problem is with more complex metadata, when bone interprets metada as an array since it contains ,, @dusanb94 found a solution for proper url parsing

@drasko
Copy link
Contributor

drasko commented Mar 1, 2021

As explained in https://github.com/mainflux/mainflux/pull/1358#pullrequestreview-599090382, we need an implementation of a dedicated endpoint for metadata search and JSON will be sent in a request body.

Let's use this same issue for the implementation. Assigning this one to @blokovi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment