              description=description
          )
      elif isinstance(field, serializers.ChoiceField):
          return coreschema.Enum(
              enum=list(field.choices.keys()),
              title=title,
              description=description
          )
      elif isinstance(field, serializers.BooleanField):
          return coreschema.Boolean(title=title, description=description)
 
</s> remove             items=coreschema.Enum(enum=list(field.choices.keys())),
 </s> add             items=coreschema.Enum(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             list(declared_fields.keys()) +
            list(model_info.fields.keys()) +
            list(model_info.forward_relations.keys())
 </s> add             list(declared_fields) +
            list(model_info.fields) +
            list(model_info.forward_relations) </s> remove             list(declared_fields.keys()) +
            list(model_info.fields.keys()) +
            list(model_info.forward_relations.keys())
 </s> add             list(declared_fields) +
            list(model_info.fields) +
            list(model_info.forward_relations)
            enum=list(field.choices),
              description=description
          )
      elif isinstance(field, serializers.ChoiceField):
          return coreschema.Enum(
            enum=list(field.choices),
              title=title,
              description=description
          )
      elif isinstance(field, serializers.BooleanField):
          return coreschema.Boolean(title=title, description=description)
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