Closed zengoma closed 7 years ago
I think there is no problem with oauthlib, the problem is that your querystring is not correctly urlencoded. Try this: filter=%5B%7B%22name%22%3A+%22owner%22%2C+%22val%22%3A+%7B%22name%22%3A+%22id%22%2C+%22val%22%3A+1%2C+%22op%22%3A+%22eq%22%7D%2C+%22op%22%3A+%22has%22%7D%5D
and tell me if it solves your problem
You must use urlencode from urllib to generate your querystring. Example:
>>> s = [{"name":"owner","op":"has","val":{"name":"id","op":"eq","val":1}}]
>>> import json
>>> j = json.dumps(s)
>>> result = {"filter": j}
>>> urlencode(result)
'filter=%5B%7B%22name%22%3A+%22owner%22%2C+%22val%22%3A+%7B%22name%22%3A+%22id%22%2C+%22val%22%3A+1%2C+%22op%22%3A+%22eq%22%7D%2C+%22op%22%3A+%22has%22%7D%5D'
@akira-dev You're right, I am an idiot. I should have just read the first line of the stack trace. I just assumed that postman was url-encoding automatically. Cancelling the pull request. Thank you!
Hey. I've picked up an issue while trying to pass filter params while using flask-oauthlib. This is not an issue with flask-rest-jsonapi, but with the oauthlib 2.0.2 library. I am however giving you a heads up as it directly affects the functioning of this package. When trying to pass the following characters in "{}[]" in filter request you will recieve the following error:
I managed to resolve the issue by modifying oauthlib and have created a pull request here: https://github.com/idan/oauthlib/pull/477 . Anyone wanting to continue development may implement this until it hopefully gets pulled into the master.