Skip to content

Commit 0a67e08

Browse files
author
Martin Zihlmann
committed
mypy
1 parent 35b7c44 commit 0a67e08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/apispec_webframeworks/flask.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ def path_helper(
141141
**kwargs: Any,
142142
) -> Optional[str]:
143143
"""Path helper that allows passing a Flask view function."""
144-
assert view is not None or rule is not None
145144
assert operations is not None
146145

147146
if rule is None:
147+
assert view is not None
148148
rule = self._rule_for_view(view, app=app)
149149
if view is None:
150150
view = self._view_for_rule(rule, app=app)
@@ -153,7 +153,7 @@ def path_helper(
153153
doc_operations = {
154154
k: v
155155
for k, v in doc_operations.items()
156-
if k.upper() in rule.methods or k.startswith("x-")
156+
if rule.methods is None or k.upper() in rule.methods or k.startswith("x-")
157157
}
158158
operations.update(doc_operations)
159159
if hasattr(view, "view_class") and issubclass(view.view_class, MethodView): # noqa: E501

0 commit comments

Comments
 (0)