Closed jmaister closed 2 years ago
Can you please double chech if tenants.yml (reduced) generates this error? I tried with the latest version several times, but didn't see the error. Thanks
Yes, the reduced file of tenants.xml works fine. I get that error when running it on the main.xml file
APIFuzzer -s main.xml
However, the full version gives me a recursion error. I'll create a new issue when I can create a reduced file with the error.
I thought the reduced API is for me. Can you please test if the issue still exists with the new APIFuzzer version?
Running with the new version, I get these error logs:
jordi@DESKTOP-NISTS11:/mnt/c/dev/workspace/saas-api/openapi$ APIFuzzer -s main.yml -u 192.168.1.34:8080 --headers '[{"Authorization": "Bearer ..."}]'
209 [ ERROR] APIFuzzer: Exception: 'list' object has no attribute 'get'
Traceback (most recent call last):
File "/mnt/c/dev/workspace/APIFuzzer/apifuzzer/fuzzer.py", line 45, in prepare
template_generator.process_api_resources()
File "/mnt/c/dev/workspace/APIFuzzer/apifuzzer/openapi_template_generator.py", line 109, in process_api_resources
self._process_request_body()
File "/mnt/c/dev/workspace/APIFuzzer/apifuzzer/openapi_template_generator.py", line 123, in _process_request_body
paths[resource][method].get("requestBody", {}).get("content", [])
AttributeError: 'list' object has no attribute 'get'
Unexpected exception happened during fuzz test preparation: 'list' object has no attribute 'get'. Feel free to report the issue
After removed the following lines from the tenants.xml " /v1/tenants/{tenantId}: $ref: 'tenants.yml#/paths/~1v1~1tenants~1%7BtenantId%7D" The latest version started fuzzing.
The exception reports a strange thing: "APIFuzzer/apifuzzer/openapi_template_generator.py", line 123, in _process_request_body paths[resource][method].get("requestBody", {}).get("content", []) AttributeError: 'list' object has no attribute 'get'" either the method or the requestBody key is a list instead of the expected dict. Please make sure your API definiton is valid.
I am not really sure if it is related so I decided to open a new bug report even if the error message is kind of the same. See #49
Describe the bug
The OpenAPI definition that I am using has references ($ref) in the
/paths
section. The parser from APIFuzzer does not take it as valid.APIFuzzer debug log
Related API definition
main.yml
tenants.yml (reduced)
Software environment (please complete the following information):
Additional context Add any other context about the problem here.