              'description': get_view_description(self.__class__),
              'renders': [renderer.media_type for renderer in self.renderer_classes],
              'parses': [parser.media_type for parser in self.parser_classes],
          }
          #  TODO: Add 'fields', from serializer info, if it exists.
          # serializer = self.get_serializer()
          # if serializer is not None:
          #     field_name_types = {}
          #     for name, field in form.fields.iteritems():
          #         field_name_types[name] = field.__class__.__name__
          #     content['fields'] = field_name_types
  
      def http_method_not_allowed(self, request, *args, **kwargs):
          """
          If `request.method` does not correspond to a handler method,
          determine what kind of exception to raise.
 
</s> remove         return {
 </s> add         content = { </s> remove from rest_framework.request import Request
 </s> add from rest_framework.request import clone_request, Request
        action_metadata = self._generate_action_metadata(request)
        if action_metadata is not None:
            content['actions'] = action_metadata

        return content

    def _generate_action_metadata(self, request):
        '''
        Helper for generating the fields metadata for allowed and permitted methods.
        '''
        actions = {}

        for method in self.allowed_methods:
            cloned_request = clone_request(request, method)
            try:
                self.check_permissions(cloned_request)

                # TODO: find right placement - APIView does not have get_serializer
                serializer = self.get_serializer()
                if serializer is not None:
                    field_name_types = {}
                    for name, field in serializer.fields.iteritems():
                        field_name_types[name] = field.__class__.__name__

                actions[method] = field_name_types
            except:
                # don't add this method
                pass

        return actions if len(actions) > 0 else None
              'description': get_view_description(self.__class__),
              'renders': [renderer.media_type for renderer in self.renderer_classes],
              'parses': [parser.media_type for parser in self.parser_classes],
          }
        action_metadata = self._generate_action_metadata(request)
        if action_metadata is not None:
            content['actions'] = action_metadata

        return content

    def _generate_action_metadata(self, request):
        '''
        Helper for generating the fields metadata for allowed and permitted methods.
        '''
        actions = {}

        for method in self.allowed_methods:
            cloned_request = clone_request(request, method)
            try:
                self.check_permissions(cloned_request)

                # TODO: find right placement - APIView does not have get_serializer
                serializer = self.get_serializer()
                if serializer is not None:
                    field_name_types = {}
                    for name, field in serializer.fields.iteritems():
                        field_name_types[name] = field.__class__.__name__

                actions[method] = field_name_types
            except:
                # don't add this method
                pass

        return actions if len(actions) > 0 else None
        action_metadata = self._generate_action_metadata(request)
        if action_metadata is not None:
            content['actions'] = action_metadata

        return content

    def _generate_action_metadata(self, request):
        '''
        Helper for generating the fields metadata for allowed and permitted methods.
        '''
        actions = {}

        for method in self.allowed_methods:
            cloned_request = clone_request(request, method)
            try:
                self.check_permissions(cloned_request)

                # TODO: find right placement - APIView does not have get_serializer
                serializer = self.get_serializer()
                if serializer is not None:
                    field_name_types = {}
                    for name, field in serializer.fields.iteritems():
                        field_name_types[name] = field.__class__.__name__

                actions[method] = field_name_types
            except:
                # don't add this method
                pass

        return actions if len(actions) > 0 else None
        action_metadata = self._generate_action_metadata(request)
        if action_metadata is not None:
            content['actions'] = action_metadata

        return content

    def _generate_action_metadata(self, request):
        '''
        Helper for generating the fields metadata for allowed and permitted methods.
        '''
        actions = {}

        for method in self.allowed_methods:
            cloned_request = clone_request(request, method)
            try:
                self.check_permissions(cloned_request)

                # TODO: find right placement - APIView does not have get_serializer
                serializer = self.get_serializer()
                if serializer is not None:
                    field_name_types = {}
                    for name, field in serializer.fields.iteritems():
                        field_name_types[name] = field.__class__.__name__

                actions[method] = field_name_types
            except:
                # don't add this method
                pass

        return actions if len(actions) > 0 else None
        action_metadata = self._generate_action_metadata(request)
        if action_metadata is not None:
            content['actions'] = action_metadata

        return content

    def _generate_action_metadata(self, request):
        '''
        Helper for generating the fields metadata for allowed and permitted methods.
        '''
        actions = {}

        for method in self.allowed_methods:
            cloned_request = clone_request(request, method)
            try:
                self.check_permissions(cloned_request)

                # TODO: find right placement - APIView does not have get_serializer
                serializer = self.get_serializer()
                if serializer is not None:
                    field_name_types = {}
                    for name, field in serializer.fields.iteritems():
                        field_name_types[name] = field.__class__.__name__

                actions[method] = field_name_types
            except:
                # don't add this method
                pass

        return actions if len(actions) > 0 else None
        action_metadata = self._generate_action_metadata(request)
        if action_metadata is not None:
            content['actions'] = action_metadata

        return content

    def _generate_action_metadata(self, request):
        '''
        Helper for generating the fields metadata for allowed and permitted methods.
        '''
        actions = {}

        for method in self.allowed_methods:
            cloned_request = clone_request(request, method)
            try:
                self.check_permissions(cloned_request)

                # TODO: find right placement - APIView does not have get_serializer
                serializer = self.get_serializer()
                if serializer is not None:
                    field_name_types = {}
                    for name, field in serializer.fields.iteritems():
                        field_name_types[name] = field.__class__.__name__

                actions[method] = field_name_types
            except:
                # don't add this method
                pass

        return actions if len(actions) > 0 else None
        action_metadata = self._generate_action_metadata(request)
        if action_metadata is not None:
            content['actions'] = action_metadata

        return content

    def _generate_action_metadata(self, request):
        '''
        Helper for generating the fields metadata for allowed and permitted methods.
        '''
        actions = {}

        for method in self.allowed_methods:
            cloned_request = clone_request(request, method)
            try:
                self.check_permissions(cloned_request)

                # TODO: find right placement - APIView does not have get_serializer
                serializer = self.get_serializer()
                if serializer is not None:
                    field_name_types = {}
                    for name, field in serializer.fields.iteritems():
                        field_name_types[name] = field.__class__.__name__

                actions[method] = field_name_types
            except:
                # don't add this method
                pass

        return actions if len(actions) > 0 else None
        action_metadata = self._generate_action_metadata(request)
        if action_metadata is not None:
            content['actions'] = action_metadata

        return content

    def _generate_action_metadata(self, request):
        '''
        Helper for generating the fields metadata for allowed and permitted methods.
        '''
        actions = {}

        for method in self.allowed_methods:
            cloned_request = clone_request(request, method)
            try:
                self.check_permissions(cloned_request)

                # TODO: find right placement - APIView does not have get_serializer
                serializer = self.get_serializer()
                if serializer is not None:
                    field_name_types = {}
                    for name, field in serializer.fields.iteritems():
                        field_name_types[name] = field.__class__.__name__

                actions[method] = field_name_types
            except:
                # don't add this method
                pass

        return actions if len(actions) > 0 else None
  
      def http_method_not_allowed(self, request, *args, **kwargs):
          """
          If `request.method` does not correspond to a handler method,
          determine what kind of exception to raise.
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep
 expose the fields metadata via OPTIONS as described in https://github.com/tomchristie/django-rest-framework/issues/192

missing:
 - get fields for method (currently all the same)
 - tests
 - right placement of code 
rest_framework/views.py