Skip to content

Commit 840a29a

Browse files
carltongibsonPierre Chiquet
authored andcommitted
Note AutoSchema limitations on bare APIView (encode#5649)
AutoSchema uses GenericAPIView hooks to introspect. If these are not present it’s results will be limited. Note this. Closes encode#5121
1 parent e4ce07f commit 840a29a

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)
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