Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary information from API docs #3209

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions api/api/docs/base_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
from drf_spectacular.utils import OpenApiExample, extend_schema


refer_curl = (
"You can refer to the cURL request samples "
"for examples on how to consume this endpoint."
)


def fields_to_md(field_names):
"""
Create a Markdown representation of the given list of names to use in Swagger docs.
Expand All @@ -30,7 +24,7 @@ def custom_extend_schema(**kwargs):
description = kwargs.pop("desc", None)
if description:
description = dedent(description)
extend_args["description"] = f"{description}\n\n{refer_curl}"
extend_args["description"] = f"{description}"

parameters = kwargs.pop("params", [])
if not isinstance(parameters, list):
Expand Down Expand Up @@ -73,7 +67,7 @@ class MediaSchema(AutoSchema):
"""

def get_description(self) -> str:
return f"""{super().get_description()}\n\n{refer_curl}"""
return f"""{super().get_description()}"""

def get_operation_id(self) -> str:
operation_tokens = super().get_operation_id().split("_")[0:-1]
Expand Down
Loading