acoomans / flask-autodoc

Flask autodoc automatically creates an online documentation for your flask application.
MIT License
98 stars 49 forks source link

Add an example of an API generated using Flask-Restless. #20

Closed jwg4 closed 9 years ago

jwg4 commented 9 years ago

This example shows how to do an important use case - generating several endpoints using a Flask plugin for REST APIs, then programmatically decorating all the endpoints with doc().

This example is closely based on the simple example. However, it has two requirements extra to the requirement for Flask of the main package - Flask-Restless and Flask-SQLAlchemy. It doesn't seem like these should be added to the requirements.txt of the main package.

lukeyeager commented 9 years ago

I tried running this example, but all I get is a 404 on http://127.0.0.1/. What URL am I supposed to go to? What is the example supposed to show? I was expecting to see a route for documentation like in the simple example.

Your solution doesn't work for Python3 by the way. Not sure what's up with TravisCI today, but it'll show you that once the tests run.

jwg4 commented 9 years ago

There is a line missing, I will correct and add a comment to make it clear how it should work and re-submit.

 On Wednesday, 9 September 2015, 1:11, Luke Yeager <notifications@github.com> wrote:

I tried running this example, but all I get is a 404 on http://127.0.0.1/. What URL am I supposed to go to? What is the example supposed to show? I was expecting to see a route for documentation like in the simple example.Your solution doesn't work for Python3 by the way. Not sure what's up with TravisCI today, but it'll show you that once the tests run.— Reply to this email directly or view it on GitHub.

jwg4 commented 9 years ago

Just to be clear, do you think that this would be useful in the examples/ folder, if fixed? I am happy to resubmit the PR, but I understand if this just isn't needed inside the main flask-autodoc repo, and I could create the example as a gist or similar. Let me know.

lukeyeager commented 9 years ago

Good point, this probably makes more sense as gist than an example. There are only really two relevant lines in the whole example showing the interaction between Flask-Restless and Flask-Autodoc.