Skip to content

Still can not document parameters with the doc string in custom detail/list view? #6035

@daimon99

Description

@daimon99

Usually we need add custom detail/list view in the viewset.
And it has custom parameters which different from the serializer object.
So, how we document for the custom detail/list view function?
I see the formal document, it seems suggest i do like this:

class XXXViewset:
    schema = AutoSchema(manual_fields=[
            coreapi.Field("extra_field", ...),
        ])

But if we do like this, all the methods will have this field, not only the custom action.
How to add specific fields to a specific action?
Is there an easy way? How about describe it in the doc string in this function?
I think it will be the humanic way to document a custom detail/list view.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy