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.2k stars 73 forks source link

HTTP method not supported yet! #32

Closed josip1001 closed 2 years ago

josip1001 commented 2 years ago

OS: Windows Action: Fuzz endpoint with POST method Swagger: 2.0 CATS version: 7.0.5

Hi,

we tried to launch test for fuzzing endpoint with POST method. We used "swagger":"2.0" and after run command below we have got error: HTTP method not supported yet! We executed this command twice on "openapi":"3.0.3 and it worked well.

java -jar cats.jar --contract=swaggerdoc.yaml --server=https://example.com --paths=/api/v1/xyz --headers=header.yaml --refData=refdata.yaml --httpMethods=POST

Powered by Quarkus 2.6.2.Final [**][*] ? start Starting CATS, version 7.0.5, build-time 2022-02-03T19:03:37Z UTC [**][*] ? note Processing configuration... [**][*] ? info No security custom Fuzzer file. SecurityFuzzer will be skipped! [**][*] ? info No custom Fuzzer file. FunctionalFuzzer will be skipped! [**][*] ? info Reference data file loaded successfully: {/api/v1/xyz={type=PERSON}} [**][*] ? info No URL parameters supplied! [**][*] ? complete Finished parsing the contract in 842 ms [**][*] ? start Start cleaning up cats-report folder ... [**][*] ? complete Cleanup complete! [**][*] ? info [**][*] ? start Start fuzzing path /api/v1/xyz [**][*] ? warning Skipping path /api/v1/xyz. HTTP method not supported yet! [**][*] ? skipping Skip printing time execution statistics. You can use --printExecutionStatistics to enable this feature! [**][*] ? complete CATS finished in 82 ms. Total (excluding skipped) requests 0. ? Passed 0, ? warnings: 0, ? errors: 0, ? skipped: 0. You can open the report here:

Pls can you check it.

Thanks

en-milie commented 2 years ago

thanks for reporting this. i’ll have a look

en-milie commented 2 years ago

@josip1001 can you please post the snippet with the path under test?

josip1001 commented 2 years ago

Hi @en-milie,

java -jar cats.jar --contract=pet-api-doc-new.yaml --server=https://petstore.example.com --paths=/api/v1/pet --refData=pet.yaml --httpMethods=POST

API doc - attachment.zip

Powered by Quarkus 2.6.2.Final [**][*] ? start Starting CATS, version 7.0.5, build-time 2022-02-03T19:03:37Z UTC [**][*] ? note Processing configuration... [**][*] ? info No security custom Fuzzer file. SecurityFuzzer will be skipped! [**][*] ? info No custom Fuzzer file. FunctionalFuzzer will be skipped! [**][*] ? info Reference data file loaded successfully: {/api/v1/pet={type=DOG}} [**][*] ? info No URL parameters supplied! [**][*] ? info No headers file was supplied! No additional header will be added! [**][*] ? complete Finished parsing the contract in 230 ms [**][*] ? start Start cleaning up cats-report folder ... [**][*] ? complete Cleanup complete! [**][*] ? info [**][*] ? start Start fuzzing path /api/v1/pet [**][*] ? warning Skipping path /api/v1/pet. HTTP method not supported yet! [**][*] ? skipping Skip printing time execution statistics. You can use --printExecutionStatistics to enable this feature! [**][***] ? complete CATS finished in 86 ms. Total (excluding skipped) requests 0. ? Passed 0, ? warnings: 0, ? errors: 0, ? skipped: 0.

ludovicianul commented 2 years ago

Thanks @josip1001 !

en-milie commented 2 years ago

This is now fixed in https://github.com/Endava/cats/commit/ec4990eddcba148d2e1684cbf88935ed122f1ce8. It was caused by the content-type being application/json;charset=UTF-8 instead of simply application/json. Will be released in 7.0.6.

en-milie commented 2 years ago

This is now available in: https://github.com/Endava/cats/releases/tag/cats-7.0.6