microsoft / restler-fuzzer

RESTler is the first stateful REST API fuzzing tool for automatically testing cloud services through their REST APIs and finding security and reliability bugs in these services.
MIT License
2.52k stars 284 forks source link

PUT body parameters not showing up in grammar #777

Closed mohona7428 closed 1 year ago

mohona7428 commented 1 year ago

Description

This is the OpenAPI spec for the PUT request:

paths: { "/testing/{testingID}": { "put": {          "requestBody": {            "content": {              "application/json": {                "schema": {                  "$ref": "#/components/schemas/Testing"               }           }       }   } } }

The schema of Testing:

"Testing": {         "type": "object",         "properties": {           "id": {             "type": "string",          },           "name": {             "type": "string",           },           "description": {             "type": "string",           }         "required": [           "id",           "name"         ] }

However after compiling, this is the code in grammar.py: `request = requests.Request([

primitives.restler_static_string("PUT "),

primitives.restler_basepath("/a"),

primitives.restler_static_string("/"),

primitives.restler_static_string("testing"),

primitives.restler_static_string("/"),

primitives.restler_static_string(_testing_post_id.reader(), quoted=False),

primitives.restler_static_string(" HTTP/1.1\r\n"),

primitives.restler_static_string("Accept: application/json\r\n"),

primitives.restler_static_string("Host: localhost:8080\r\n"),

primitives.restler_static_string("Authorization: "),

primitives.restler_custom_payload_header("Authorization"),

primitives.restler_static_string("\r\n"),

primitives.restler_refreshable_authentication_token("authentication_token_tag"),

primitives.restler_static_string("\r\n"),

],

requestId="/testing/{testingID}"

)`

mohona7428 commented 1 year ago

I ran the compile once again and it seemed to have fixed itself. Not sure what happened.