-
-
Notifications
You must be signed in to change notification settings - Fork 130
Troubleshooting section #10
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
Conversation
Updated the README with some error messages that came up during the course of trying this out for the first time on an existing API Platform implementation. Most problems were due to using an incorrect entrypoint to start with and then having authentication on the entrypoint and context routes. Hopefully this will save someone else the time in the future.
README.md
Outdated
| In the app directory, generate the files for the resource you want: | ||
|
|
||
| $ api-platform-generate-crud http://localhost src/ --resource foo | ||
| $ api-platform-generate-crud https://demo.api-platform.com/index.jsonld src/ --resource foo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://demo.api-platform.com is enough, no need to add index.jsonld
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://demo.api-platform.com/ is enough for the application but as a user trying to understand what is happening behind the scenes it is quite misleading. Visiting the link in a browser takes you to the swagger documentation. When I saw this I erroneously assumed that the Entrypoint was the same as the documentation link and spent time trying to point the generator at my own implementation's documentation which has a modified path.
If the example documentation had shown https://demo.api-platform.com/index.jsonld I would have visited that link and seen the Entrypoint of the demo system, and with that enlightenment may have been able to save a lot of time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generator doesn't need index.jsonld specified
I had many problems with generating endpoints by this generator but it was always the problem with backend: configuration, cache etc.
README.md
Outdated
| ); | ||
| ``` | ||
|
|
||
| ## Troubleshooting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove all Troubleshooting section
As you can see on https://demo.api-platform.com generator works without any problem.
It is the same case for any other properly working API-Platform based API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main thought behind adding a troubleshooting section is to help when things aren't working properly, or when not connecting to a vanilla unmodified demo installation. For example when attempting to access an API that requires authenticated access to the any of the required paths the output really isn't very clear as to what went wrong.
if this isn't the appropriate place for this I'm happy to refactor/move it or raise the problems i came across as issues so that future users can find them or the root causes can be resolved. I suspect that the vast majority of users will not be looking to generate a against the demo site, they will be looking to generate from their real imperfect implementations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I may suggest, instead writing it to readme file, create new Troubleshooting.md and all this issues/problems can land there.
I can add my experience with custom endpoints with data providers and generator.
Updated the README with some error messages that came up during the course of trying this out for the first time on an existing API Platform implementation. Most problems were due to using an incorrect entrypoint to start with and then having authentication on the entrypoint and context routes. Hopefully this will save someone else the time in the future.