You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a ViewSetlist_route that is setup for GET using query parameters. The CoreAPI schema generator does not include these serializer fields in the schema but I think they should be considered for inclusion (although I'm not entirely sure how one would go about determining that 😊)
I know that filter_fields will be included in the schema, however, essentially this list_route is more of a RPC action related to the collection, rather than an action that returns a list.
There's no way we'd be able to automatically determine when we should do this.
However, the version-3-5 branch now includes plenty of improvements to the schema generation API. We'll be documenting these in order to ensure that they're fully customizable.
@tomchristie I think there is a way to determine which fields are associated to @list_route decorated view. For example, it's possible to define filter_class as well as serializer_class and take those fields from associated filter class. But the problem is deeper: @list_route decorated view are not treated as list view in is_list_view() method here https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/schemas.py#L137 during schema generation. And as result fields are not collected from get_pagination_fields() and get_filter_fields()at all.
@ramusus feel free to open a PR if you think you can get something working. I'm also considering working on "less obvious" cases for documentation / schema generation though I can't commit to anything.
I have a
ViewSet
list_route
that is setup forGET
using query parameters. TheCoreAPI
schema generator does not include these serializer fields in the schema but I think they should be considered for inclusion (although I'm not entirely sure how one would go about determining that 😊)I know that
filter_fields
will be included in the schema, however, essentially thislist_route
is more of a RPC action related to the collection, rather than an action that returns a list.The text was updated successfully, but these errors were encountered: