You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.
With a debug statement inserted at line 238 of docgenerator.py, I see that swagger is introspecting all the different serializers I have declared. But it also, at times, prints this:
Getting fields for <class 'rest_framework.serializers.ListSerializer'>
And then fails with:
Traceback (most recent call last):
File "/Users/zachsmith/makespace/site/ve/lib/python2.7/site-packages/rest_framework/views.py", line 403, in dispatch
response = handler(request, *args, **kwargs)
File "/Users/zachsmith/makespace/site/ve/lib/python2.7/site-packages/rest_framework_swagger/views.py", line 137, in get
'models': generator.get_models(apis),
File "/Users/zachsmith/makespace/site/ve/lib/python2.7/site-packages/rest_framework_swagger/docgenerator.py", line 111, in get_models
self._find_field_serializers(serializers)
File "/Users/zachsmith/makespace/site/ve/lib/python2.7/site-packages/rest_framework_swagger/docgenerator.py", line 244, in _find_field_serializers
serializers_set.update(self._find_field_serializers((field.__class__, ), serializers_set))
File "/Users/zachsmith/makespace/site/ve/lib/python2.7/site-packages/rest_framework_swagger/docgenerator.py", line 239, in _find_field_serializers
fields = serializer().get_fields()
File "/Users/zachsmith/makespace/site/ve/lib/python2.7/site-packages/rest_framework/serializers.py", line 442, in __init__
assert self.child is not None, '`child` is a required argument.'
It seems that what is happening is, when swagger hits a serializer that I have defined with many=True (or perhaps with a ListField, which is the same in DRF3), it tries to instantiate the ListSerializer—not my serializer—and then can't introspect it.
The text was updated successfully, but these errors were encountered:
On django-rest-swagger 0.2.3:
With a debug statement inserted at line 238 of
docgenerator.py
, I see that swagger is introspecting all the different serializers I have declared. But it also, at times, prints this:Getting fields for <class 'rest_framework.serializers.ListSerializer'>
And then fails with:
It seems that what is happening is, when swagger hits a serializer that I have defined with
many=True
(or perhaps with aListField
, which is the same in DRF3), it tries to instantiate the ListSerializer—not my serializer—and then can't introspect it.The text was updated successfully, but these errors were encountered: