Open tpardee opened 9 months ago
Hello @tpardee,
Yes, this is a bug. Please send the PR with your local fix.
Thank you!
Marina
The legal process within my company is pretty cumbersome for me to contribute and this is fixed with a one line code change. Is it possible to report the change rather than pull request it?
Change is at restler.py line 525 currently code is with open(grammar_path, 'r') as grammar:
fixed code is with open(grammar_path, 'r', encoding='utf-8') as grammar:
if it still needs to be done through pull request please let me know.
Looks good, will merge this change.
Thanks,
Marina
Description
We have an OpenAPI spec with some example data in Chinese characters. RESTler will accept this data in the compile step but will give an error when trying to test or fuzz against it.
I've fixed this issue locally and can do a pull request if you agree this is a bug.
Steps to reproduce
Have an openAPI spec that has some example data in Chinese. example paths: /xxx/xxx: post: requestBody: content: application/json: schema: type: object example: Name: 公司
Do a RESTler compile with that OpenAPI spec
Do a RESTler test with the generated output
Expected results
Expect to get normal test output report
Actual results
Standard out will have ERROR: Restler engine failed. See logs in xxxx directory for more information.
EngineStdOut.txt log will have the below message
Failed to process grammar file: c:\src\restler-fuzzer\tscbc_fuzzing\Compile\grammar.json; 'charmap' codec can't decode byte 0x81 in position 3577: character maps to
Environment details
Windows 11, Python 3.11.1, .Net 7.0.102, RESTler 9.2.2