Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Drop coreapi support for DRF 3.17#9583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
TGoddessana wants to merge17 commits intoencode:master
base:master
Choose a base branch
Loading
fromTGoddessana:drop-coreapi-support
Draft
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
17 commits
Select commitHold shift + click to select a range
9f36604
Feat: Add django 5.2 stable version support
TGoddessanaApr 3, 2025
d4cee30
Merge branch 'encode:master' into master
TGoddessanaApr 3, 2025
7c014a3
Merge branch 'encode:master' into master
TGoddessanaMay 3, 2025
30c338a
Chore: drop coreapi from requirements-optionals.txt
TGoddessanaOct 29, 2024
eb1307e
Chore: remove all code in coreapi.py that causes DRF317Warning
TGoddessanaMar 21, 2025
6c74508
Chore: remove all code in filters.py that causes DRF317Warning
TGoddessanaMar 21, 2025
6dc9b44
Chore: remove all code in pagination.py that causes DRF317Warning
TGoddessanaMar 21, 2025
1602403
Refactor: modify the codebase to pass through the pre-commit hooks
TGoddessanaMar 21, 2025
d89df44
Chore: remove coreapi/coreschema import from compat.py
TGoddessanaMar 21, 2025
73b163c
Chore: drop `generateschema` command as REST Framework does not suppo…
TGoddessanaMar 21, 2025
f880850
Chore: drop `SchemaView` from codebase as REST Framework does not sup…
TGoddessanaMar 21, 2025
d43bae2
Chore: drop `coreapi.py, openapi.py` from codebase as REST Framework …
TGoddessanaMar 21, 2025
1e6e4e9
Feat: delete schema-related tests
TGoddessanaJun 3, 2025
f610a05
Feat: drop coreapi support from authtoken
TGoddessanaJun 3, 2025
5873060
Feat: drop SchemaJSRenderer/DocumentationRenderer/CoreJSONRenderer/_B…
TGoddessanaJun 3, 2025
9469638
Feat: drop get_schema_view
TGoddessanaJun 3, 2025
636cd97
Feat: drop all schema-related package
TGoddessanaJun 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletionsrequirements/requirements-optionals.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
# Optional packages which may be used with REST framework.
coreapi==2.3.1
coreschema==0.0.4
django-filter
django-guardian>=2.4.0,<2.5
inflection==0.5.1
Expand Down
28 changes: 0 additions & 28 deletionsrest_framework/authtoken/views.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
from rest_framework import parsers, renderers
from rest_framework.authtoken.models import Token
from rest_framework.authtoken.serializers import AuthTokenSerializer
from rest_framework.compat import coreapi, coreschema
from rest_framework.response import Response
from rest_framework.schemas import ManualSchema
from rest_framework.schemas import coreapi as coreapi_schema
from rest_framework.views import APIView


Expand All@@ -15,31 +12,6 @@ class ObtainAuthToken(APIView):
renderer_classes = (renderers.JSONRenderer,)
serializer_class = AuthTokenSerializer

if coreapi_schema.is_enabled():
schema = ManualSchema(
fields=[
coreapi.Field(
name="username",
required=True,
location='form',
schema=coreschema.String(
title="Username",
description="Valid username for authentication",
),
),
coreapi.Field(
name="password",
required=True,
location='form',
schema=coreschema.String(
title="Password",
description="Valid password for authentication",
),
),
],
encoding="application/json",
)

def get_serializer_context(self):
return {
'request': self.request,
Expand Down
16 changes: 2 additions & 14 deletionsrest_framework/compat.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,32 +23,20 @@ def unicode_http_header(value):
postgres_fields = None


# coreapi is required for CoreAPI schema generation
try:
import coreapi
except ImportError:
coreapi = None

# uritemplate is required for OpenAPI and CoreAPI schema generation
# uritemplate is required for OpenAPI schema generation
try:
import uritemplate
except ImportError:
uritemplate = None


# coreschema is optional
try:
import coreschema
except ImportError:
coreschema = None


# pyyaml is optional
try:
import yaml
except ImportError:
yaml = None


# inflection is optional
try:
import inflection
Expand Down
88 changes: 0 additions & 88 deletionsrest_framework/documentation.py
View file
Open in desktop

This file was deleted.

44 changes: 0 additions & 44 deletionsrest_framework/filters.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,6 @@
returned by list views.
"""
import operator
import warnings
from functools import reduce

from django.core.exceptions import FieldDoesNotExist, ImproperlyConfigured
Expand All@@ -14,8 +13,6 @@
from django.utils.text import smart_split, unescape_string_literal
from django.utils.translation import gettext_lazy as _

from rest_framework import RemovedInDRF317Warning
from rest_framework.compat import coreapi, coreschema
from rest_framework.fields import CharField
from rest_framework.settings import api_settings

Expand DownExpand Up@@ -48,13 +45,6 @@ def filter_queryset(self, request, queryset, view):
"""
raise NotImplementedError(".filter_queryset() must be overridden.")

def get_schema_fields(self, view):
assert coreapi is not None, 'coreapi must be installed to use `get_schema_fields()`'
if coreapi is not None:
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.17', RemovedInDRF317Warning)
assert coreschema is not None, 'coreschema must be installed to use `get_schema_fields()`'
return []

def get_schema_operation_parameters(self, view):
return []

Expand DownExpand Up@@ -186,23 +176,6 @@ def to_html(self, request, queryset, view):
template = loader.get_template(self.template)
return template.render(context)

def get_schema_fields(self, view):
assert coreapi is not None, 'coreapi must be installed to use `get_schema_fields()`'
if coreapi is not None:
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.17', RemovedInDRF317Warning)
assert coreschema is not None, 'coreschema must be installed to use `get_schema_fields()`'
return [
coreapi.Field(
name=self.search_param,
required=False,
location='query',
schema=coreschema.String(
title=force_str(self.search_title),
description=force_str(self.search_description)
)
)
]

def get_schema_operation_parameters(self, view):
return [
{
Expand DownExpand Up@@ -348,23 +321,6 @@ def to_html(self, request, queryset, view):
context = self.get_template_context(request, queryset, view)
return template.render(context)

def get_schema_fields(self, view):
assert coreapi is not None, 'coreapi must be installed to use `get_schema_fields()`'
if coreapi is not None:
warnings.warn('CoreAPI compatibility is deprecated and will be removed in DRF 3.17', RemovedInDRF317Warning)
assert coreschema is not None, 'coreschema must be installed to use `get_schema_fields()`'
return [
coreapi.Field(
name=self.ordering_param,
required=False,
location='query',
schema=coreschema.String(
title=force_str(self.ordering_title),
description=force_str(self.ordering_description)
)
)
]

def get_schema_operation_parameters(self, view):
return [
{
Expand Down
View file
Open in desktop
Empty file.
View file
Open in desktop
Empty file.
71 changes: 0 additions & 71 deletionsrest_framework/management/commands/generateschema.py
View file
Open in desktop

This file was deleted.

Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp