swagger-typescript-client-generator-fork
v1.2.31
Published
Tool to convert swagger 2.0 file to typescript client
Downloads
9
Maintainers
Readme
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 modelsclient <name> [importFromFile]
- generate client with givenname
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) forvoid
values. Can apply to both models and client (see #)