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

filter and fields don't work #28

Closed
jbockerstette opened this issue May 10, 2016 · 4 comments
Closed

filter and fields don't work #28

jbockerstette opened this issue May 10, 2016 · 4 comments

Comments

@jbockerstette
Copy link

Basic GET and POST work but passing the filter or fields parameters cause 403 error.

@pmcnr-hx
Copy link
Contributor

Hi @jbockerstette can you please supply an example of the request you're making so we can reproduce your issue.

@jbockerstette
Copy link
Author

Pedro,

Here is the real problem.

If you paste this into the browser it works as expected.
http://107.170.10.170:16006/1/articles?fields[articles]=title

However, if you use swagger.io UI, swagger turns the above statement to
this:
http://107.170.10.170:16006/1/articles?fields=%5Barticles%5D%3Dtitle

swagger encodes the brackets and equals into %5B, %5D and %3D. It appears
that this encoding is breaking it. Maybe all you need to do is decode it
before processing.

I apologize for poor problem definition previously.

Jim

On Tue, May 10, 2016 at 8:36 AM, Jim Bockerstette <
jim.bockerstette@gmail.com> wrote:

curl -X GET --header 'Accept: application/vnd.api+json' 'http://107.170.10.170:16006/1/articles?fields=title

  1. Should this just return titles only? It returns all articles and all fields.

http://107.170.10.170:16006/1/articles?filter=title%3D%3D%22NodeJS%20Best%20Practices%22

  1. Shouldnt this return only articles with title = "Node JS Best Practices"?

It returns this:

{
"jsonapi": {
"version": "1.0"
},
"meta": {
"description": "This block shows up in the root node of every payload"
},
"links": {
"self": "http://localhost:16006/1/articles"
},
"errors": [
{
"status": "403",
"code": "EFORBIDDEN",
"title": "Invalid filter",
"detail": "articles do not have property 0"
}
]
}

On Mon, May 9, 2016 at 10:27 PM, Pedro Romano notifications@github.com
wrote:

Hi @jbockerstette https://github.com/jbockerstette can you please
supply an example of the request you're making so we can reproduce your
issue.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#28 (comment)

@pmcnr-hx
Copy link
Contributor

Thank you very much for the detective work Jim! I believe you are right and we're not urldecoding the query parameters as we should. I'll close the issue here and open it instead in the jsonapi-store project where it needs to be solved.

@jbockerstette
Copy link
Author

Agreed.
On May 10, 2016 12:35 PM, "Pedro Romano" notifications@github.com wrote:

Thank you very much for the detective work Jim! I believe you are right
and we're not urldecoding the query parameters as we should. I'll close the
issue here and open it instead in the jsonapi-store
https://github.com/holidayextras/jsonapi-server project where it needs
to be solved.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#28 (comment)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants