Closed igutsaliuk closed 10 years ago
Hi @quonlee, thanks for the pull request. And thanks for fixing that typo in the read me file. Can you explain your use case a little bit?? I'm not sure why you would want to pass in a slash as part of your switch value. Nested paths can already be passed in to the "mockFile" setting for a web service.
Sorry for confusing, I'll try to explain with better example:
You got API query such as: mysite.com/app/browser?path="../foo/bar/file.zip" with switcher "path" and mockFIle "browser.json". ApiMocker would try to search for following mock file : "path../foo/bar/file.zip.browser.json" but such file can't exist, since FS doesn't suppport special characters in file name. The logical solution is to encode into "path..%2Ffoo%2Fbar%2Ffile.zip.browser.json" Looks kinda ugly but at least works fine :)
Otherwise please advice a better solution to resolve this issue.
Thanks for a great tool, Igor
@quonlee - I changed one line of your code, so we don't break nested paths in the "mockFile" setting. Just published it to npm. Thanks!
This fix corrent issue when you have special characters in your switch value that could not be repesented as a file. ([swith][value].[mockFile])
with following URI:
will now try to search for "path2%F.file.json" instead of "path/.file.json"