Skip to content

Commit

Permalink
Merge pull request #121 from dfeinzeig/master
Browse files Browse the repository at this point in the history
fix bug in restyresolver which was causing collision between .search and .get methods
  • Loading branch information
hjacobs committed Jan 13, 2016
2 parents 1826dda + 1b51551 commit 863e110
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion connexion/resolver.py
Expand Up @@ -125,7 +125,7 @@ def get_function_name():
method = operation.method

is_collection_endpoint = \
method == 'GET' \
method.lower() == 'get' \
and path_match.group('resource_name') \
and not path_match.group('extended_path')

Expand Down
13 changes: 13 additions & 0 deletions tests/test_resolver.py
Expand Up @@ -90,6 +90,19 @@ def test_resty_resolve_with_default_module_name():
assert operation.operation_id == 'fakeapi.hello.get'


def test_resty_resolve_with_default_module_name_lowercase_verb():
operation = Operation(method='get',
path='/hello/{id}',
operation={},
app_produces=['application/json'],
app_security=[],
security_definitions={},
definitions={},
parameter_definitions=PARAMETER_DEFINITIONS,
resolver=RestyResolver('fakeapi'))
assert operation.operation_id == 'fakeapi.hello.get'


def test_resty_resolve_with_default_module_name_will_translate_dashes_in_resource_name():
operation = Operation(method='GET',
path='/foo-bar',
Expand Down

0 comments on commit 863e110

Please sign in to comment.