def determine_metadata(self, request, view):
        """Adds `properties` and `features` to the metadata response."""
        metadata = super(
            DynamicMetadata,
            self).determine_metadata(
            request,
            view)
        metadata['features'] = getattr(view, 'features', [])
        if hasattr(view, 'get_serializer'):
            serializer = view.get_serializer(dynamic=False)
            if hasattr(serializer, 'get_name'):
                metadata['resource_name'] = serializer.get_name()
            if hasattr(serializer, 'get_plural_name'):
                metadata['resource_name_plural'] = serializer.get_plural_name()
        metadata['properties'] = self.get_serializer_info(serializer)
        return metadata
def determine_metadata ( self , request , view ) : metadata = super ( DynamicMetadata , self ) . determine_metadata ( request , view ) metadata [ 'features' ] = getattr ( view , 'features' , [ ] ) if hasattr ( view , 'get_serializer' ) : serializer = view . get_serializer ( dynamic = False ) if hasattr ( serializer , 'get_name' ) : metadata [ 'resource_name' ] = serializer . get_name ( ) if hasattr ( serializer , 'get_plural_name' ) : metadata [ 'resource_name_plural' ] = serializer . get_plural_name ( ) metadata [ 'properties' ] = self . get_serializer_info ( serializer ) return metadata
Adds `properties` and `features` to the metadata response.