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

[Search] Handle slash in string query #152

Closed
Remonade opened this issue May 27, 2018 · 4 comments
Closed

[Search] Handle slash in string query #152

Remonade opened this issue May 27, 2018 · 4 comments

Comments

@Remonade
Copy link

Hello,

Is there any way to use a query string that contains slash ?
Example : https://api.jikan.moe/search/anime/Fate/Zero

If there isn't, would it be possible to handle them ?

@irfan-dahir
Copy link
Collaborator

Hi,

I would suggest URL Encoding the query like so: https://api.jikan.moe/search/anime/fate%2Fzero
But that is causing an issue, I'll look into it and see if I can have it allow encoded slashes.

Meanwhile, you could search by

@irfan-dahir
Copy link
Collaborator

Upon further checking, it's not possible to allow slashes in the current URL structure. This is an issue that originates from the router, Lumen/Laravel, itself that I'm using for the REST API.
laravel/framework#22125

Albeit, I've gone ahead and pushed a fix for this. You can request anything with slashes by URL/Percent Encoding by assigning a value to the q key in the URL.

Note, this won't work by the default structure for pagination. So you'll have to use page.

@Remonade
Copy link
Author

Just tried, and it works perfectly ! Thank you for your very quick fix.

@irfan-dahir
Copy link
Collaborator

You're welcome!

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