Skip to content

Commit fd72a81

Browse files
authored
Merge pull request #5073 from khakulov/patch-1
Clarify get_schema_fields signature
2 parents 853f393 + 613aa61 commit fd72a81

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

docs/api-guide/filtering.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,11 @@ The method should return a rendered HTML string.
432432
## Pagination & schemas
433433

434434
You can also make the filter controls available to the schema autogeneration
435-
that REST framework provides, by implementing a `get_schema_fields()` method,
436-
which should return a list of `coreapi.Field` instances.
435+
that REST framework provides, by implementing a `get_schema_fields()` method. This method should have the following signature:
436+
437+
`get_schema_fields(self, view)`
438+
439+
The method should return a list of `coreapi.Field` instances.
437440

438441
# Third party packages
439442

docs/api-guide/pagination.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,11 @@ API responses for list endpoints will now include a `Link` header, instead of in
279279
## Pagination & schemas
280280

281281
You can also make the pagination controls available to the schema autogeneration
282-
that REST framework provides, by implementing a `get_schema_fields()` method,
283-
which should return a list of `coreapi.Field` instances.
282+
that REST framework provides, by implementing a `get_schema_fields()` method. This method should have the following signature:
283+
284+
`get_schema_fields(self, view)`
285+
286+
The method should return a list of `coreapi.Field` instances.
284287

285288
---
286289

0 commit comments

Comments
 (0)