You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERROR:root:'GET /hello/Tester'
Traceback (most recent call last):
File "/Users/danielwiddis/git/opensearch-sdk-py/samples/hello/hello.py", line 48, in handle_connection
output = request_handlers.handle(request, input)
File "/Users/danielwiddis/git/opensearch-sdk-py/src/opensearch_sdk_py/actions/request_handlers.py", line 35, in handle
return handler.handle(request, input) if handler else None
File "/Users/danielwiddis/git/opensearch-sdk-py/src/opensearch_sdk_py/actions/internal/extension_rest_request_handler.py", line 31, in handle
response = ExtensionRestHandlers().handle(route, extension_rest_request)
File "/Users/danielwiddis/git/opensearch-sdk-py/src/opensearch_sdk_py/rest/extension_rest_handlers.py", line 45, in handle
return self[route].handle_request(request)
KeyError: 'GET /hello/Tester'
What is the expected behavior?
The Rest Request is sent to the correct handler, and the params map is populated with the named wildcard key and value (in this case, params["name"] = "Tester" and this code would then work:
This relates to #35 in that we need to track wildcards in the RestHandlers class and keep track of their original names. Matching incoming strings will be more complex than a dictionary key. I expect glob matching will be the most straightforward solution, or instead of using a regular dictionary use a Trie like OpenSearch's PathTrie
The text was updated successfully, but these errors were encountered:
dbwiddis
added
bug
Something isn't working
untriaged
Issues that require attention from the maintainers.
hacktoberfest
Welcome Hacktoberfest participants!
and removed
untriaged
Issues that require attention from the maintainers.
labels
Sep 17, 2023
dbwiddis
changed the title
[BUG] Rest Requests do not properly parse named params
[BUG] Rest Requests do not properly parse named wildcards
Sep 17, 2023
What is the bug?
A Rest Handler route using a named param does not match.
How can one reproduce the bug?
Add a route which includes a named param. For example
Then send a Rest Request such as
/hello/Tester
.This results in
What is the expected behavior?
The Rest Request is sent to the correct handler, and the
params
map is populated with the named wildcard key and value (in this case,params["name"] = "Tester"
and this code would then work:Do you have any additional context?
This relates to #35 in that we need to track wildcards in the
RestHandlers
class and keep track of their original names. Matching incoming strings will be more complex than a dictionary key. I expect glob matching will be the most straightforward solution, or instead of using a regular dictionary use a Trie like OpenSearch's PathTrieThe text was updated successfully, but these errors were encountered: