Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find resource by method and path #112

johnlinp opened this issue Aug 29, 2016 · 1 comment

Find resource by method and path #112

johnlinp opened this issue Aug 29, 2016 · 1 comment


Copy link

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:
        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?

Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants