Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

135
Views
Can swagger generate a javascript client with common JS instead of ESM?

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"
        }
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!