Skip to content

Fix broken link to viewset docstring sections in docs - #10070

Open
mohamed-alired wants to merge 1 commit into
encode:mainfrom
mohamed-alired:docs-viewset-docstring-sections
Open

mohamed-alired wants to merge 1 commit into
encode:mainfrom
mohamed-alired:docs-viewset-docstring-sections

Conversation

@mohamed-alired

Copy link
Copy Markdown
Contributor

Description

The "Setting the description" section of Documenting your API tells viewset users to
describe each action using docstring sections "as described in Schemas as documentation:
Examples". That section no longer exists in the schemas guide, so the link
(api-guide/schemas.md#examples) points to a missing anchor and the feature is left
undocumented, although ViewInspector.get_description() still supports it.

This replaces the dead link with a short example of docstring sections, and clarifies
that they set the per-action descriptions in the generated OpenAPI schema, while the
browsable API shows the whole docstring. Actions without a section fall back to the
text before the first section.

I checked the example against the current schema generator: list and retrieve get
their own descriptions and the remaining actions use the general text. mkdocs build --strict passes and no other internal links in the built docs point to missing
anchors apart from an old one in the 3.5 release announcement, which I left unchanged.

The 'Documenting your API' topic pointed viewset users at a
'Schemas as documentation: Examples' section that no longer exists in the
schemas guide, leaving the docstring sections feature undocumented.
Describe it inline with an example, and clarify that the sections apply
to the generated OpenAPI schema, while the browsable API shows the whole
docstring.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants