apidash
apidash copied to clipboard
Implement fuzzy string matching to get header suggestions
Tell us about the task you want to perform and are unable to do so because the feature is not available
Currently, header suggestions are a sequence of strings which contain the given substring with no logic implemented for ordering. Algorithms like fuzzy string search etc. can be used to provide the sequence of matching strings with the most relevant item at the top.
Is behavior like this is expected?
Is this still being worked on?
This issue is still open to work on @opxdelwin The issue with the closed PR was the accuracy of results. You can read the thread for more details.
After reviewing the last PR I have added modifications to improve suggestions.
@animator are these results good?
Before (no results due to typo):
After (using fuzzy match):
@animator I worked on passing most of the test cases but there was 1 test case I could not get to pass, it is due to the nature of how fuzzy matching works. We could make an exception for this one case.:
Testing getFuzzyHeaderSuggestions function Testing using 'x-' pattern
Expected: [
'Access-Control-Max-Age',
'Max-Forwards',
'X-Api-Key',
'X-Content-Type-Options',
'X-CSRF-Token',
'X-Forwarded-For',
'X-Frame-Options',
'X-Requested-With',
'X-XSS-Protection'
]
Actual: [
'X-XSS-Protection',
'X-Api-Key',
'X-CSRF-Token',
'X-Forwarded-For',
'X-Frame-Options',
'X-Requested-With',
'X-Content-Type-Options',
'Max-Forwards',
'Expect',
'Expires',
'Access-Control-Max-Age'
]
Which: at location [0] is 'X-XSS-Protection' instead of 'Access-Control-Max-Age'