All apps/swagger-typescript-api

swagger-typescript-api

swagger-typescript-api

Generate a TypeScript or JavaScript API client from a Swagger/OpenAPI schema.

Runs as swagger-typescript-api|macOS, Linux, Windows

Autocomplete

Fig spec, with what the manifest adds · 1 subcommand · 38 options
Published once and never changed; check the digest before caching
sha256
f189131ee1788e8a506513f765871cc2a5987d1540be66fefb6a4adb078ccbae
Size
7482 bytes
Subcommands1 subcommand
swagger-typescript-api generate-templates
Generate ".ejs" templates needed for generate api
OptionsOn swagger-typescript-api itself
--version-v
Output the current version
--path-p
Path/url to swagger scheme <Path>
--output-o
Output path of typescript api file (default: "./") <Path>
--name-n
Name of output typescript api file (default: "Api.ts") <Name>
--templates-t
Path to folder containing templates <Path>
--default-as-success-d
Use "default" response status code as success response too
--responses-r
Generate additional information about request responses
--union-enums
Generate all "enum" types as union types (T1 | T2 | TN)
--add-readonly
Generate readonly properties
--route-types
Generate type definitions for API routes
--no-client
Do not generate an API class
--enum-names-as-values
Use values in 'x-enumNames' as enum values (not only as keys)
--extract-request-params
Extract request params to data contract
--extract-request-body
Extract request body type to data contract
--extract-response-body
Extract response body type to data contract
--extract-response-error
Extract response error type to data contract
--modular
Generate separated files for http client, data contracts, and routes
--js
Generate js api module with declaration file
--module-name-index
Determines which path index should be used for routes separation <Index>
--module-name-first-tag
Splits routes based on the first tag
--disableStrictSSL
Disabled strict SSL
--disableProxy
Disabled proxy
--axios
Generate axios http client
--unwrap-response-data
Unwrap the data item from the response
--disable-throw-on-error
Do not throw an error when response.ok is not true (default: false)
--single-http-client
Ability to send HttpClient instance to Api constructor (default: false)
--silent
Output only errors to console
--default-response
Default type for empty response schema <Type>
--type-prefix
Data contract name prefix <Prefix>
--type-suffix
Data contract name suffix <Suffix>
--clean-output
Clean output folder before generate api. WARNING: May cause data loss (default: false)
--api-class-name
Name of the api class <Name>
--patch
Fix up small errors in the swagger source definition (default: false)
--debug
Additional information about processes inside this tool (default: false)
--another-array-type
Generate array types as Array<Type> (by default Type[]) (default: false)
--sort-types
Sort fields and types (default: false)
--extract-enums
Extract all enums from inline interface ype content to typescript enum construction (default: false)
--help-h
Show help for swagger-typescript-api