-
-
Notifications
You must be signed in to change notification settings - Fork 527
Closed
Description
@api.get(
"/errors_in_docstring",
# response={codes_2xx: Error1, codes_3xx: Error2}, <-- not needed
)
def errors_in_docstring(request, code: int):
"""
Raises:
Error1: error 1
Error2: error 2
"""
if code in codes_2xx:
raise Error1
if code in codes_3xx:
raise Error2
return code, "1"
Not only would it feel more pythonic but when combined with docstring-extraneous-exception (DOC502) and docstring-missing-exception (DOC501) you can do some enforcement that errors are properly documented
Metadata
Metadata
Assignees
Labels
No labels