Skip to content

Drop deprecated coreapi support#9895

Open
browniebroke wants to merge 3 commits intoencode:mainfrom
browniebroke:refactor/drop-coreapi
Open

Drop deprecated coreapi support#9895
browniebroke wants to merge 3 commits intoencode:mainfrom
browniebroke:refactor/drop-coreapi

Conversation

@browniebroke
Copy link
Member

@browniebroke browniebroke commented Feb 18, 2026

Description

Note

Most of this PR was AI generated (Claude code). At time of opening this, I haven't had time to carefully review the code myself yet, and will put it in ready for review when I've done so. I've now review it and what is removed makes sense, but I'm not sure if there is more we can/shoul remove...

Opening this as another attempt to do #9583 opening this for visibility in case others are interested.

Testing status:

  • Ran the drf-spectacular test suite against this branch: Test against branch without coreapi browniebroke/drf-spectacular#1
  • Installed the branch on a real project, made sure that the browsable API works as expected, and docs are generated with drf-spectacular and the test suite passes
  • Same as above on another project
  • Anything else...? Suggestions welcome

FYI @TGoddessana as you started the original PR (do you still have the old commits somewhere?)

Give this a spin

If you want to install this branch on your project:

uv add https://github.com/browniebroke/django-rest-framework/archive/refactor/drop-coreapi.tar.gz

refs #8453

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the deprecated CoreAPI-based schema/documentation stack from Django REST framework, leaving OpenAPI as the only built-in schema generation/rendering path and cleaning up associated tests, templates, and optional dependencies.

Changes:

  • Remove CoreAPI schema generation, renderers, docs views/templates/assets, and the CoreAPIClient.
  • Simplify schema views/management command to OpenAPI-only behavior.
  • Delete CoreAPI-focused tests and update remaining tests to match the new surface area.

Reviewed changes

Copilot reviewed 44 out of 49 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/urls.py Removes docs URLConf usage; leaves empty urlpatterns for test suite.
tests/test_templatetags.py Removes CoreAPI templating tests and related imports.
tests/test_renderers.py Removes DocumentationRenderer/SchemaJSRenderer/CoreAPI renderer tests and imports.
tests/test_filters.py Removes CoreAPI schema field testing and mocks tied to CoreAPI.
tests/test_encoders.py Removes JSONEncoder behavior test specific to coreapi objects.
tests/test_api_client.py Deletes CoreAPIClient integration tests and fixtures.
tests/schemas/test_managementcommand.py Removes CoreAPI mode tests; keeps OpenAPI management command coverage.
tests/schemas/test_get_schema_view.py Removes CoreAPI schema view test path; keeps OpenAPI assertions.
tests/schemas/test_coreapi.py Deletes the CoreAPI schema generator/inspector test suite.
rest_framework/utils/encoders.py Removes JSONEncoder special-casing of coreapi Document/Error objects.
rest_framework/test.py Removes CoreAPIClient from the testing utilities module.
rest_framework/templatetags/rest_framework.py Removes CoreAPI-docs-specific template tags/filters.
rest_framework/templates/rest_framework/schema.js Deletes CoreAPI schema JS bootstrap template.
rest_framework/templates/rest_framework/docs/sidebar.html Deletes legacy interactive docs sidebar template.
rest_framework/templates/rest_framework/docs/link.html Deletes legacy interactive docs endpoint template.
rest_framework/templates/rest_framework/docs/langs/shell.html Deletes CoreAPI CLI snippet template.
rest_framework/templates/rest_framework/docs/langs/shell-intro.html Deletes CoreAPI CLI install snippet template.
rest_framework/templates/rest_framework/docs/langs/python.html Deletes CoreAPI Python client snippet template.
rest_framework/templates/rest_framework/docs/langs/python-intro.html Deletes CoreAPI Python client install snippet template.
rest_framework/templates/rest_framework/docs/langs/javascript.html Deletes CoreAPI JS client snippet template.
rest_framework/templates/rest_framework/docs/langs/javascript-intro.html Deletes CoreAPI JS client loading snippet template.
rest_framework/templates/rest_framework/docs/interact.html Deletes interactive “try it” modal template.
rest_framework/templates/rest_framework/docs/index.html Deletes legacy interactive docs index template.
rest_framework/templates/rest_framework/docs/error.html Deletes legacy docs error template.
rest_framework/templates/rest_framework/docs/document.html Deletes legacy docs document layout template.
rest_framework/templates/rest_framework/docs/auth/token.html Deletes legacy docs token auth modal template.
rest_framework/templates/rest_framework/docs/auth/session.html Deletes legacy docs session auth modal template.
rest_framework/templates/rest_framework/docs/auth/basic.html Deletes legacy docs basic auth modal template.
rest_framework/static/rest_framework/docs/js/jquery.json-view.min.js Deletes legacy docs JSON viewer dependency.
rest_framework/static/rest_framework/docs/js/api.js Deletes legacy docs interactive client JS.
rest_framework/static/rest_framework/docs/img/grid.png Removes legacy docs image asset.
rest_framework/static/rest_framework/docs/img/favicon.ico Removes legacy docs favicon asset.
rest_framework/static/rest_framework/docs/css/jquery.json-view.min.css Deletes legacy docs JSON viewer CSS.
rest_framework/static/rest_framework/docs/css/highlight.css Deletes legacy docs syntax highlight CSS.
rest_framework/static/rest_framework/docs/css/base.css Deletes legacy docs base styling.
rest_framework/schemas/views.py Makes SchemaView renderer selection OpenAPI-only.
rest_framework/schemas/coreapi.py Deletes CoreAPI schema generator/inspectors module.
rest_framework/schemas/init.py Removes CoreAPI exports/selection logic; exports OpenAPI AutoSchema/SchemaGenerator.
rest_framework/renderers.py Deletes CoreAPI renderers + documentation renderer/SchemaJS renderer implementations.
rest_framework/pagination.py Removes CoreAPI get_schema_fields() hooks from pagination classes.
rest_framework/management/commands/generateschema.py Removes CoreAPI modes/format options; OpenAPI-only output.
rest_framework/filters.py Removes CoreAPI get_schema_fields() hooks from filter backends.
rest_framework/documentation.py Deletes legacy docs URL helpers (include_docs_urls, etc.).
rest_framework/compat.py Removes optional coreapi/coreschema shims; keeps uritemplate/yaml/requests optionals.
rest_framework/authtoken/views.py Removes CoreAPI ManualSchema definition from token view.
rest_framework/init.py Removes RemovedInDRF318Warning deprecation warning class.
pyproject.toml Removes CoreAPI-related optional deps; adjusts dependency groups (adds requests, adds uritemplate).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 46 out of 51 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@browniebroke browniebroke added this to the 3.17 milestone Feb 19, 2026
@browniebroke browniebroke marked this pull request as ready for review February 19, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments