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

Split the generated ts into different files? #214

Open
jayalakshmis opened this issue Mar 8, 2018 · 0 comments
Open

Split the generated ts into different files? #214

jayalakshmis opened this issue Mar 8, 2018 · 0 comments

Comments

@jayalakshmis
Copy link

jayalakshmis commented Mar 8, 2018

Hello,
I have the following code to generate ts files for my vue app. The following code generates a single file at the specified location, however I was wondering if there is an option/configuration that would let me split the generated ts files instead of a single file?

The sample2.json that i have is from here http://petstore.swagger.io/v2/swagger.json.

    var fs = require('fs');
    var CodeGen = require('swagger-js-codegen').CodeGen;
    
    var file = 'build/sample2.json';
    var swagger = JSON.parse(fs.readFileSync(file, 'UTF-8'));
    var tsSourceCode = CodeGen.getTypescriptCode({ className: 'Test', swagger: swagger, imports: ['../../typings/tsd.d.ts'] });
    fs.writeFileSync('src/api/api.ts', tsSourceCode)
})()

Packages Used
"swagger-js-codegen": "^1.12.0",

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

1 participant