-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Incorrect path generated for calls to API #11
Comments
@sh41 did you try to run it on your own api or just above demo ? |
@mysiar I've not succeeded in getting generation to work correctly against my own API so was trying against the API Platform demo to check that I am using the tool correctly. I think that I may have a separate issue with my own API as it is an API-platofrm install that is under a subroute and I think that is causing an issue somewhere, I'm still researching that problem though. If the problem is not reproducible against the demo system on someone else's set up it probably means my environment is incorrect. Does the generator work correctly for you against the demo site? Thanks |
@sh41 looks like generator doesn't procude right code but it might be the problem with demo version. |
@sh41 try this link http://api.geomysiar.pl |
Thanks for your help - looks like it must be something my particular environment:
|
tested on two different api-platform instances and all looks ok
|
Thanks again, I will try to isolate what is different on my setup so that I can document it for future users. We ran node in a docker container which is still around somewhere so should be easy enough to find if it is a problem with a particular version of a package. |
I've gone back and run this in a clean docker container and get the same result:
and in the output of grep I see:
by going through the code and adding some console logs I narrowed it down to the
works fine, but if there is a trailing slash on the entrypoint URL
it takes off the first letter of the paths and does not work. Not sure if this is user error, or a bug. Happy to close if this is expected behaviour? |
it is not expected behavior, I work win node 6, will try to run test on 7 & 8 |
Have run the same in docker containers for versions node:7.10.1, node:6.11.2 and node:4.84 and had the same result. In each case removing the trailing slash resolves the problem. |
@sh41 it is not expected behaviour but generator README says
and there is no traililing slash, so thats explains and solves the problem for now |
solved at api-platform/api-doc-parser#18 |
Reproduction steps:
Install as per README.
run
Result:
Expected result:
When the react-app is run a message of
Unexpected token < in JSON at position 0
appears on the list page and on submission of a create form.This can be manually fixed by correcting the strings in the relevant
create.js
andlist.js
files.The text was updated successfully, but these errors were encountered: