Skip to content

Conversation

@sh41
Copy link
Contributor

@sh41 sh41 commented Jul 26, 2017

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.

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
Copy link
Member

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

Copy link
Contributor Author

@sh41 sh41 Aug 11, 2017

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.

Copy link
Member

@mysiar mysiar Aug 12, 2017

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
Copy link
Member

@mysiar mysiar Aug 10, 2017

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.

Copy link
Contributor Author

@sh41 sh41 Aug 11, 2017

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.

Copy link
Member

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.

@mysiar mysiar merged commit ccc228f into api-platform:master Aug 15, 2017
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

Successfully merging this pull request may close these issues.

2 participants