def METHOD_NAME(self, serializer):
    """
    Given an instance of a serializer, return a dictionary of metadata
    about its fields.
    """
    if hasattr(serializer, "child"):
        # If this is a `ListSerializer` then we want to examine the
        # underlying child serializer instance instead.
        serializer = serializer.child
    # Remove the URL field if present
    serializer.fields.pop(api_settings.URL_FIELD_NAME, None)
    return {
        format_field_name(field_name): self.get_field_info(field)
        for field_name, field in serializer.fields.items()
    }