-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add support for non-pretty URLs #8
Comments
Looking through the source, I can see that in https://github.com/georgique/yii2-jsonrpc/blob/master/JsonRpcRequest.php#L157 , the route is re-parsed even though the method has already been determined. If I replace |
Hi @cboulanger, I don't think your conclusion is correct. Line 157 is needed for splitting the route from query parameters, so can't really say it's "reparsed". Would you be able to show values for your $routeParsed and $route at the moment of line 187 execution? |
Hi, thanks for looking into this! Here's a screenshot of my IDE - I am using my fork which replaces |
It might have something to do that these are codeception functional tests that work without a webserver. But they should work anyways. Can you explain what |
@cboulanger Basically $routeParsed has to contain URI before "?" mark. I.e. for $route = "user/view?id=1", $routeParsed should become "user/view" and $params should become ['id' = 1]. |
ok, I think I have an idea what could be the problem. Since my Yii2 app is an API backend and not a html web application which shows the URL, I am not using pretty urls ( |
versions: yii ^2.0.32, codeception ^4.0, codeception config is here. But very likely the problem is the non-pretty-url stuff. I can try and enable it to see if the problem goes away. |
Non-pretty urls explanation sounds like it. If you can try with pretty urls and let me know - that'd be helpful. |
I just enabled pretty urls and after reverting the changes in my fork, my tests started to pass with your original code! It would be great if you could also support the "default URL format". I have one request to add a catch block for |
@cboulanger I'll work on it. Will try to do as soon as possible |
I am still having problems, even with pretty URLs turned on. This time using acceptance tests, where the codeception test suite makes a POST request to the web server. The JSONRPC method is correctly translated into |
Hi, I am just evaluating your library, to replace the no-longer maintained cranetm/yii2-json-rpc-2.0.
I am running functional tests with codeception, making the JSORPC calls to the backend.
Unfortunately, I haven't been successful yet, I am getting
Method georgique\\yii2\\jsonrpc\\Action::run() does not exist
without any usable stack trace.Do you have an idea what could be wrong?
The text was updated successfully, but these errors were encountered: