def get_serializer_info(self, serializer):
        if hasattr(serializer, 'child'):
            # If this is a `ListSerializer` then we want to examine the
            # underlying child serializer instance instead.
            serializer = serializer.child
        return OrderedDict([
            (field_name, self.get_field_info(field))
            for field_name, field in serializer.fields.items()
        ])
Given an instance of a serializer, return a dictionary of metadata
dataset/ETHPy150Open tomchristie/django-rest-framework/rest_framework/metadata.py/SimpleMetadata.get_serializer_info