Skip to content

Commit 454028b

Browse files
committed
Add something for each documented endpoint.
1 parent d3c617d commit 454028b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

flask_autodoc/autodoc.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,16 @@ def html(self, groups='all', template=None, **context):
193193
with current_app.app_context():
194194
return render_template_string(content, **context)
195195

196-
def json(self, groups='all', **context):
196+
def json(self, groups='all'):
197197
"""Return a json object with documentation for all the routes specified
198198
by the doc() method.
199199
200200
By specifiying the groups argument, only routes belonging to those groups
201201
will be returned.
202202
"""
203-
data = {}
203+
autodoc = self.generate(groups=groups)
204+
data = {
205+
'endpoints':
206+
[ "doc" for doc in autodoc ]
207+
}
204208
return jsonify(data)

0 commit comments

Comments
 (0)