Endava / cats

CATS is a REST API Fuzzer and negative testing tool for OpenAPI endpoints. CATS automatically generates, runs and reports tests with minimum configuration and no coding effort. Tests are self-healing and do not require maintenance.
Apache License 2.0
1.17k stars 74 forks source link

Error when fuzzing `Expected to find an object with property ['th'] in path $['th'] but found 'net.minidev.json.JSONArray'` #119

Closed qarmin closed 5 months ago

qarmin commented 6 months ago

Describe the bug When trying to run ./cats random --server="$IP_ADDRESS" --contract=$DOWNLOAD_PATH --mc 500 -X POST --stopAfterTimeInSec 10 --path /rest/1/pdf/ on one openapi, then I get instantly

com.jayway.jsonpath.PathNotFoundException: Expected to find an object with property ['th'] in path $['th'] but found 'net.minidev.json.JSONArray'. This is not a json object according to the JsonProvider: 'com.jayway.jsonpath.spi.json.JsonSmartJsonProvider'.

this works fine with openapi file with removed some properties

Environment:

Key           | Value
------------- | --------------------
OS Name       | Linux
OS Version    | 6.5.0-26-generic
OS Arch       | amd64
Binary Type   | native
Cats Version  | 11.3.0
Cats Build    | 2024-03-15T07:10:32Z
Term Width    | 213
Term Type     | xterm-256color
Shell         | /bin/bash

Additional context Add any other context about the problem here.

en-milie commented 6 months ago

It should be fixed in commit f5ef319

en-milie commented 6 months ago

This is fixed in: https://github.com/Endava/cats/releases/tag/cats-11.4.0