Skip to content

Commit

Permalink
Clean up descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ljodal committed Jul 26, 2023
1 parent edb0f3f commit 4faab04
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django_api_decorator/openapi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import dataclasses
import logging
import re
import textwrap
from collections.abc import Callable, Sequence
from typing import Any, cast

Expand Down Expand Up @@ -158,7 +159,7 @@ def to_ref_if_object(schema: dict[str, Any]) -> dict[str, Any]:
"operationId": view_name,
# Note: We could consider allowing users to pass a description into
# @api() instead of using the function docstring.
"description": callback.__doc__ or "",
"description": textwrap.dedent(callback.__doc__ or "").strip(),
# Tags are useful for grouping operations in codegen
"tags": [app_name],
"parameters": parameters,
Expand Down

0 comments on commit 4faab04

Please sign in to comment.