Docker wrapper to https://github.com/lee-elenbaas/openapi-typescript-codegen
305
Node.js library that generates Typescript clients based on the OpenAPI specification.
npm install openapi-typescript-codegen --save-dev
$ 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)
--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: "4")
--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
Help screen
docker run leeelenbaas/openapi-typescript-codegen --help
Generate client for sample.yaml in current folder to the client subfolder
docker run -v "$PWD:/src" leeelenbaas/openapi-typescript-codegen -i sample.yaml -o client
--name--useOptions--useUnionTypes--exportSchemasContent type
Image
Digest
sha256:526b318af…
Size
343.5 MB
Last updated
over 3 years ago
docker pull leeelenbaas/openapi-typescript-codegen