def _process_rule(self, rule):
path = {}
view_func = self.app.view_functions[rule.endpoint]
schema = self._extract_schema(view_func)
if schema:
path['parameters'] = [{
'in': 'body',
'name': 'payload',
'schema': schema
}]
with suppress(AttributeError):
path['responses'] = view_func.responses
add_optional(path, 'description', self._extract_description(view_func))
add_optional(
path,
'deprecated',
getattr(view_func, 'deprecated', None))
with suppress(AttributeError):
path['tags'] = sorted(view_func.tags)
return path
评论列表
文章目录