@@ -26,8 +26,8 @@ You can check the version we develop and test against [here](https://github.com/
2626 { <h3 >Install dependencies</h3 >}
2727 First install the CLI and the required runtime packages to your project:
2828 ```sh npm2yarn
29- npm i --dev @nahkies/openapi-code-generator
30- npm i @nahkies/typescript-fetch-runtime
29+ npm i --save- dev @nahkies/openapi-code-generator
30+ npm i --save @nahkies/typescript-fetch-runtime
3131 ```
3232
3333 You could also run the cli through ` npx ` , or install it globally if you prefer, but it's recommended to pin its
@@ -38,7 +38,7 @@ You can check the version we develop and test against [here](https://github.com/
3838
3939 You can provide either a local file path or url for the input file.
4040 ```sh npm2yarn
41- npm run openapi-code-generator \
41+ npm exec -- openapi-code-generator \
4242 --input ./openapi.yaml \ # or https://example.com/openapi.{json,yaml}
4343 --output ./src/generated/clients/some-service \
4444 --template typescript-fetch
@@ -56,8 +56,8 @@ You can check the version we develop and test against [here](https://github.com/
5656 { <h3 >Install dependencies</h3 >}
5757 First install the CLI and the required runtime packages to your project:
5858 ```sh npm2yarn
59- npm i --dev @nahkies/openapi-code-generator
60- npm i axios @nahkies/typescript-axios-runtime
59+ npm i --save- dev @nahkies/openapi-code-generator
60+ npm i --save axios @nahkies/typescript-axios-runtime
6161 ```
6262
6363 You could also run the cli through ` npx ` , or install it globally if you prefer, but it's recommended to pin its
@@ -68,7 +68,7 @@ You can check the version we develop and test against [here](https://github.com/
6868
6969 You can provide either a local file path or url for the input file.
7070 ```sh npm2yarn
71- npm run openapi-code-generator \
71+ npm exec -- openapi-code-generator \
7272 --input ./openapi.yaml \ # or https://example.com/openapi.{json,yaml}
7373 --output ./src/generated/clients/some-service \
7474 --template typescript-axios
@@ -87,8 +87,8 @@ You can check the version we develop and test against [here](https://github.com/
8787 { <h3 >Install dependencies</h3 >}
8888 First install the CLI and the required runtime packages to your project:
8989 ```sh npm2yarn
90- npm i --dev @nahkies/openapi-code-generator @types/koa @types /koa__ router
91- npm i @nahkies/typescript-koa-runtime @koa/cors @koa/router koa koa-body zod
90+ npm i --save- dev @nahkies/openapi-code-generator @types/koa @types /koa__ router
91+ npm i --save @nahkies/typescript-koa-runtime @koa/cors @koa/router koa koa-body zod
9292 ```
9393
9494 You could also run the cli through ` npx ` , or install it globally if you prefer, but it's recommended to pin its
@@ -99,7 +99,7 @@ You can check the version we develop and test against [here](https://github.com/
9999 { <h3 >Run generation</h3 >}
100100 This will generate the server router and validation logic to ` ./src/generated `
101101 ```sh npm2yarn
102- npm run openapi-code-generator \
102+ npm exec -- openapi-code-generator \
103103 --input ./openapi.yaml \ # or https://example.com/openapi.{json,yaml}
104104 --output ./src/generated \
105105 --template typescript-koa
@@ -120,8 +120,8 @@ You can check the version we develop and test against [here](https://github.com/
120120 { <h3 >Install dependencies</h3 >}
121121 First install the CLI and the required runtime packages to your project:
122122 ```sh npm2yarn
123- npm i --dev @nahkies/openapi-code-generator @types/express
124- npm i @nahkies/typescript-express-runtime express zod
123+ npm i --save- dev @nahkies/openapi-code-generator @types/express
124+ npm i --save @nahkies/typescript-express-runtime express zod
125125 ```
126126
127127 You could also run the cli through ` npx ` , or install it globally if you prefer, but it's recommended to pin its
@@ -132,7 +132,7 @@ You can check the version we develop and test against [here](https://github.com/
132132 { <h3 >Run generation</h3 >}
133133 This will generate the server router and validation logic to ` ./src/generated `
134134 ```sh npm2yarn
135- npm run openapi-code-generator \
135+ npm exec -- openapi-code-generator \
136136 --input ./openapi.yaml \ # or https://example.com/openapi.{json,yaml}
137137 --output ./src/generated \
138138 --template typescript-express
@@ -152,23 +152,23 @@ You can check the version we develop and test against [here](https://github.com/
152152## CLI options
153153See the [ cli reference] ( ../reference/cli-options ) for the full range of supported options, or try
154154``` sh npm2yarn
155- npm run openapi-code-generator --help
155+ npm exec -- openapi-code-generator --help
156156```
157157
158158## Typespec specifications
159159If you want to use [ typespec] ( https://typespec.io/ ) instead of [ openapi3] ( https://spec.openapis.org/oas/latest.html )
160160as your input specifications, additionally install the typespec compiler and supporting packages.
161161
162162``` sh npm2yarn
163- npm i --dev @typespec/compiler @typespec/http @typespec/openapi @typespec/openapi3 @typespec/versioning
163+ npm i --save- dev @typespec/compiler @typespec/http @typespec/openapi @typespec/openapi3 @typespec/versioning
164164```
165165
166166Depending on how your ` typespec ` specification is written, you may need to install additional packages such
167167as ` @typespec/rest ` .
168168
169169You can then generate like so:
170170``` sh npm2yarn
171- npm run openapi-code-generator \
171+ npm exec -- openapi-code-generator \
172172 --input ./some-service.tsp \ # or https://example.com/some-service.tsp
173173 --input-type=typespec \
174174 --output ./src/generated/clients/some-service \
0 commit comments