Пример #1
0
 def test_params(self, app, path):
     params = path['get']['parameters']
     rule = app.url_map._rules_by_endpoint['get_band'][0]
     expected = (
         swagger.args2parameters({'name': Arg(str)}, default_in='query') +
         rule_to_params(rule)
     )
     assert params == expected
Пример #2
0
 def get_parameters(self, rule, view, docs, parent=None):
     __args__ = resolve_annotations(parent, getattr(view, '__args__'))
     return swagger.args2parameters(
         __args__.get('args', {}),
         default_in=__args__.get('default_in'),
     ) + rule_to_params(rule, docs.get('params'))