Comments (6)
Hi @Mato816. CATS only supports application/json
as Content-Type. As I see in the Pet Store json contract the POST endpoint accepts application/x-www-form-urlencoded
. You can provide additional contentTypes using the --contentType
argument (like --contentType=application/x-www-form-urlencoded
) but that might lead to some things breaking as it expects JSON elements to be present.
from cats.
Hi @en-milie,
thank you for your response. If i provided additional parameter --contentType=application/x-www-form-urlencoded
it worked well.
I have only additional question. If i have API docs the POST endpoint accepts */*
what can i provide in --contentType
additional argument?
API doc - petstoreTest.zip
from cats.
Hi @Mato816. To answer your question you shouldn't provide anything in --contentType
as it adds json by default. I'm working now on a feature to provide out of the box support for application/x-www-form-urlencoded
and multipart/form-data
on top of the default json one.
from cats.
Hi @en-milie,
I have a question on your last answer.
I tried fuzzing for API doc petstoreTest.zip with following command:
java -jar cats.jar --contract=petstoreTest.yaml --server=https://petstore.swagger.io --paths=/pet/{petId} --urlParams=petId:PET-123 --httpMethods=POST
and got message:
The following HTTP methods won't be executed for path /pet/{petId}: [DELETE]
I know that this issues isn't related with issue I created but I have a question if I'm providing some bad arguments or not?
Because you replied me that i shouldn't provide anything in --contentType
argument.
Can you please help me with this issue?
from cats.
Hi @Mato816. The way you run CATS restricts it only to POST (you provide --httpMethods=POST
) which means that CATS won't run for DELETE. If you want to have CATS running for all http methods, you just need to remove the last bit:
java -jar cats.jar --contract=petstoreTest.yaml --server=https://petstore.swagger.io --paths=/pet/{petId} --urlParams=petId:PET-123
.
Looking at the sample contract it seems that the POST method does not have a declared body. This means that CATS cannot do any fuzzing, so there won't be any fuzzer running for POST. But you you run the above command you'll see that it runs for DELETE as it has path params.
from cats.
Hi @en-milie,
thank you for your explanation. I'm closing this issue now.
from cats.
Related Issues (20)
- Error in payload generation HOT 6
- The token setting doesn't work in CATS HOT 2
- NullPointerException when using discriminator, oneOf, allOf HOT 4
- Add boundaries to multipart/form-data file upload HOT 2
- Feature Request: Add support for test report generation in the replay command HOT 1
- Ignoring a field inside a functional fuzzer HOT 3
- Unsupported Operation Exception when supplying headers via -H flag HOT 3
- String values are sent as integer values HOT 3
- CATS 9.0.1 convert all components of the contract to String HOT 5
- Publishing of Maven release, enabling programmatic usage in Java HOT 7
- NullPointerException: MediaType.getSchema() HOT 5
- NumberFormatException: input string HOT 3
- [Functional Fuzzer] Requesting Ability to Set Parameter Values as NULL for POST Requests in CATs HOT 5
- Request for Guidance: Writing a Functional Fuzzer for OpenAPI Specs with Missing Keys HOT 5
- [Functional Fuzzer] Date String Parsing Bug HOT 4
- SecurityFuzzer stringFile enhancement HOT 2
- FunctionalFuzzer issue with array parameters HOT 7
- Requests pass, but values are not substituted HOT 4
- Error when liniting file `com.jayway.jsonpath.PathNotFoundException` HOT 4
- Strange results number (always 0 successful, additional 2 errors) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cats.