Pagination OpenAPI schemas should mark fields as required
Checklist
- [ ] Raised initially as discussion #...
- [x] This cannot be dealt with as a third party library. (We prefer new functionality to be in the form of third party libraries where possible.)
- [x] I have reduced the issue to the simplest possible case.
Description
The schema for paginated responses should mark fields as required as there are no cases where an Ok response omits any of the fields. They are correctly marked nullable: true, but they should also be set to required. This causes OpenAPI client generators to generate nullable properties for count and results on the LimitOffsetPagination response.
Example of schema without required fields. The OpenAPI schema for these paginators should set fields to be required so clients can assume they are always present to match the actual behavior of paginated responses.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is there any chance this ticket will ever be addressed?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
if anyone contribute, then might be yes, but if not, DRF now suggest using drf-spectacular as default schema tool