@@ -56,6 +56,12 @@ npx @manifoldco/swagger-to-ts schema.yaml --wrapper "declare namespace API"
5656npx @manifoldco/swagger-to-ts schema.yaml --wrapper " declare module '@api'"
5757```
5858
59+ By default, wrapper is ` declare namespace OpenAPI2 ` . You can skip exposing types via a wrapper by adding the ` --nowrapper ` flag:
60+
61+ ``` bash
62+ npx @manifoldco/swagger-to-ts schema.yaml --nowrapper
63+ ```
64+
5965As mentioned before, this uses [ Prettier] [ prettier ] to clean up output, so
6066extra spaces are generally OK here. Prettier also will err on cleanup if you
6167specify invalid TypeScript, letting you know on generation if anything went
@@ -102,6 +108,7 @@ also use the Node API (below).
102108| ` --output [location] ` | ` -o ` | (stdout) | Where should the output file be saved? |
103109| ` --swagger [version] ` | ` -s ` | ` 2 ` | Which Swagger version to use. Currently only supports ` 2 ` . |
104110| ` --camelcase ` | ` -c ` | ` false ` | Convert ` snake_case ` properties to ` camelCase ` ? |
111+ | ` --nowrapper ` | ` -nw ` | ` false ` | Disables rendering a wrapper |
105112
106113### Node
107114
@@ -128,11 +135,11 @@ specs, [glob][glob] may also come in handy.
128135
129136#### Node Options
130137
131- | Name | Type | Default | Description |
132- | :---------- | :-------: | :--------------------------: | :--------------------------------------------------------- |
133- | ` wrapper ` | ` string ` | ` declare namespace OpenAPI2 ` | How should this export the types? |
134- | ` swagger ` | ` number ` | ` 2 ` | Which Swagger version to use. Currently only supports ` 2 ` . |
135- | ` camelcase ` | ` boolean ` | ` false ` | Convert ` snake_case ` properties to ` camelCase ` |
138+ | Name | Type | Default | Description |
139+ | :---------- | :--------------- : | :--------------------------: | :----------------- --------------------------------------------------------- |
140+ | ` wrapper ` | ` string \| false ` | ` declare namespace OpenAPI2 ` | How should this export the types? Pass false to disable rendering a wrapper |
141+ | ` swagger ` | ` number ` | ` 2 ` | Which Swagger version to use. Currently only supports ` 2 ` . |
142+ | ` camelcase ` | ` boolean ` | ` false ` | Convert ` snake_case ` properties to ` camelCase ` |
136143
137144[ glob ] : https://www.npmjs.com/package/glob
138145[ js-yaml ] : https://www.npmjs.com/package/js-yaml
0 commit comments