django-rest-framework/rest_framework
Kevin Brown 86c72bb226 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.
2019-03-07 11:26:03 +01:00
..
authtoken Drop Django 1.10 support (#5657) 2018-07-06 12:14:31 +02:00
locale Version 3.7.4 Release (#5650) 2017-12-20 15:28:31 +01:00
management Deferred schema renderer creation to avoid requiring pyyaml. (#6416) 2019-01-24 16:01:06 +01:00
schemas Fix schema generation of ManyRelatedField to detect the child type (#6489) 2019-03-07 11:26:03 +01:00
static/rest_framework Remove executable bit from static assets (#6484) 2019-03-03 18:39:08 +00:00
templates/rest_framework Made templates compatible with session-based CSRF. (#6207) 2019-02-19 12:15:03 +01:00
templatetags Fix XSS caused by disabled autoescaping in the default DRF Browsable API view templates (#6330) 2019-01-16 12:36:25 +00:00
utils Allowed Q objects in limit_choices_to introspection. (#6472) 2019-02-25 10:49:29 +00:00
__init__.py Update version for v3.9.2 release. 2019-03-03 20:16:16 +01:00
apps.py Make DEFAULT_PAGINATION_CLASS None by default. (#5170) 2017-09-25 15:36:30 +02:00
authentication.py Fix CSRF cookie check failure when using session auth with django 1.11.6+ (#6113) 2018-08-07 08:18:56 +01:00
checks.py Clarify pagination system check (#5524) 2017-10-23 12:31:59 +02:00
compat.py Added lazy evaluation to composed permissions. (#6463) 2019-02-25 13:47:02 +01:00
decorators.py Introduce RemovedInDRF…Warning classes to simplify deprecations. (#6480) 2019-03-03 09:20:45 +01:00
documentation.py Allowed customising API documentation code samples (#5752) 2018-01-25 09:39:03 +01:00
exceptions.py Allow hashing of ErrorDetail to fix #5919 (#5932) 2018-04-20 15:32:37 +02:00
fields.py Replace type('') with six.text_type (#6482) 2019-03-05 12:11:46 +01:00
filters.py Introduce RemovedInDRF…Warning classes to simplify deprecations. (#6480) 2019-03-03 09:20:45 +01:00
generics.py Add ValidationError to except in get_object_or_404 for django 1.11 2017-05-05 21:17:12 -04:00
metadata.py Don't show hidden fields in metadata (#5854) 2018-03-23 22:47:10 +00:00
mixins.py Ensure Location header is strictly a 'str', not subclass. Closes #5541 (#5544) 2017-10-30 13:08:52 +00:00
negotiation.py Fixed various typos (#4366) 2016-08-08 09:32:22 +01:00
pagination.py Prefer https:// for URLs when available throughout project (#6208) 2018-10-02 08:28:58 +02:00
parsers.py Upgrade isort (#5817) 2018-02-14 20:12:14 +00:00
permissions.py Add negation ~ operator to permissions composition (#6361) 2019-02-25 15:33:40 +01:00
relations.py Replace type('') with six.text_type (#6482) 2019-03-05 12:11:46 +01:00
renderers.py compat: (py2) urlparse = urllib.parse (py3) (#6262) 2019-01-08 12:03:02 +00:00
request.py Prefer io.BytesIO over six; available on all supported Pythons (#6168) 2018-09-09 11:53:41 +01:00
response.py Drop unnecessary TODO notes. 2017-09-14 09:44:59 +01:00
reverse.py Upgrade isort (#5817) 2018-02-14 20:12:14 +00:00
routers.py Introduce RemovedInDRF…Warning classes to simplify deprecations. (#6480) 2019-03-03 09:20:45 +01:00
serializers.py Adjusted field validators to accept iterables. (#6282) 2019-02-19 16:38:20 +01:00
settings.py Prefer https:// for URLs when available throughout project (#6208) 2018-10-02 08:28:58 +02:00
status.py Prefer https protocol for links in docs when available 2018-01-15 15:15:21 +01:00
test.py Upgrade isort (#5817) 2018-02-14 20:12:14 +00:00
throttling.py Fix typo in docstring (#5678) 2017-12-19 08:45:33 +01:00
urlpatterns.py Fix format_suffix_patterns behavior with Django 2 path() routes (#5691) 2017-12-20 13:17:54 +01:00
urls.py Drop Django 1.10 support (#5657) 2018-07-06 12:14:31 +02:00
validators.py Fix whitespace in imports 2017-11-25 21:10:30 -05:00
versioning.py Use Default Version in URLPathVersioning if 'version' Didn't Specified by Client (#6380) 2019-01-08 11:34:54 +00:00
views.py Explicitly raise exc in 'raise_uncaught_exception' (#6435) 2019-03-07 09:44:20 +00:00
viewsets.py Fix action support for ViewSet suffixes (#6081) 2018-10-02 16:22:21 +02:00