  from rest_framework.utils import formatting
  from rest_framework.views import APIView
  from rest_framework.viewsets import GenericViewSet, ModelViewSet
  
  from .models import BasicModel, ForeignKeySource
  
  factory = APIRequestFactory()
  
  
  class MockUser(object):
 
</s> remove             items=coreschema.String(),
 </s> add             items=related_field_schema,
from .models import BasicModel, ForeignKeySource, ManyToManySource
  from rest_framework.utils import formatting
  from rest_framework.views import APIView
  from rest_framework.viewsets import GenericViewSet, ModelViewSet
  
from .models import BasicModel, ForeignKeySource, ManyToManySource
  
  factory = APIRequestFactory()
  
  
  class MockUser(object):
keep keep keep keep replace keep keep keep keep keep
 Fix schema generation of `ManyRelatedField` to detect the child type (#6489)

* Introspect ManyRelatedField data type recursively

For all `ManyRelatedField` objects, we were assuming that the inner type was always a `String`. While this may be true for the default output, a `ManyRelatedField` is a wrapper for a lot of other classes which includes more than just strings. This should allow us to document lists of things other than strings.

* Added test for schemas for many-to-many fields

This adds a test that makes sure we generate the schema for a many-to-many field such that it actually has the right type. For some reason we did not previously have any tests for schema generation that included them, so hopefully this will prevent any future issues from popping up.

This should serve as a regression test for the `items` field on to-many relationships, which was previously forced to a `String` even though in most cases it is a different inner type within the array. 
tests/test_schemas.py