Skip to content

Unable to write a description for a serializer that extends serializers.ChoiceField using docstrings #1476

Description

@ldeluigi

Describe the bug
While I can use python docstrings to customize the text description of my serializers, I have one that I can't. That's the only one inheriting from serializers.ChoiceField.

To Reproduce

class MySerializer(serializers.ChoiceField):
    '''i want this to appear in the swagger schema'''
    def __init__(self, **kwargs):
        super().__init__(MyChoices.choices, **kwargs)

Expected behavior
The docstring should appear as description in the openapi schema, but it doesn't

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions