Skip to content

Commit 8507827

Browse files
committed
Stub for json method.
1 parent 6c77c89 commit 8507827

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

flask_autodoc/autodoc.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import sys
66
import inspect
77

8-
from flask import current_app, render_template, render_template_string
8+
from flask import current_app, render_template, render_template_string, jsonify
99
from jinja2 import evalcontextfilter
1010

1111

@@ -192,3 +192,13 @@ def html(self, groups='all', template=None, **context):
192192
content = file.read()
193193
with current_app.app_context():
194194
return render_template_string(content, **context)
195+
196+
def json(self, groups='all', **context):
197+
"""Return a json object with documentation for all the routes specified
198+
by the doc() method.
199+
200+
By specifiying the groups argument, only routes belonging to those groups
201+
will be returned.
202+
"""
203+
data = {}
204+
return jsonify(data)

0 commit comments

Comments
 (0)