Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: swaggerToTS is not a function #273

Closed
5t33 opened this issue Jun 14, 2020 · 1 comment
Closed

TypeError: swaggerToTS is not a function #273

5t33 opened this issue Jun 14, 2020 · 1 comment

Comments

@5t33
Copy link

5t33 commented Jun 14, 2020

I ran this as described in the readme:

const swaggerToTS = require("@manifoldco/swagger-to-ts");
const { readFileSync, writeFileSync } = require("fs");
const input = JSON.parse(readFileSync("swagger.json", "utf8")); // Input can be any JS object (OpenAPI format)
// console.log(typeof swaggerToTS)
const output = swaggerToTS(input); 
writeFileSync("swagger-types.ts", output);

But I got the following error:

const output = swaggerToTS(input); 
               ^

TypeError: swaggerToTS is not a function
@cwmetrics
Copy link

Try

const swaggerToTS = require("@manifoldco/swagger-to-ts").default; 

@drwpow drwpow closed this as completed Aug 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants