Closed aharpervc closed 2 years ago
I noticed something else about this particular report... it looks like cats doesn't support http status code "ranges" syntax in I have in the OpenAPI spec file (eg, 4xx
as defined here: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#patterned-fields-1).
The expected result in the report says "Should return [4XX] response code as required fields [were] removed", and the response code is actually 400
. The result details says:
Response does NOT match expected result. Response code is from a list of expected codes for this FUZZER, but it is undocumented: expected [400, 413, 414, 422], actual [400], documented response codes: [200, 4XX, 5XX]".
Hi, @aharpervc! Thank you for taking the time to report these. They are both valid points. CATS does not exclude readOnly fields and does not support ranges. I'll open a different bug for the ranges one as it is quite simple to enable, and leave this one for the readOnly fields.
Will probably have both available in 7.0.1.
Great, I'll look forward to the next release then. It also occurred to me that cats may benefit from a fuzzer that attempts to write to read only fields, and validates that there's an error code as the response.
@aharpervc Thank you for the idea about a new Fuzzer. The issue should be fixed in https://github.com/Endava/cats/releases/tag/cats-7.0.1
Hi, I've started playing around with cats and noticed something odd. I see a fuzz test report for the
RemoveFieldsFuzzer
that ran a post request to create a record. Based on the request payload shown in the report, a particular field was actually removed, so that part looks good.However, another field was included in the request payload that my OpenAPI spec defines as read only (the "id" field in this case). Here's a snippet from the spec, just for context (OpenAPI 3.0.0):
The request payload was otherwise structured as I'd expect with various dummy/fuzzed values. My expectation in this case is that this fuzzer would isolate the request payload such that fields marked as read only won't be included, so as to isolate the logic and only validate the behavior when some other fields is intentionally excluded.
I'm not sure if this is a cats bug, or a misunderstanding on my part, or something that can be configured. Thoughts?