Project

Profile

Help

Issue #3283

closed

Descriptions for actions are based on docstring

Added by daviddavis almost 7 years ago. Updated almost 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

Looks like drf maps docstring for viewset actions to a description field in the api schema. For example, our artifacts delete action looks like this in the api schema:

                "delete": {
                    "_type": "link",
                    "action": "delete",
                    "description": "Remove :class:`~pulpcore.app.models.Artifact` only if it is not associated with any\n`~pulpcore.app.models.Content`\n\nArgs:\n    request (:class:`rest_framework.request.Request`): request containing JSON payload\n        with information about the artifact being deleted.\n    pk (:class:`uuid.UUID`): Unique id of the artifact being deleted.\n\nReturns:\n    :class:`rest_framework.response.Response` with a 204 status code in case of\n        successful deletion, 409 status code if deletion is not allowed.",
...
}

This is from the docstring on the action here:

https://github.com/pulp/pulp/blob/3.0-dev/pulpcore/pulpcore/app/viewsets/content.py#L86-L98

This is probably not very friendly for API users. Not sure what the solution here is.

Other endpoints with this problem include content create, status, etc.


Related issues

Blocks Pulp - Story #3218: As an authenticated user, I can list repository version content, added content, removed contentCLOSED - CURRENTRELEASEdaviddavis

Actions

Also available in: Atom PDF