Bug Report Checklist
Description
JMeter can't support json data from csv.
When I throw bellow csv data,
Example csv data
testCase,httpStatusCode,body
Success,200,"{'id':0,'username':'string','firstName':'string','lastName':'string','email':'string','password':'string','phone':'string','userStatus':0}"
I get "Invalid JSON Error" because of single quotation in json.
Request body
POST http://localhost:4010/user
POST data:
{'id':0,'username':'string','firstName':'string','lastName':'string','email':'string','password':'string','phone':'string','userStatus':0}
[no cookies]
Response body
{"error":{"code":"invalid_json","message":"Invalid JSON"}}
On the other hand, I can't use double quotation in csv.
openapi-generator version
5.0.0
OpenAPI declaration file content or url
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml
Generation Details
When I execute bellow command to generate jemeter files,
git clone https://github.com/OpenAPITools/openapi-generator
mvn install -Dmaven.test.skip=true
./bin/generate-samples.sh bin/configs/other/jmeter.yaml
I want to replace single quotation to double quotation by using jmeter default function "__javaScript".
actual output
...
<stringProp name="Argument.value">${body}</stringProp>
...
expected output
...
<stringProp name="Argument.value">${__javaScript("${body}".replace(/'/g\, '"'),)}</stringProp>
...
Steps to reproduce
see "Generation Details"
Related issues/PRs
nothing
Suggest a fix
Replace stringProp parameter
Bug Report Checklist
Description
JMeter can't support json data from csv.
When I throw bellow csv data,
Example csv data
I get "Invalid JSON Error" because of single quotation in json.
Request body
Response body
On the other hand, I can't use double quotation in csv.
openapi-generator version
5.0.0
OpenAPI declaration file content or url
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml
Generation Details
When I execute bellow command to generate jemeter files,
I want to replace single quotation to double quotation by using jmeter default function "__javaScript".
actual output
... <stringProp name="Argument.value">${body}</stringProp> ...expected output
... <stringProp name="Argument.value">${__javaScript("${body}".replace(/'/g\, '"'),)}</stringProp> ...Steps to reproduce
see "Generation Details"
Related issues/PRs
nothing
Suggest a fix
Replace stringProp parameter