Nobody Prefers Margarine

    swagger-typescript-client-generator
    TypeScript icon, indicating that this package has built-in type declarations

    1.6.5 • Public • Published

    swagger-typescript-client-generator

    Generate typescript client/models from swagger.json file

    install

    npm install --global swagger-typescript-client-generator
    

    generate separate files for models and client

    $ swagger-typescript-client-generator models -f swagger.json > models.ts
    $ swagger-typescript-client-generator client MyApi "./models.ts" -f swagger.json > client.ts
    

    generate one file for both models and client

    $ swagger-typescript-client-generator bundle MyApi -f swagger.json > client.ts
    

    commands

    • models - generate only models
    • client <name> [importFromFile] - generate client with given name and import models from optional parameter [importFromFile] (default "./model")
    • bundle <name> - generate models and client in single run

    parameters

    • --file, -f - input file swagger.json
    • -allowVoidParameterTypes, -a - generate parameter types (query, body, formData, headers) for void values. Can apply to both models and client (see #)

    Install

    npm i swagger-typescript-client-generator

    DownloadsWeekly Downloads

    83

    Version

    1.6.5

    License

    MIT

    Unpacked Size

    37.6 kB

    Total Files

    59

    Last publish

    Collaborators

    • psrebniak