Repository navigation
Fix broken link to viewset docstring sections in docs - #10070
Open
mohamed-alired wants to merge 1 commit into
Open
mohamed-alired wants to merge 1 commit into
mohamed-alired wants to merge 1 commit into
Conversation
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.
browniebroke
approved these changes
Oct 7, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 leftundocumented, 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:
listandretrievegettheir own descriptions and the remaining actions use the general text.
mkdocs build --strictpasses and no other internal links in the built docs point to missinganchors apart from an old one in the 3.5 release announcement, which I left unchanged.