KissPeter / APIFuzzer

Fuzz test your application using your OpenAPI or Swagger API definition without coding

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to test API with POST json body

wuzzapcom opened this issue · comments

Error:

87916 [INFO] root: APIFuzzer initialized
87916 [INFO] root: Logger initialized
87916 [INFO] root: Start preparation
87916 [INFO] root: Resource: /status Method: get
87916 [INFO] root: Resource: /queues Method: get
87916 [INFO] root: Resource: /queues/{queue-name} Method: get
87916 [INFO] root: Resource: /workflows Method: post
Traceback (most recent call last):
  File "fuzzer.py", line 115, in <module>
    prog.prepare()
  File "fuzzer.py", line 40, in prepare
    template_generator.process_api_resources()
  File "/Users/n/src/acronis/APIFuzzer/apifuzzer/swagger_template_generator.py", line 38, in process_api_resources
    transform_data_to_bytes(param.get('type'))) # gives RandomBitsField at the moment
  File "/Users/n/src/acronis/APIFuzzer/apifuzzer/utils.py", line 56, in transform_data_to_bytes
    return bytes(data_in)
TypeError: cannot convert 'NoneType' object to bytes

My swagger spec for POST /workflows contains following parameter:

{
            "name": "body",
            "in": "body",
            "required": true,
            "description": "",
            "schema": {
              "$ref": "#/definitions/workflowDefinition"
            }
}

This definition is absolutely valid according to swagger 2 spec

"schema" is not supported but deffinately on the list since often used function

This feature has been implemented