Skip to content

Commit 68844cb

Browse files
committed
Note AutoSchema limitations on bare APIView
AutoSchema uses GenericAPIView hooks to introspect. If these are not present it’s results will be limited. Note this. Closes #5121
1 parent a0cdba6 commit 68844cb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/api-guide/schemas.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,18 @@ appropriate Core API `Link` object for the view, request method and path:
167167
(In compiling the schema, `SchemaGenerator` calls `view.schema.get_link()` for
168168
each view, allowed method and path.)
169169

170+
---
171+
172+
**Note**: For basic `APIView` subclasses, default introspection is essentially
173+
limited to the URL kwarg path parameters. For `GenericAPIView`
174+
subclasses, which includes all the provided class based views, `AutoSchema` will
175+
attempt to introspect serialiser, pagination and filter fields, as well as
176+
provide richer path field descriptions. (The key hooks here are the relevant
177+
`GenericAPIView` attributes and methods: `get_serializer`, `pagination_class`,
178+
`filter_backends` and so on.)
179+
180+
---
181+
170182
To customise the `Link` generation you may:
171183

172184
* Instantiate `AutoSchema` on your view with the `manual_fields` kwarg:

0 commit comments

Comments
 (0)