You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[11:05 AM] Zheng, Gary
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?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
[11:05 AM] Zheng, Gary
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"
}
Beta Was this translation helpful? Give feedback.
All reactions