Skip to content

antoniopresto/swagger-ts-client-gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Generate a TypeScript client from a swagger.json file

Install

[yarn add | npm install] swagger-ts-client-gen

Usage

CLI

swagger-ts-client-gen

generate client

Options:
  --help           Show help                                           [boolean]
  --version        Show version number                                 [boolean]
  --namespace, -n  Module namespace                                   [required]
  --url, -u        URL of swagger.json file
  --file, -f       Path of swagger.json file
  --out, -o        Output path (e.g. ./out/swagger.json)              [required]
  --baseUrl, -b    Base URL of API

Programmatic

import { generate } from "swagger-ts-client-gen";

generate({
    destPath: "./api.ts",
    namespace: "Api",
    srcPath: "./swagger.json",
    type: "file",
}).then(() => console.log("success!"))

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published