Open mbeckerle-xqueue opened 2 years ago
Hi Peter,
did you have time to check this already?
Kind regards, Marcus
Hi, Did you try with the most recent APIFuzzer version?
Having the same issue on latest version
It seems that parameters is handle as a path method. In openapi_template_generator.py:
122: for content_type in (
123: paths[resource][method].get("requestBody", {}).get("content", [])
124: ):
Here method
variable contains the value "parameters". Looks like it should only be an HTTP verb.
Describe the bug
I am working with the Fuzzer and while it is working well for resources without path parameters, I experienced an exception if I include a path parameter directly under a resource (called "path item" in the documentation of OpenAPI). The idea is that for a resource like /blacklists/{blacklistId} it is not making sense to add a PATH-parameter "blacklistId" to each single CRUD method, instead it should be defined one level above. Both would be valid syntax but my parser adds it to the path item and not the operations and as the document is about 7.000 lines and I cannot find a way to make the parser add it to each operation, it would be nice if you could fix this.
Reference to documentation
See: https://spec.openapis.org/oas/v3.1.0#path-templating
This error has the same log entry like described here: #46 Maybe it has a similar or the same cause.
APIFuzzer debug log
Related API definition
In this simple example I added a path parameter 'blacklistId' to be used for all future CRUD methods. Actually I did this not by myself but this was generated by some generator and the output can be used to e.g. provide a graphical documentation and everything looks fine.
First I tried different variations from the documentation, e.g. changing order of attributes, testing a string instead of a long but as soon as I add the parameter to the yaml, the fuzzer quits. I also tried renaming the parameter as 'blacklistid' but with no success. I can remove the whole Schema and all references to it,
Then I came up testing if it is a difference if I move the parameter description to the path item's operation:
Now the parameter belongs to the GET method and the fuzzer starts running.
Software environment (please complete the following information):