Skip to content

Commit

Permalink
Drop deprecated AutoSchema._get_reference method (#9525)
Browse files Browse the repository at this point in the history
As well the unused RemovedInDRF316Warning
  • Loading branch information
browniebroke authored Jan 29, 2025
1 parent f8dbea1 commit 038670a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
4 changes: 0 additions & 4 deletions rest_framework/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,5 @@
ISO_8601 = 'iso-8601'


class RemovedInDRF316Warning(DeprecationWarning):
pass


class RemovedInDRF317Warning(PendingDeprecationWarning):
pass
12 changes: 1 addition & 11 deletions rest_framework/schemas/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
from django.db import models
from django.utils.encoding import force_str

from rest_framework import (
RemovedInDRF316Warning, exceptions, renderers, serializers
)
from rest_framework import exceptions, renderers, serializers
from rest_framework.compat import inflection, uritemplate
from rest_framework.fields import _UnvalidatedField, empty
from rest_framework.settings import api_settings
Expand Down Expand Up @@ -721,11 +719,3 @@ def get_tags(self, path, method):
path = path[1:]

return [path.split('/')[0].replace('_', '-')]

def _get_reference(self, serializer):
warnings.warn(
"Method `_get_reference()` has been renamed to `get_reference()`. "
"The old name will be removed in DRF v3.16.",
RemovedInDRF316Warning, stacklevel=2
)
return self.get_reference(serializer)

0 comments on commit 038670a

Please sign in to comment.