SACGF / SACGF/variantgrid

Django REST framework - remove format_suffix_patterns and include_docs_urls

Open
#1,375 1 comment 0 reactions 1 assignee Claimed by @davmlaw View on GitHub
Dominant language
Python
Stars
30
Forks
3
Avg merge
9h 28m
Merged PRs (30d)
42

Description

**format_suffix_patterns**

We used DRFs `format_suffix_patterns` helper to allow URLs such as `/api/endpoint.json`. This caused duplicate routes for every endpoint (e.g., `/api/endpoint/` and `/api/endpoint.json`), which led to schema generation warnings about duplicated `operationId` values and unnecessary route complexity. Modern DRF no longer requires these suffixes since content negotiation is handled automatically through the `Accept` header or the `?format=` query parameter. To simplify the API and eliminate schema duplication, `format_suffix_patterns` has been removed. Clients should now request specific formats via headers or query parameters instead of file extensions.

**include_docs_urls**

DRFs `include_docs_urls` to provide interactive API documentation. However, this utility depends on the deprecated CoreAPI and CoreJSON libraries, which have been removed from DRF and are now unmaintained. Continuing to use them generated deprecation warnings.

`include_docs_urls` was replaced with DRF’s built-in OpenAPI schema view

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.