When I want to find resource by method and path, I use this function:
def get_resource(resources, method, path):
for resource in resources:
if resource.method is None or resource.path is None:
continue
if resource.method.lower() == method.lower() and resource.path == path:
return resource
return None
Is there any built-in function in ramlfications to achieve that?
hey @johnlinp! Unfortunately, not; your filter method seems like the best approach at the moment. I'll keep this issue open to consider putting a feature in for a 0.2.x release.
When I want to find resource by method and path, I use this function:
Is there any built-in function in
ramlfications
to achieve that?