'Return a list of `coreapi.Field` instances corresponding to any
templated path variables.'

def get_path_fields(self, path, method, view):

    model = getattr(getattr(view, 'queryset', None), 'model', None)
    fields = []
    for variable in uritemplate.variables(path):
        title = ''
        description = ''
        schema_cls = coreschema.String
        kwargs = {}
        if (model is not None):
            try:
                model_field = model._meta.get_field(variable)
            except:
                model_field = None
            if ((model_field is not None) and model_field.verbose_name):
                title = force_text(model_field.verbose_name)
            if ((model_field is not None) and model_field.help_text):
                description = force_text(model_field.help_text)
            elif ((model_field is not None) and model_field.primary_key):
                description = get_pk_description(model, model_field)
            if (hasattr(view, 'lookup_value_regex') and (view.lookup_field == variable)):
                kwargs['pattern'] = view.lookup_value_regex
            elif isinstance(model_field, models.AutoField):
                schema_cls = coreschema.Integer
        field = coreapi.Field(name=variable, location='path', required=True, schema=schema_cls(title=title, description=description, **kwargs))
        fields.append(field)
    return fields
