      elif isinstance(field, serializers.RelatedField):
          return coreschema.String(title=title, description=description)
      elif isinstance(field, serializers.MultipleChoiceField):
          return coreschema.Array(
              items=coreschema.Enum(enum=list(field.choices.keys())),
              title=title,
              description=description
          )
      elif isinstance(field, serializers.ChoiceField):
          return coreschema.Enum(
 
</s> remove             enum=list(field.choices.keys()),
 </s> add             enum=list(field.choices), </s> remove         elif not self.params or list(self.params.keys()) == ['q']:
 </s> add         elif not self.params or list(self.params) == ['q']: </s> remove     return [ret[item] for item in sorted(ret.keys())]
 </s> add     return [ret[item] for item in sorted(ret)] </s> remove         for key in self._data.keys():
 </s> add         for key in self._data: </s> remove         for key in kwargs.keys():
 </s> add         for key in kwargs:
            items=coreschema.Enum(enum=list(field.choices)),
      elif isinstance(field, serializers.RelatedField):
          return coreschema.String(title=title, description=description)
      elif isinstance(field, serializers.MultipleChoiceField):
          return coreschema.Array(
            items=coreschema.Enum(enum=list(field.choices)),
              title=title,
              description=description
          )
      elif isinstance(field, serializers.ChoiceField):
          return coreschema.Enum(
keep keep keep keep replace keep keep keep keep keep
 Perfer iter(dict) over iter(dict.keys()) (#5736)

Calling dict.keys() is unnecessary. The two are functionally equivalent
on modern Pythons.

Inspired by Lennart Regebro's talk "Prehistoric Patterns in Python" from
PyCon 2017.

https://www.youtube.com/watch?v=V5-JH23Vk0I 
rest_framework/schemas/inspectors.py