Skip to content

Commit a8a1ecf

Browse files
committed
minor fixes
1 parent bd05e3c commit a8a1ecf

File tree

3 files changed

+9
-21
lines changed

3 files changed

+9
-21
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ junit.xml
88
.idea
99
.vscode
1010
*.iml
11+
dist
1112
coverage
1213
test/generated
1314
test/e2e/generated

README.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
11
# OpenAPI Typescript Codegen
22

3-
Fork ([diff](https://github.com/ferdikoomen/openapi-typescript-codegen/compare/master...mb21:openapi-typescript-codegen:generate-custom))
4-
which adds a `--serviceTemplate` option.
5-
6-
Can be used in another project by adding to `package.json`::
7-
8-
```json
9-
"openapi-typescript-codegen": "https://github.com/mb21/openapi-typescript-codegen.git#generate-custom",
10-
```
11-
12-
To release a new version, run `npm run release` and push everything, including the `dist/index.js` file to GitHub. Then, in the project using it, delete the
13-
`openapi-typescript-codegen` entry in the `package-lock.json` and run `npm install` to install the new version.
14-
15-
---
16-
173
[![NPM][npm-image]][npm-url]
184
[![License][license-image]][license-url]
195
[![Coverage][coverage-image]][coverage-url]
@@ -64,7 +50,9 @@ $ openapi --help
6450
--postfixServices Service name postfix (default: "Service")
6551
--postfixModels Model name postfix
6652
--request <value> Path to custom request file
67-
--serviceTemplate Path to custom service handlebars template to generate the service files
53+
--serviceTemplate <value> Path to custom service handlebars template to generate the service files
54+
--clientTemplate <value> Path to custom client handlebars template to generate the client file
55+
--indexTemplate <value> Path to custom index handlebars template to generate the index file
6856
-h, --help display help for command
6957
7058
Examples

src/index.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export const generate = async ({
147147
}
148148
}
149149

150-
if (serviceTemplate) {
150+
if (serviceTemplate)
151151
await writeClientServicesCustomTemplate(
152152
clientFinal,
153153
output,
@@ -160,8 +160,8 @@ export const generate = async ({
160160
exportClient,
161161
clientName
162162
);
163-
}
164-
if (clientTemplate) {
163+
164+
if (clientTemplate)
165165
await writeClientClassCustomTemplate(
166166
clientFinal,
167167
output,
@@ -173,8 +173,8 @@ export const generate = async ({
173173
clientTemplate,
174174
clientName
175175
);
176-
}
177-
if (indexTemplate) {
176+
177+
if (indexTemplate)
178178
await writeClientIndexCustomTemplate(
179179
clientFinal,
180180
output,
@@ -192,7 +192,6 @@ export const generate = async ({
192192
exportClient,
193193
clientName
194194
);
195-
}
196195
};
197196

198197
export default {

0 commit comments

Comments
 (0)