When I use Swagger-codegen 3.x to send the post request and generate a javascript client, I noticed that the javascript client it generated works fine with ESM instead of common JS (require('') syntax). That is, if I want to test the endpoint I have to create a test.mjs file instead of test.js file. The docker image I used is "swaggerapi/swagger-generator-v3:latest". The endpoint I'm using is "http://localhost:8080/api/generate". I have passed the option useES6 in the body and it does not work. Here is the body I send the post request. Are there any ways I can create with a common JS?
json: {
"options": {},
"spec": parsedRawdata,
"codegenVersion": "V3",
"lang": "javascript",
"type": "CLIENT"
},
headers: {
"Accept": "application/octet-stream",
"Content-Type": "application/json"
}