Skip to content

Commit 9fbf6df

Browse files
committed
Stub for json method.
1 parent e6631df commit 9fbf6df

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

flask_selfdoc/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

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

0 commit comments

Comments
 (0)