0.5.39 • Published 3 months ago

numspot-openapi-typescript-codegen v0.5.39

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

OpenAPI Typescript Codegen

NPM License Coverage Coverage Downloads Build

Node.js library that generates Typescript clients based on the OpenAPI specification.

Why?

  • Frontend ❤️ OpenAPI, but we do not want to use JAVA codegen in our builds
  • Quick, lightweight, robust and framework-agnostic 🚀
  • Supports generation of TypeScript clients
  • Supports generations of Fetch, Node-Fetch, Axios, Angular and XHR http clients
  • Supports OpenAPI specification v2.0 and v3.0
  • Supports JSON and YAML files for input
  • Supports generation through CLI, Node.js and NPX
  • Supports tsc and @babel/plugin-transform-typescript
  • Supports aborting of requests (cancelable promise pattern)
  • Supports external references using json-schema-ref-parser

Install

npm install openapi-typescript-codegen --save-dev

Usage

$ openapi --help

  Usage: openapi [options]

  Options:
    -V, --version             output the version number
    -i, --input <value>       OpenAPI specification, can be a path, url or string content (required)
    -o, --output <value>      Output directory (required)
    -c, --client <value>      HTTP client to generate [fetch, xhr, node, axios, angular] (default: "fetch")
    --name <value>            Custom client class name
    --useOptions              Use options instead of arguments
    --useUnionTypes           Use union types instead of enums
    --exportCore <value>      Write core files to disk (default: true)
    --exportExtendedServices <value>  Write nextJS actions to disk (default: true)
    --exportServices <value>  Write services to disk (default: true)
    --exportModels <value>    Write models to disk (default: true)
    --exportSchemas <value>   Write schemas to disk (default: false)
    --indent <value>          Indentation options [4, 2, tab] (default: "2")
    --postfixExtendedServices Extended service name postfix (default: "ExtendedServices")
    --postfixServices         Service name postfix (default: "Service")
    --postfixModels           Model name postfix
    --request <value>         Path to custom request file
    -h, --help                display help for command

  Examples
    $ openapi --input ./spec.json --output ./generated
    $ openapi --input ./spec.json --output ./generated --client xhr

Documentation

The main documentation can be found in the openapi-typescript-codegen/wiki

Sponsors

If you or your company use the OpenAPI Typescript Codegen, please consider supporting me. By sponsoring I can free up time to give this project some love! Details can be found here: https://github.com/sponsors/ferdikoomen

If you're from an enterprise looking for a fully managed SDK generation, please consider our sponsor:

0.5.18

3 months ago

0.5.19

3 months ago

0.5.16

3 months ago

0.5.17

3 months ago

0.5.15

3 months ago

0.5.32

3 months ago

0.5.33

3 months ago

0.5.30

3 months ago

0.5.31

3 months ago

0.5.38

3 months ago

0.5.39

3 months ago

0.5.36

3 months ago

0.5.37

3 months ago

0.5.34

3 months ago

0.5.35

3 months ago

0.5.21

3 months ago

0.5.22

3 months ago

0.5.20

3 months ago

0.5.29

3 months ago

0.5.27

3 months ago

0.5.28

3 months ago

0.5.25

3 months ago

0.5.26

3 months ago

0.5.23

3 months ago

0.5.24

3 months ago

0.5.10

3 months ago

0.5.11

3 months ago

0.5.14

3 months ago

0.5.12

3 months ago

0.5.13

3 months ago

0.3.0

3 months ago

0.5.4

3 months ago

0.5.3

3 months ago

0.5.6

3 months ago

0.5.5

3 months ago

0.5.0

3 months ago

0.5.2

3 months ago

0.5.1

3 months ago

0.5.8

3 months ago

0.5.7

3 months ago

0.5.9

3 months ago

0.4.5

3 months ago

0.4.4

3 months ago

0.4.6

3 months ago

0.4.1

3 months ago

0.4.0

3 months ago

0.4.3

3 months ago

0.4.2

3 months ago

0.2.46

3 months ago

0.2.45

3 months ago

0.2.44

3 months ago

0.2.43

3 months ago

0.2.42

3 months ago

0.2.41

3 months ago

0.2.40

3 months ago

0.2.39

3 months ago

0.2.38

3 months ago

0.2.37

3 months ago

0.2.36

3 months ago

0.2.35

3 months ago

0.2.34

3 months ago

0.2.33

3 months ago

0.2.32

3 months ago

0.2.31

3 months ago

0.2.30

3 months ago

0.2.29

3 months ago

0.2.28

3 months ago

0.2.27

3 months ago

0.2.26

3 months ago

0.2.25

3 months ago

0.2.24

3 months ago

0.2.23

3 months ago

0.2.22

3 months ago

0.2.21

3 months ago

0.2.20

3 months ago

0.2.19

3 months ago

0.2.18

3 months ago

0.2.17

3 months ago

0.2.16

3 months ago

0.2.15

3 months ago

0.2.14

3 months ago

0.2.13

3 months ago

0.2.12

3 months ago

0.2.11

3 months ago

0.2.10

3 months ago

0.2.9

3 months ago

0.2.8

3 months ago

0.2.7

3 months ago

0.2.6

3 months ago

0.2.5

3 months ago

0.2.4

3 months ago

0.2.3

3 months ago

0.2.2

3 months ago

0.2.1

3 months ago

0.2.0

3 months ago

0.1.3

3 months ago

0.1.2

3 months ago

0.1.1

3 months ago

0.1.0

3 months ago